00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef DATEBOOK_H
00032 #define DATEBOOK_H
00033
00034 #include "datebooktypes.h"
00035
00036 #include <qpe/datebookdb.h>
00037
00038 #include <qmainwindow.h>
00039
00040 class QAction;
00041 class QWidgetStack;
00042 class DateBookDay;
00043 class DateBookWeek;
00044 class DateBookWeekLst;
00045 class ODateBookMonth;
00046 class Event;
00047 class QDate;
00048 class Ir;
00049
00050 class DateBook : public QMainWindow
00051 {
00052 Q_OBJECT
00053
00054 public:
00055 static QString appName() { return QString::fromLatin1("datebook"); }
00056 DateBook( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
00057 ~DateBook();
00058
00059 signals:
00060 void newEvent();
00061 void signalNotFound();
00062 void signalWrapAround();
00063
00064 protected:
00065 QDate currentDate();
00066 void timerEvent( QTimerEvent *e );
00067 void closeEvent( QCloseEvent *e );
00068
00069 void view(int v, const QDate &d);
00070
00071 public slots:
00072 void flush();
00073 void reload();
00074
00075 private slots:
00076 void fileNew();
00077 void slotNewEntry(const QDateTime &start, const QDateTime &end, const QString &str, const QString &location=0);
00078 void slotSettings();
00079 void slotToday();
00080 void changeClock( bool newClock );
00081 void changeWeek( bool newDay );
00082 void appMessage(const QCString& msg, const QByteArray& data);
00083
00084 void slotNewEventFromKey( const QString &str );
00085 void slotFind();
00086 void slotDoFind( const QString &, const QDate &, bool, bool, int );
00087
00088 void viewDefault(const QDate &d);
00089
00090 void viewDay();
00091 void viewWeek();
00092 void viewWeekLst();
00093 void viewMonth();
00094
00095 void showDay( int y, int m, int d );
00096
00097 void insertEvent( const Event &e );
00098 void editEvent( const Event &e );
00099 void duplicateEvent( const Event &e );
00100 void removeEvent( const Event &e );
00101
00102 void receive( const QCString &msg, const QByteArray &data );
00103 void setDocument( const QString & );
00104 void beamEvent( const Event &e );
00105 void beamDone( Ir *ir );
00106
00107 private:
00108 void addEvent( const Event &e );
00109 void initDay();
00110 void initWeek();
00111 void initWeekLst();
00112 void initMonth();
00113 void loadSettings();
00114 void saveSettings();
00115
00116 private:
00117 DateBookDBHoliday *db;
00118 DateBookHoliday*db_holiday;
00119 QWidgetStack *views;
00120 DateBookDay *dayView;
00121 DateBookWeek *weekView;
00122 ODateBookMonth *monthView;
00123 DateBookWeekLst *weekLstView;
00124 QAction *dayAction, *weekAction, *weekLstAction, *monthAction;
00125 int weeklistviewconfig;
00126 bool aPreset;
00127 int presetTime;
00128 int startTime;
00129 int rowStyle;
00130 int defaultView;
00131 QArray<int> defaultCategories;
00132 QString defaultLocation;
00133 bool bJumpToCurTime;
00134 bool ampm;
00135 bool onMonday;
00136
00137 bool syncing;
00138 bool inSearch;
00139
00140 int alarmCounter;
00141
00142 QString checkEvent(const Event &);
00143 };
00144
00145 #endif