libopie PIM API Documentation

otodo.h

Go to the documentation of this file.
00001 
00002 #ifndef OPIE_TODO_EVENT_H
00003 #define OPIE_TODO_EVENT_H
00004 
00005 
00006 #include <qarray.h>
00007 #include <qmap.h>
00008 #include <qregexp.h>
00009 #include <qstringlist.h>
00010 #include <qdatetime.h>
00011 #include <qvaluelist.h>
00012 
00013 #include <qpe/recordfields.h>
00014 #include <qpe/palmtopuidgen.h>
00015 
00016 #include <opie/opimrecord.h>
00017 
00018 
00019 class OPimState;
00020 class ORecur;
00021 class OPimMaintainer;
00022 class OPimNotifyManager;
00023 class OTodo : public  OPimRecord  {
00024 public:
00025     typedef QValueList<OTodo> ValueList;
00026     enum RecordFields {
00027         Uid = Qtopia::UID_ID,
00028         Category = Qtopia::CATEGORY_ID,
00029         HasDate,
00030         Completed,
00031         Description,
00032         Summary,
00033         Priority,
00034         DateDay,
00035         DateMonth,
00036         DateYear,
00037         Progress,
00038         CrossReference,
00039         State,
00040         Recurrence,
00041         Alarms,
00042         Reminders,
00043         Notifiers,
00044         Maintainer,
00045         StartDate,
00046         CompletedDate
00047     };
00048  public:
00049     // priorities from Very low to very high
00050     enum TaskPriority { VeryHigh=1,  High,  Normal,  Low, VeryLow };
00051 
00052     /* Constructs a new ToDoEvent
00053        @param completed Is the TodoEvent completed
00054        @param priority What is the priority of this ToDoEvent
00055        @param category Which category does it belong( uid )
00056        @param summary A small summary of the todo
00057        @param description What is this ToDoEvent about
00058        @param hasDate Does this Event got a deadline
00059        @param date what is the deadline?
00060        @param uid what is the UUID of this Event
00061     **/
00062     OTodo( bool completed = false, int priority = Normal,
00063            const QStringList &category = QStringList(),
00064            const QString &summary = QString::null ,
00065            const QString &description = QString::null,
00066            ushort progress = 0,
00067            bool hasDate = false, QDate date = QDate::currentDate(),
00068            int uid = 0 /*empty*/ );
00069 
00070     OTodo( bool completed, int priority,
00071            const QArray<int>& category,
00072            const QString& summary = QString::null,
00073            const QString& description = QString::null,
00074            ushort progress = 0,
00075            bool hasDate = false,  QDate date = QDate::currentDate(),
00076            int uid = 0 /* empty */ );
00077 
00081     OTodo(const OTodo & );
00082 
00086     ~OTodo();
00087 
00091     bool isCompleted() const;
00092 
00096     bool hasDueDate() const;
00097     bool hasStartDate()const;
00098     bool hasCompletedDate()const;
00099 
00103     int priority()const ;
00104 
00108     ushort progress() const;
00109 
00113     QDate dueDate()const;
00114 
00118     QDate startDate()const;
00119 
00123     QDate completedDate()const;
00124 
00128     bool hasState()const;
00129 
00133     OPimState state()const;
00134 
00138     bool hasRecurrence()const;
00139 
00143     ORecur recurrence()const;
00144 
00148     bool hasMaintainer()const;
00149 
00153     OPimMaintainer maintainer()const;
00154 
00158     QString description()const;
00159 
00163     QString summary() const;
00164 
00169     QString toRichText() const;
00170 
00171     bool hasNotifiers()const;
00172     /*
00173      * FIXME check if the sharing is still fine!! -zecke
00174      * ### CHECK If API is fine
00175      */
00179     OPimNotifyManager &notifiers();
00180 
00184     const OPimNotifyManager &notifiers()const;
00185 
00189     QString type()const;
00190     QString toShortText()const;
00191     QString recordField(int id )const;
00192 
00197     QMap<int, QString> toMap()const;
00198 
00202     void setCompleted(bool completed );
00203 
00207     void setHasDueDate( bool hasDate );
00208     // FIXME we do not have these for start, completed
00209     // cause we'll use the isNull() of QDate for figuring
00210     // out if it's has a date...
00211     // decide what to do here? -zecke
00212 
00216     void setPriority(int priority );
00217 
00221     void setProgress( ushort progress );
00222 
00226     void setDueDate( const QDate& date );
00227 
00231     void setStartDate( const QDate& date );
00232 
00236     void setCompletedDate( const QDate& date );
00237 
00238     void setRecurrence( const ORecur& );
00239 
00240     void setDescription(const QString& );
00241     void setSummary(const QString& );
00242 
00247     void setState( const OPimState& state);
00248 
00252     void setMaintainer( const OPimMaintainer& );
00253 
00254     bool isOverdue();
00255 
00256 
00257     virtual bool match( const QRegExp &r )const;
00258 
00259     bool operator<(const OTodo &toDoEvent )const;
00260     bool operator<=(const OTodo &toDoEvent )const;
00261     bool operator!=(const OTodo &toDoEvent )const;
00262     bool operator>(const OTodo &toDoEvent )const;
00263     bool operator>=(const OTodo &toDoEvent)const;
00264     bool operator==(const OTodo &toDoEvent )const;
00265     OTodo &operator=(const OTodo &toDoEvent );
00266 
00267     static int rtti();
00268 
00269  private:
00270     class OTodoPrivate;
00271     struct OTodoData;
00272 
00273     void deref();
00274     inline void changeOrModify();
00275     void copy( OTodoData* src, OTodoData* dest );
00276     OTodoPrivate *d;
00277     OTodoData *data;
00278 
00279 };
00280 inline bool OTodo::operator!=(const OTodo &toDoEvent )const {
00281     return !(*this == toDoEvent);
00282 }
00283 
00284 
00285 #endif
KDE Logo
This file is part of the documentation for OPIE Version 1.1.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:25:21 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001