kpilot/lib
pilotTodoEntry.h00001 #ifndef _KPILOT_PILOTTODOENTRY_H
00002 #define _KPILOT_PILOTTODOENTRY_H
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
00032
00033 #include <time.h>
00034
00035 #include <pi-macros.h>
00036 #include <pi-todo.h>
00037
00038 #include <qstring.h>
00039
00040 #include "pilotRecord.h"
00041 #include "pilotAppInfo.h"
00042
00048 class KDE_EXPORT PilotTodoEntry : public PilotRecordBase
00049 {
00050 public:
00052 PilotTodoEntry(struct ToDoAppInfo &appInfo);
00053
00055 PilotTodoEntry(struct ToDoAppInfo &appInfo, PilotRecord * rec);
00056
00058 PilotTodoEntry(const PilotTodoEntry &e);
00059
00061 ~PilotTodoEntry()
00062 {
00063 free_ToDo(&fTodoInfo);
00064 }
00065
00069 QString getTextRepresentation(bool richText=false);
00070
00072 PilotTodoEntry& operator=(const PilotTodoEntry &e);
00073
00075 struct tm getDueDate() const { return fTodoInfo.due; }
00076
00078 void setDueDate(struct tm& d)
00079 {
00080 fTodoInfo.due = d;
00081 }
00082
00087 int getIndefinite() const
00088 {
00089 return fTodoInfo.indefinite;
00090 }
00091
00093 void setIndefinite(int i)
00094 {
00095 fTodoInfo.indefinite = i;
00096 }
00097
00102 int getPriority() const
00103 {
00104 return fTodoInfo.priority;
00105 }
00106
00108 void setPriority(int p)
00109 {
00110 fTodoInfo.priority = p;
00111 }
00112
00114 int getComplete() const
00115 {
00116 return fTodoInfo.complete;
00117 }
00118
00120 void setComplete(int c)
00121 {
00122 fTodoInfo.complete = c;
00123 }
00124
00128 QString getDescription() const;
00130 void setDescription(const QString &);
00131
00135 QString getNote() const;
00136
00138 void setNote(const QString ¬e);
00139
00141 QString getCategoryLabel() const;
00142
00143
00147 inline bool setCategory(const QString &label)
00148 {
00149 int c = Pilot::insertCategory(&fAppInfo.category,label,false);
00150 PilotRecordBase::setCategory(c);
00151 return c>=0;
00152 }
00153
00154 PilotRecord *pack() const;
00155
00156 protected:
00157 const char *getDescriptionP() const { return fTodoInfo.description; } ;
00158 void setDescriptionP(const char *, int len=-1) ;
00159 const char *getNoteP() const { return fTodoInfo.note; } ;
00160 void setNoteP(const char *, int len=-1) ;
00161
00162 private:
00163 struct ToDo fTodoInfo;
00164 struct ToDoAppInfo &fAppInfo;
00165 unsigned int fDescriptionSize, fNoteSize;
00166 };
00167
00168 typedef PilotAppInfo<ToDoAppInfo,unpack_ToDoAppInfo, pack_ToDoAppInfo> PilotToDoInfo;
00169
00170
00171 #endif
00172
|