Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

KDateTable Class Reference

#include </home/clem/local/src/opie/noncore/apps/tinykate/libkate/microkde/kdatetbl.h>

Collaboration diagram for KDateTable:

Collaboration graph
[legend]
List of all members.

Signals

void dateChanged (QDate)
void tableClicked ()

Public Member Functions

 KDateTable (QWidget *parent=0, QDate date=QDate::currentDate(), const char *name=0, WFlags f=0)
virtual QSize sizeHint () const
void setFontSize (int size)
bool setDate (const QDate &)
const QDategetDate () const

Protected Member Functions

virtual void paintCell (QPainter *, int, int)
virtual void viewportResizeEvent (QResizeEvent *)
virtual void contentsMousePressEvent (QMouseEvent *)
virtual void keyPressEvent (QKeyEvent *e)
virtual void focusInEvent (QFocusEvent *e)
virtual void focusOutEvent (QFocusEvent *e)
virtual void virtual_hook (int id, void *data)

Protected Attributes

int fontsize
QDate date
int firstday
int numdays
int numDaysPrevMonth
bool unused_hasSelection
QRect maxCell

Private Attributes

KDateTablePrivate * d

Detailed Description

Date selection table. This is a support class for the KDatePicker class. It just draws the calender table without titles, but could theoretically be used as a standalone.

When a date is selected by the user, it emits a signal: dateSelected(QDate)

For internal use only.

Version:
Id
kdatetbl.h,v 1.1 2002/11/10 21:10:14 jowenn Exp
Author:
Tim Gilman, Mirko Boehm

Definition at line 218 of file kdatetbl.h.


Constructor & Destructor Documentation

KDateTable::KDateTable QWidget *  parent = 0,
QDate  date = QDate::currentDate(),
const char *  name = 0,
WFlags  f = 0
 

The constructor.

Definition at line 81 of file kdatetbl.cpp.

References QDate::currentDate(), Opie::Core::endl(), QDate::isValid(), kdDebug(), setDate(), and setFontSize().


Member Function Documentation

void KDateTable::contentsMousePressEvent QMouseEvent *   )  [protected, virtual]
 

React on mouse clicks that select a date.

Definition at line 294 of file kdatetbl.cpp.

References KNotifyClient::beep(), col, date, QDate::day(), firstday, KGlobal::locale(), QDate::month(), numdays, pos, row, setDate(), tableClicked(), and QDate::year().

void KDateTable::dateChanged QDate   )  [signal]
 

The selected date changed.

Referenced by setDate().

void KDateTable::focusInEvent QFocusEvent *  e  )  [protected, virtual]
 

Definition at line 378 of file kdatetbl.cpp.

void KDateTable::focusOutEvent QFocusEvent *  e  )  [protected, virtual]
 

Definition at line 384 of file kdatetbl.cpp.

const QDate & KDateTable::getDate  )  const
 

Definition at line 373 of file kdatetbl.cpp.

References date.

Referenced by KDatePicker::date(), KDatePicker::getDate(), KDatePicker::monthBackwardClicked(), KDatePicker::monthForwardClicked(), KDatePicker::selectMonthClicked(), KDatePicker::selectYearClicked(), KDatePicker::tableClickedSlot(), KDatePicker::yearBackwardClicked(), and KDatePicker::yearForwardClicked().

void KDateTable::keyPressEvent QKeyEvent *  e  )  [protected, virtual]
 

Definition at line 196 of file kdatetbl.cpp.

References assert, KNotifyClient::beep(), date, QDate::day(), firstday, i18n, QDate::isValid(), Qt::Key_Down, Qt::Key_Left, Qt::Key_Next, Qt::Key_Prior, Qt::Key_Right, Qt::Key_Up, KGlobal::locale(), QDate::month(), numdays, pos, setDate(), and QDate::year().

void KDateTable::paintCell QPainter *  ,
int  ,
int 
[protected, virtual]
 

Paint a cell.

Definition at line 102 of file kdatetbl.cpp.

References date, QDate::day(), firstday, fontsize, KGlobalSettings::generalFont(), KGlobal::locale(), maxCell, numdays, numDaysPrevMonth, pos, QString::setNum(), and text.

bool KDateTable::setDate const QDate  ) 
 

Select and display this date.

Definition at line 338 of file kdatetbl.cpp.

References date, dateChanged(), QDate::dayOfWeek(), QDate::daysInMonth(), Opie::Core::endl(), firstday, QDate::isValid(), kdDebug(), QDate::month(), numdays, numDaysPrevMonth, QDate::setYMD(), and QDate::year().

Referenced by contentsMousePressEvent(), KDateTable(), keyPressEvent(), and KDatePicker::setDate().

void KDateTable::setFontSize int  size  ) 
 

Set the font size of the date table.

Definition at line 271 of file kdatetbl.cpp.

References fontsize, QString::fromLatin1(), KGlobal::locale(), and maxCell.

Referenced by KDateTable(), and KDatePicker::setFontSize().

QSize KDateTable::sizeHint  )  const [virtual]
 

Returns a recommended size for the widget. To save some time, the size of the largest used cell content is calculated in each paintCell() call, since all calculations have to be done there anyway. The size is stored in maxCell. The sizeHint() simply returns a multiple of maxCell.

Definition at line 391 of file kdatetbl.cpp.

References Opie::Core::endl(), kdDebug(), and maxCell.

Referenced by KDatePicker::sizeHint().

void KDateTable::tableClicked  )  [signal]
 

A date has been selected by clicking on the table.

Referenced by contentsMousePressEvent().

void KDateTable::viewportResizeEvent QResizeEvent *   )  [protected, virtual]
 

Handle the resize events.

Definition at line 262 of file kdatetbl.cpp.

References height, and width.

void KDateTable::virtual_hook int  id,
void *  data
[protected, virtual]
 

Definition at line 715 of file kdatetbl.cpp.


Member Data Documentation

KDateTablePrivate* KDateTable::d [private]
 

Definition at line 304 of file kdatetbl.h.

QDate KDateTable::date [protected]
 

The currently selected date.

Definition at line 270 of file kdatetbl.h.

Referenced by contentsMousePressEvent(), getDate(), keyPressEvent(), paintCell(), and setDate().

int KDateTable::firstday [protected]
 

The day of the first day in the month [1..7].

Definition at line 274 of file kdatetbl.h.

Referenced by contentsMousePressEvent(), keyPressEvent(), paintCell(), and setDate().

int KDateTable::fontsize [protected]
 

The font size of the displayed text.

Definition at line 266 of file kdatetbl.h.

Referenced by paintCell(), and setFontSize().

QRect KDateTable::maxCell [protected]
 

Save the size of the largest used cell content.

Definition at line 290 of file kdatetbl.h.

Referenced by paintCell(), setFontSize(), and sizeHint().

int KDateTable::numdays [protected]
 

The number of days in the current month.

Definition at line 278 of file kdatetbl.h.

Referenced by contentsMousePressEvent(), keyPressEvent(), paintCell(), and setDate().

int KDateTable::numDaysPrevMonth [protected]
 

The number of days in the previous month.

Definition at line 282 of file kdatetbl.h.

Referenced by paintCell(), and setDate().

bool KDateTable::unused_hasSelection [protected]
 

unused

Definition at line 286 of file kdatetbl.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:37:22 2005 for OPIE by  doxygen 1.4.2