summaryrefslogtreecommitdiff
path: root/core/pim/datebook/datebook.h
Side-by-side diff
Diffstat (limited to 'core/pim/datebook/datebook.h') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/datebook.h87
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
@@ -24,8 +24,8 @@
#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;
@@ -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<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();
@@ -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<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 &);
};