From 3d43b9e40e562957e1a3fcbe9268634db45951ce Mon Sep 17 00:00:00 2001 From: alwin Date: Wed, 16 Mar 2005 13:14:26 +0000 Subject: ho. in dayview a holiday will displayed (if plugin found) generated a straight forward dummy-holiday-plugin for testing the stuff. --- (limited to 'core/pim/datebook/datebook.h') 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 @@ -24,8 +24,8 @@ #include -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; @@ -36,18 +36,46 @@ 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_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(); @@ -71,7 +99,7 @@ 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); @@ -89,8 +117,8 @@ private slots: 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 ); @@ -109,29 +137,30 @@ private: 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 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 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 &); }; -- cgit v0.9.0.2