• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeui
 

tdeui

  • tdeui
kdatetbl.h
1 /*
2  This file is part of the KDE libraries
3  Copyright (C) 1997 Tim D. Gilman (tdgilman@best.org)
4  (C) 1998-2001 Mirko Boehm (mirko@kde.org)
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 #ifndef KDATETBL_H
21 #define KDATETBL_H
22 
23 // KDE4: rename this file to kdatetable.h
24 
25 #include <tqvalidator.h>
26 #include <tqgridview.h>
27 #include <tqlineedit.h>
28 #include <tqdatetime.h>
29 #include <tqcolor.h>
30 
31 #include <tdelibs_export.h>
32 
33 class TDEPopupMenu;
34 
40 class TDEUI_EXPORT KDateInternalWeekSelector : public TQLineEdit
41 {
42  TQ_OBJECT
43 protected:
44  TQIntValidator *val;
45  int result;
46 public slots:
47  void weekEnteredSlot();
48  void setMaxWeek(int max);
49 signals:
50  void closeMe(int);
51 public:
52  KDateInternalWeekSelector( TQWidget* parent=0, const char* name=0);
53  int getWeek();
54  void setWeek(int week);
55 
56 private:
57  class KDateInternalWeekPrivate;
58  KDateInternalWeekPrivate *d;
59 };
60 
67 class TDEUI_EXPORT KDateInternalMonthPicker : public TQGridView
68 {
69  TQ_OBJECT
70 protected:
74  int result;
78  short int activeCol;
79  short int activeRow;
83  TQRect max;
84 signals:
88  void closeMe(int);
89 public:
93  KDateInternalMonthPicker(const TQDate& date, TQWidget* parent, const char* name=0);
97  ~KDateInternalMonthPicker();
101  TQSize sizeHint() const;
106  int getResult() const;
107 protected:
111  void setupPainter(TQPainter *p);
115  virtual void viewportResizeEvent(TQResizeEvent*);
119  virtual void paintCell(TQPainter* painter, int row, int col);
123  virtual void contentsMousePressEvent(TQMouseEvent *e);
124  virtual void contentsMouseMoveEvent(TQMouseEvent *e);
128  virtual void contentsMouseReleaseEvent(TQMouseEvent *e);
129 
130 private:
131  class KDateInternalMonthPrivate;
132  KDateInternalMonthPrivate *d;
133 };
134 
140 class TDEUI_EXPORT KDateInternalYearSelector : public TQLineEdit
141 {
142  TQ_OBJECT
143 protected:
144  TQIntValidator *val;
145  int result;
146 public slots:
147  void yearEnteredSlot();
148 signals:
149  void closeMe(int);
150 public:
151  KDateInternalYearSelector( TQWidget* parent=0, const char* name=0);
152  int getYear();
153  void setYear(int year);
154 
155 private:
156  class KDateInternalYearPrivate;
157  KDateInternalYearPrivate *d;
158 
159 };
160 
166 class TDEUI_EXPORT TDEPopupFrame : public TQFrame
167 {
168  TQ_OBJECT
169 protected:
173  int result;
177  virtual void keyPressEvent(TQKeyEvent* e);
181  TQWidget *main;
182 public slots:
187  void close(int r);
191  void hide();
192 
193 public:
197  TDEPopupFrame(TQWidget* parent=0, const char* name=0);
201  ~TDEPopupFrame();
209  void setMainWidget(TQWidget* m);
214  virtual void resizeEvent(TQResizeEvent*);
218  void popup(const TQPoint &pos);
222  int exec(TQPoint p); // KDE4: const TQPoint&
226  int exec(int x, int y);
227 
228 private:
229 
230  virtual bool close(bool alsoDelete) { return TQFrame::close(alsoDelete); }
231 protected:
232  virtual void virtual_hook( int id, void* data );
233 private:
234  class TDEPopupFramePrivate;
235  TDEPopupFramePrivate *d;
236 };
237 
241 class TDEUI_EXPORT KDateValidator : public TQValidator
242 {
243 public:
244  KDateValidator(TQWidget* parent=0, const char* name=0);
245  virtual State validate(TQString&, int&) const;
246  virtual void fixup ( TQString & input ) const;
247  State date(const TQString&, TQDate&) const;
248 };
249 
263 class TDEUI_EXPORT KDateTable : public TQGridView
264 {
265  TQ_OBJECT
266  TQ_PROPERTY( TQDate date READ getDate WRITE setDate )
267  TQ_PROPERTY( bool popupMenu READ popupMenuEnabled WRITE setPopupMenuEnabled )
268 
269 public:
273  KDateTable(TQWidget *parent=0, TQDate date=TQDate::currentDate(),
274  const char* name=0, WFlags f=0);
275 
280  KDateTable(TQWidget *parent, const char* name, WFlags f=0);
281 
285  ~KDateTable();
286 
294  virtual TQSize sizeHint() const;
298  void setFontSize(int size);
302  bool setDate(const TQDate&);
303  // ### KDE 4.0 rename to date()
304  const TQDate& getDate() const;
305 
314  void setPopupMenuEnabled( bool enable );
315 
319  bool popupMenuEnabled() const;
320 
321  enum BackgroundMode { NoBgMode=0, RectangleMode, CircleMode };
322 
329  void setCustomDatePainting( const TQDate &date, const TQColor &fgColor, BackgroundMode bgMode=NoBgMode, const TQColor &bgColor=TQColor());
330 
336  void unsetCustomDatePainting( const TQDate &date );
337 
338 protected:
342  int posFromDate( const TQDate &date ); // KDE4: make this virtual, so subclasses can reimplement this and use a different default for the start of the matrix
347  TQDate dateFromPos( int pos ); // KDE4: make this virtual
348 
352  virtual void paintCell(TQPainter*, int, int);
353 
357  virtual void paintEmptyArea(TQPainter*, int, int, int, int);
358 
362  virtual void viewportResizeEvent(TQResizeEvent *);
366  virtual void contentsMousePressEvent(TQMouseEvent *);
367  virtual void wheelEvent( TQWheelEvent * e );
368  virtual void keyPressEvent( TQKeyEvent *e );
369  virtual void focusInEvent( TQFocusEvent *e );
370  virtual void focusOutEvent( TQFocusEvent *e );
371 
372  // ### KDE 4.0 make the following private and mark as members
373 
377  int fontsize;
381  TQDate date;
385  int firstday;
389  int numdays;
393  int numDaysPrevMonth;
398  bool unused_hasSelection;
402  TQRect maxCell;
403 signals:
407  // ### KDE 4.0 make parameter a const reference
408  void dateChanged(TQDate);
415  void dateChanged(const TQDate& cur, const TQDate& old);
419  void tableClicked();
420 
428  void aboutToShowContextMenu( TDEPopupMenu * menu, const TQDate &date);
429 
430 private slots:
431  void nextMonth();
432  void previousMonth();
433  void beginningOfMonth();
434  void endOfMonth();
435  void beginningOfWeek();
436  void endOfWeek();
437 
438 protected:
439  virtual void virtual_hook( int id, void* data );
440 private:
441  class KDateTablePrivate;
442  KDateTablePrivate *d;
443 
444  void initAccels();
445 };
446 
447 #endif // KDATETBL_H
KDateInternalMonthPicker
A table containing month names.
Definition: kdatetbl.h:68
KDateInternalMonthPicker::result
int result
Store the month that has been clicked [1..12].
Definition: kdatetbl.h:74
KDateInternalMonthPicker::activeCol
short int activeCol
the cell under mouse cursor when LBM is pressed
Definition: kdatetbl.h:78
KDateInternalMonthPicker::max
TQRect max
Contains the largest rectangle needed by the month names.
Definition: kdatetbl.h:83
KDateInternalMonthPicker::closeMe
void closeMe(int)
This is send from the mouse click event handler.
KDateInternalWeekSelector
Week selection widget.
Definition: kdatetbl.h:41
KDateInternalYearSelector
Year selection widget.
Definition: kdatetbl.h:141
KDateTable
Date selection table.
Definition: kdatetbl.h:264
KDateTable::firstday
int firstday
The day of the first day in the month [1..7].
Definition: kdatetbl.h:385
KDateTable::numDaysPrevMonth
int numDaysPrevMonth
The number of days in the previous month.
Definition: kdatetbl.h:393
KDateTable::date
TQDate date
The currently selected date.
Definition: kdatetbl.h:381
KDateTable::maxCell
TQRect maxCell
Save the size of the largest used cell content.
Definition: kdatetbl.h:402
KDateTable::dateChanged
void dateChanged(TQDate)
The selected date changed.
KDateTable::fontsize
int fontsize
The font size of the displayed text.
Definition: kdatetbl.h:377
KDateTable::tableClicked
void tableClicked()
A date has been selected by clicking on the table.
KDateTable::unused_hasSelection
bool unused_hasSelection
unused
Definition: kdatetbl.h:398
KDateTable::numdays
int numdays
The number of days in the current month.
Definition: kdatetbl.h:389
KDateTable::aboutToShowContextMenu
void aboutToShowContextMenu(TDEPopupMenu *menu, const TQDate &date)
A popup menu for a given date is about to be shown (as when the user right clicks on that date and th...
KDateTable::dateChanged
void dateChanged(const TQDate &cur, const TQDate &old)
This function behaves essentially like the one above.
KDateValidator
Validates user-entered dates.
Definition: kdatetbl.h:242
TDEPopupFrame
Frame with popup menu behavior.
Definition: kdatetbl.h:167
TDEPopupFrame::main
TQWidget * main
The only subwidget that uses the whole dialog window.
Definition: kdatetbl.h:181
TDEPopupFrame::result
int result
The result.
Definition: kdatetbl.h:173
TDEPopupMenu
A menu with title items.
Definition: tdepopupmenu.h:123

tdeui

Skip menu "tdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.9.1
This website is maintained by Timothy Pearson.