summaryrefslogtreecommitdiff
path: root/core/pim/datebook/datebook.h
Unidiff
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
@@ -21,36 +21,64 @@
21#define DATEBOOK_H 21#define DATEBOOK_H
22 22
23#include <qpe/datebookdb.h> 23#include <qpe/datebookdb.h>
24 24
25#include <qmainwindow.h> 25#include <qmainwindow.h>
26 26
27 enum { DAY=1,WEEK,WEEKLST,MONTH };// defaultView values 27enum { DAY=1,WEEK,WEEKLST,MONTH }; // defaultView values
28 enum { NONE=0,NORMAL,EXTENDED };// WeekLstView's modes. 28enum { NONE=0,NORMAL,EXTENDED }; // WeekLstView's modes.
29 29
30class QAction; 30class QAction;
31class QWidgetStack; 31class QWidgetStack;
32class DateBookDay; 32class DateBookDay;
33class DateBookWeek; 33class DateBookWeek;
34class DateBookWeekLst; 34class DateBookWeekLst;
35class DateBookMonth; 35class DateBookMonth;
36class Event; 36class Event;
37class QDate; 37class QDate;
38class Ir; 38class Ir;
39class QLibrary;
40
41namespace Opie {
42namespace Datebook {
43 class HolidayPlugin;
44 class HolidayPluginIf;
45}
46}
39 47
40class DateBookDBHack : public DateBookDB { 48class DateBookDBHack : public DateBookDB {
41 public: 49 public:
42 Event eventByUID(int id); 50 Event eventByUID(int id);
43}; 51};
44 52
53class DateBookHoliday
54{
55public:
56 DateBookHoliday();
57 virtual ~DateBookHoliday();
58
59 QStringList holidaylist(const QDate&);
60 QStringList holidaylist(unsigned year, unsigned month, unsigned day);
61protected:
62 void init();
63 void deinit();
64
65 struct HPlugin {
66 Opie::Datebook::HolidayPlugin*_plugin;
67 QLibrary*_lib;
68 Opie::Datebook::HolidayPluginIf*_if;
69 };
70 QValueList<HPlugin*>_pluginlist;
71};
72
45class DateBook : public QMainWindow 73class DateBook : public QMainWindow
46{ 74{
47 Q_OBJECT 75 Q_OBJECT
48 76
49public: 77public:
50 static QString appName() { return QString::fromLatin1("datebook"); } 78 static QString appName() { return QString::fromLatin1("datebook"); }
51 DateBook( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); 79 DateBook( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
52 ~DateBook(); 80 ~DateBook();
53 81
54signals: 82signals:
55 void newEvent(); 83 void newEvent();
56 void signalNotFound(); 84 void signalNotFound();
@@ -68,13 +96,13 @@ public slots:
68 void reload(); 96 void reload();
69 97
70private slots: 98private slots:
71 void fileNew(); 99 void fileNew();
72 void slotNewEntry(const QDateTime &start, const QDateTime &end, const QString &str, const QString &location=0); 100 void slotNewEntry(const QDateTime &start, const QDateTime &end, const QString &str, const QString &location=0);
73 void slotSettings(); 101 void slotSettings();
74 void slotToday();// view today 102 void slotToday(); // view today
75 void changeClock( bool newClock ); 103 void changeClock( bool newClock );
76 void changeWeek( bool newDay ); 104 void changeWeek( bool newDay );
77 void appMessage(const QCString& msg, const QByteArray& data); 105 void appMessage(const QCString& msg, const QByteArray& data);
78 // handle key events in the day view... 106 // handle key events in the day view...
79 void slotNewEventFromKey( const QString &str ); 107 void slotNewEventFromKey( const QString &str );
80 void slotFind(); 108 void slotFind();
@@ -86,14 +114,14 @@ private slots:
86 void viewWeek(); 114 void viewWeek();
87 void viewWeekLst(); 115 void viewWeekLst();
88 void viewMonth(); 116 void viewMonth();
89 117
90 void showDay( int y, int m, int d ); 118 void showDay( int y, int m, int d );
91 119
92 void insertEvent( const Event &e ); 120 void insertEvent( const Event &e );
93 void editEvent( const Event &e ); 121 void editEvent( const Event &e );
94 void duplicateEvent( const Event &e ); 122 void duplicateEvent( const Event &e );
95 void removeEvent( const Event &e ); 123 void removeEvent( const Event &e );
96 124
97 void receive( const QCString &msg, const QByteArray &data ); 125 void receive( const QCString &msg, const QByteArray &data );
98 void setDocument( const QString & ); 126 void setDocument( const QString & );
99 void beamEvent( const Event &e ); 127 void beamEvent( const Event &e );
@@ -106,34 +134,35 @@ private:
106 void initWeekLst(); 134 void initWeekLst();
107 void initMonth(); 135 void initMonth();
108 void loadSettings(); 136 void loadSettings();
109 void saveSettings(); 137 void saveSettings();
110 138
111private: 139private:
112 DateBookDBHack *db; 140 DateBookDBHack *db;
113 QWidgetStack *views; 141 DateBookHoliday*db_holiday;
114 DateBookDay *dayView; 142 QWidgetStack *views;
115 DateBookWeek *weekView; 143 DateBookDay *dayView;
116 DateBookMonth *monthView; 144 DateBookWeek *weekView;
117 DateBookWeekLst *weekLstView; 145 DateBookMonth *monthView;
118 QAction *dayAction, *weekAction, *weekLstAction, *monthAction; 146 DateBookWeekLst *weekLstView;
119 int weeklistviewconfig; 147 QAction *dayAction, *weekAction, *weekLstAction, *monthAction;
120 bool aPreset; // have everything set to alarm? 148 int weeklistviewconfig;
121 int presetTime; // the standard time for the alarm 149 bool aPreset; // have everything set to alarm?
122 int startTime; 150 int presetTime; // the standard time for the alarm
123 int rowStyle; 151 int startTime;
124 int defaultView; 152 int rowStyle;
125 QArray<int> defaultCategories; 153 int defaultView;
126 QString defaultLocation; 154 QArray<int> defaultCategories;
127 bool bJumpToCurTime; //should jump to current time in dayview? 155 QString defaultLocation;
128 bool ampm; 156 bool bJumpToCurTime; //should jump to current time in dayview?
129 bool onMonday; 157 bool ampm;
130 158 bool onMonday;
131 bool syncing; 159
132 bool inSearch; 160 bool syncing;
133 161 bool inSearch;
134 int alarmCounter; 162
163 int alarmCounter;
135 164
136 QString checkEvent(const Event &); 165 QString checkEvent(const Event &);
137}; 166};
138 167
139#endif 168#endif