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

opimnotify.h

Go to the documentation of this file.
00001 /*
00002                              This file is part of the Opie Project
00003                              Copyright (C) The Main Author <main-author@whereever.org>
00004               =.             Copyright (C) The Opie Team <opie-devel@handhelds.org>
00005             .=l.
00006            .>+-=
00007  _;:,     .>    :=|.         This program is free software; you can
00008 .> <`_,   >  .   <=          redistribute it and/or  modify it under
00009 :`=1 )Y*s>-.--   :           the terms of the GNU Library General Public
00010 .="- .-=="i,     .._         License as published by the Free Software
00011  - .   .-<_>     .<>         Foundation; either version 2 of the License,
00012      ._= =}       :          or (at your option) any later version.
00013     .%`+i>       _;_.
00014     .i_,=:_.      -<s.       This program is distributed in the hope that
00015      +  .  -:.       =       it will be useful,  but WITHOUT ANY WARRANTY;
00016     : ..    .:,     . . .    without even the implied warranty of
00017     =_        +     =;=|`    MERCHANTABILITY or FITNESS FOR A
00018   _.=:.       :    :=>`:     PARTICULAR PURPOSE. See the GNU
00019 ..}^=.=       =       ;      Library General Public License for more
00020 ++=   -.     .`     .:       details.
00021  :     =  ...= . :.=-
00022  -.   .:....=;==+<;          You should have received a copy of the GNU
00023   -_. . .   )=.  =           Library General Public License along with
00024     --        :-=`           this library; see the file COPYING.LIB.
00025                              If not, write to the Free Software Foundation,
00026                              Inc., 59 Temple Place - Suite 330,
00027                              Boston, MA 02111-1307, USA.
00028 */
00029 
00030 #ifndef OPIMNOTIFY_H
00031 #define OPIMNOTIFY_H
00032 
00033 /* QT */
00034 #include <qdatetime.h>
00035 #include <qvaluelist.h>
00036 
00037 namespace Opie
00038 {
00047 /*
00048  * TALK to eilers: have a class OPimDuration which sets the Duration
00049  *                 given on the Due/Start Date? -zecke
00050  * discuss: do we need a uid for the notify? -zecke
00051  */
00052 class OPimNotify
00053 {
00054 
00055   public:
00056     typedef QValueList<OPimNotify> ValueList;
00057     OPimNotify( const QDateTime& start = QDateTime(), int duration = 0, int parent = 0 );
00058     OPimNotify( const OPimNotify& );
00059     virtual ~OPimNotify();
00060 
00061     OPimNotify &operator=( const OPimNotify& );
00062     bool operator==( const OPimNotify& );
00063 
00064     virtual QString type() const = 0;
00065 
00067     QDateTime dateTime() const;
00068     QString service() const;
00069 
00073     int parent() const;
00074 
00078     int duration() const;
00079 
00083     QDateTime endTime() const;
00084 
00085     void setDateTime( const QDateTime& );
00086     void setDuration( int dur );
00087     void setParent( int uid );
00088     void setService( const QString& );
00089 
00090 
00091   private:
00092     inline void copyIntern();
00093     void deref();
00094     struct Data;
00095     Data* data;
00096 
00097     /* d-pointer */
00098     class NotifyPrivate;
00099     NotifyPrivate* d;
00100 
00101 };
00107 class OPimAlarm : public OPimNotify
00108 {
00109   public:
00110     enum Sound{Loud = 1, Silent = 0, Custom = 2 };
00111     OPimAlarm( int sound = Silent, const QDateTime& start = QDateTime(), int duration = 0, int parent = 0 );
00112     OPimAlarm( const OPimAlarm& );
00113     ~OPimAlarm();
00114 
00115     OPimAlarm &operator=( const OPimAlarm& );
00116     bool operator==( const OPimAlarm& );
00117     QString type() const;
00118 
00119     int sound() const;
00120     QString file() const;
00121 
00122     void setSound( int );
00123     /* only when sound is custom... */
00124     void setFile( const QString& sound );
00125 
00126   private:
00127     void deref();
00128     void copyIntern();
00129     struct Data;
00130     Data * data;
00131 
00132     class Private;
00133     Private* d;
00134 
00135 };
00136 
00143 class OPimReminder : public OPimNotify
00144 {
00145   public:
00153     OPimReminder( int uid = 0, const QDateTime& start = QDateTime(),
00154                   int duration = 0, int parent = 0 );
00155     OPimReminder( const OPimReminder& );
00156     OPimReminder &operator=( const OPimReminder& );
00157 
00158     QString type() const;
00159 
00160     bool operator==( const OPimReminder& );
00161 
00166     int recordUid() const;
00167     void setRecordUid( int uid );
00168 
00169   private:
00170     void deref();
00171     void copyIntern();
00172 
00173     struct Data;
00174     Data* data;
00175     class Private;
00176     Private *d;
00177 };
00178 
00179 }
00180 
00181 #endif

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