Diffstat (limited to 'core/pim/datebook/datebook.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/datebook/datebook.h | 87 |
1 files changed, 58 insertions, 29 deletions
diff --git a/core/pim/datebook/datebook.h b/core/pim/datebook/datebook.h index d7cfb33..54ffcfb 100644 --- a/core/pim/datebook/datebook.h +++ b/core/pim/datebook/datebook.h @@ -21,36 +21,64 @@ #define DATEBOOK_H #include <qpe/datebookdb.h> #include <qmainwindow.h> -enum { DAY=1,WEEK,WEEKLST,MONTH }; // defaultView values -enum { NONE=0,NORMAL,EXTENDED }; // WeekLstView's modes. +enum { DAY=1,WEEK,WEEKLST,MONTH }; // defaultView values +enum { NONE=0,NORMAL,EXTENDED }; // WeekLstView's modes. class QAction; class QWidgetStack; class DateBookDay; class DateBookWeek; class DateBookWeekLst; class DateBookMonth; class Event; class QDate; class Ir; +class QLibrary; + +namespace Opie { +namespace Datebook { + class HolidayPlugin; + class HolidayPluginIf; +} +} class DateBookDBHack : public DateBookDB { public: Event eventByUID(int id); }; +class DateBookHoliday +{ +public: + DateBookHoliday(); + virtual ~DateBookHoliday(); + + QStringList holidaylist(const QDate&); + QStringList holidaylist(unsigned year, unsigned month, unsigned day); +protected: + void init(); + void deinit(); + + struct HPlugin { + Opie::Datebook::HolidayPlugin*_plugin; + QLibrary*_lib; + Opie::Datebook::HolidayPluginIf*_if; + }; + QValueList<HPlugin*>_pluginlist; +}; + class DateBook : public QMainWindow { Q_OBJECT public: - static QString appName() { return QString::fromLatin1("datebook"); } + static QString appName() { return QString::fromLatin1("datebook"); } DateBook( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); ~DateBook(); signals: void newEvent(); void signalNotFound(); @@ -68,13 +96,13 @@ public slots: void reload(); private slots: void fileNew(); void slotNewEntry(const QDateTime &start, const QDateTime &end, const QString &str, const QString &location=0); void slotSettings(); - void slotToday(); // view today + void slotToday(); // view today void changeClock( bool newClock ); void changeWeek( bool newDay ); void appMessage(const QCString& msg, const QByteArray& data); // handle key events in the day view... void slotNewEventFromKey( const QString &str ); void slotFind(); @@ -86,14 +114,14 @@ private slots: void viewWeek(); void viewWeekLst(); void viewMonth(); void showDay( int y, int m, int d ); - void insertEvent( const Event &e ); - void editEvent( const Event &e ); + void insertEvent( const Event &e ); + void editEvent( const Event &e ); void duplicateEvent( const Event &e ); void removeEvent( const Event &e ); void receive( const QCString &msg, const QByteArray &data ); void setDocument( const QString & ); void beamEvent( const Event &e ); @@ -106,34 +134,35 @@ private: void initWeekLst(); void initMonth(); void loadSettings(); void saveSettings(); private: - DateBookDBHack *db; - QWidgetStack *views; - DateBookDay *dayView; - DateBookWeek *weekView; - DateBookMonth *monthView; - DateBookWeekLst *weekLstView; - QAction *dayAction, *weekAction, *weekLstAction, *monthAction; - int weeklistviewconfig; - bool aPreset; // have everything set to alarm? - int presetTime; // the standard time for the alarm - int startTime; - int rowStyle; - int defaultView; - QArray<int> defaultCategories; - QString defaultLocation; - bool bJumpToCurTime; //should jump to current time in dayview? - bool ampm; - bool onMonday; - - bool syncing; - bool inSearch; - - int alarmCounter; + DateBookDBHack *db; + DateBookHoliday*db_holiday; + QWidgetStack *views; + DateBookDay *dayView; + DateBookWeek *weekView; + DateBookMonth *monthView; + DateBookWeekLst *weekLstView; + QAction *dayAction, *weekAction, *weekLstAction, *monthAction; + int weeklistviewconfig; + bool aPreset; // have everything set to alarm? + int presetTime; // the standard time for the alarm + int startTime; + int rowStyle; + int defaultView; + QArray<int> defaultCategories; + QString defaultLocation; + bool bJumpToCurTime; //should jump to current time in dayview? + bool ampm; + bool onMonday; + + bool syncing; + bool inSearch; + + int alarmCounter; QString checkEvent(const Event &); }; #endif |