kpilot

pilotTodoEntry.h

Go to the documentation of this file.
00001 #ifndef _KPILOT_PILOTTODOENTRY_H
00002 #define _KPILOT_PILOTTODOENTRY_H
00003 /* pilotTodoEntry.h -*- C++ -*-     KPilot
00004 **
00005 ** Copyright (C) 1998-2001 by Dan Pilone
00006 ** Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
00007 **
00008 ** This is a wrapper around the pilot-link Memo structure. It is
00009 ** the interpreted form of a Pilot database record.
00010 */
00011 
00012 /*
00013 ** This program is free software; you can redistribute it and/or modify
00014 ** it under the terms of the GNU Lesser General Public License as published by
00015 ** the Free Software Foundation; either version 2.1 of the License, or
00016 ** (at your option) any later version.
00017 **
00018 ** This program is distributed in the hope that it will be useful,
00019 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00020 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00021 ** GNU Lesser General Public License for more details.
00022 **
00023 ** You should have received a copy of the GNU Lesser General Public License
00024 ** along with this program in a file called COPYING; if not, write to
00025 ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00026 ** MA 02110-1301, USA.
00027 */
00028 
00029 /*
00030 ** Bug reports and questions can be sent to kde-pim@kde.org
00031 */
00032 
00033 #include <time.h>
00034 
00035 #include <pi-macros.h>
00036 #include <pi-todo.h>
00037 
00038 #include <qnamespace.h>
00039 #include <qstring.h>
00040 
00041 #include "pilotRecord.h"
00042 #include "pilotAppInfo.h"
00043 
00049 class KDE_EXPORT PilotTodoEntry : public PilotRecordBase
00050 {
00051 public:
00053     PilotTodoEntry();
00054 
00061     PilotTodoEntry(PilotRecord * rec);
00062 
00064     PilotTodoEntry(const PilotTodoEntry &e);
00065 
00067     ~PilotTodoEntry()
00068     {
00069         free_ToDo(&fTodoInfo);
00070     }
00071 
00075     QString getTextRepresentation(Qt::TextFormat richText);
00076 
00078     PilotTodoEntry& operator=(const PilotTodoEntry &e);
00079 
00081     struct tm getDueDate() const { return fTodoInfo.due; }
00082 
00084     void setDueDate(struct tm& d)
00085     {
00086         fTodoInfo.due = d;
00087     }
00088 
00093     int getIndefinite() const
00094     {
00095         return fTodoInfo.indefinite;
00096     }
00097 
00099     void setIndefinite(int i)
00100     {
00101         fTodoInfo.indefinite = i;
00102     }
00103 
00108     int getPriority() const
00109     {
00110         return fTodoInfo.priority;
00111     }
00112 
00114     void setPriority(int p)
00115     {
00116         fTodoInfo.priority = p;
00117     }
00118 
00120     int getComplete() const
00121     {
00122         return fTodoInfo.complete;
00123     }
00124 
00126     void setComplete(int c)
00127     {
00128         fTodoInfo.complete = c;
00129     }
00130 
00134     QString getDescription() const;
00136     void  setDescription(const QString &);
00137 
00141     QString getNote() const;
00142 
00144     void  setNote(const QString &note);
00145 
00147     QString getCategoryLabel() const;
00148 
00149     PilotRecord *pack() const;
00150 
00151 protected:
00152     const char *getDescriptionP() const { return fTodoInfo.description; } ;
00153     void setDescriptionP(const char *, int len=-1) ;
00154     const char *getNoteP() const { return fTodoInfo.note; } ;
00155     void setNoteP(const char *, int len=-1) ;
00156 
00157 private:
00158     struct ToDo fTodoInfo;
00159     unsigned int fDescriptionSize, fNoteSize;
00160 };
00161 
00162 typedef PilotAppInfo<ToDoAppInfo,unpack_ToDoAppInfo, pack_ToDoAppInfo> PilotToDoInfo;
00163 
00164 
00165 #endif
00166