Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

datebook.h

Go to the documentation of this file.
00001 /*
00002                              This file is part of the Opie Project
00003 
00004                              Copyright (C) Opie Team <opie-devel@handhelds.org>
00005               =.
00006             .=l.
00007            .>+-=
00008  _;:,     .>    :=|.         This program is free software; you can
00009 .> <`_,   >  .   <=          redistribute it and/or  modify it under
00010 :`=1 )Y*s>-.--   :           the terms of the GNU Library General Public
00011 .="- .-=="i,     .._         License as published by the Free Software
00012  - .   .-<_>     .<>         Foundation; either version 2 of the License,
00013      ._= =}       :          or (at your option) any later version.
00014     .%`+i>       _;_.
00015     .i_,=:_.      -<s.       This program is distributed in the hope that
00016      +  .  -:.       =       it will be useful,  but WITHOUT ANY WARRANTY;
00017     : ..    .:,     . . .    without even the implied warranty of
00018     =_        +     =;=|`    MERCHANTABILITY or FITNESS FOR A
00019   _.=:.       :    :=>`:     PARTICULAR PURPOSE. See the GNU
00020 ..}^=.=       =       ;      Library General Public License for more
00021 ++=   -.     .`     .:       details.
00022 :     =  ...= . :.=-
00023  -.   .:....=;==+<;          You should have received a copy of the GNU
00024   -_. . .   )=.  =           Library General Public License along with
00025     --        :-=`           this library; see the file COPYING.LIB.
00026                              If not, write to the Free Software Foundation,
00027                              Inc., 59 Temple Place - Suite 330,
00028                              Boston, MA 02111-1307, USA.
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();   // view today
00080     void changeClock( bool newClock );
00081     void changeWeek( bool newDay );
00082     void appMessage(const QCString& msg, const QByteArray& data);
00083     // handle key events in the day view...
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;    // have everything set to alarm?
00127     int presetTime;  // the standard time for the alarm
00128     int startTime;
00129     int rowStyle;
00130     int defaultView;
00131     QArray<int> defaultCategories;
00132     QString defaultLocation;
00133     bool bJumpToCurTime; //should jump to current time in dayview?
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

Generated on Sat Nov 5 16:15:47 2005 for OPIE by  doxygen 1.4.2