kpilot/lib

pilotTodoEntry.h

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 <qstring.h>
00039 
00040 #include "pilotAppCategory.h"
00041 #include "pilotDatabase.h"
00042 
00048 class KDE_EXPORT PilotTodoEntry : public PilotAppCategory
00049 {
00050 public:
00052     PilotTodoEntry(struct ToDoAppInfo &appInfo);
00054     PilotTodoEntry(struct ToDoAppInfo &appInfo, PilotRecord * rec);
00056     PilotTodoEntry(const PilotTodoEntry &e);
00058     ~PilotTodoEntry() { free_ToDo(&fTodoInfo); }
00059 
00063     virtual QString getTextRepresentation(bool richText=false);
00064 
00066     PilotTodoEntry& operator=(const PilotTodoEntry &e);
00067 
00069     struct tm getDueDate() const { return fTodoInfo.due; }
00071     void setDueDate(struct tm& d) { fTodoInfo.due = d; }
00072 
00077     int getIndefinite() const { return fTodoInfo.indefinite; }
00079     void setIndefinite(int i) { fTodoInfo.indefinite = i; }
00080 
00085     int getPriority() const { return fTodoInfo.priority; }
00087     void setPriority(int p) { fTodoInfo.priority = p; }
00088 
00090     int getComplete() const { return fTodoInfo.complete; }
00092     void setComplete(int c) { fTodoInfo.complete = c; }
00093 
00097     QString getDescription() const;
00099     void  setDescription(const QString &);
00100 
00104     QString getNote() const;
00106     void  setNote(const QString &note);
00107 
00109     QString getCategoryLabel() const;
00110 
00111 
00115     inline bool setCategory(const QString &label) { return PilotAppCategory::setCategory(fAppInfo.category,label);  };
00116 
00117     // static const int APP_BUFFER_SIZE;
00118 
00119 protected:
00120     void *pack_(void *buf, int *size);
00121     void unpack(const void *buf, int size = 0) { } ;
00122 
00123     const char *getDescriptionP() const { return fTodoInfo.description; } ;
00124     void setDescriptionP(const char *, int len=-1) ;
00125     const char *getNoteP() const { return fTodoInfo.note; } ;
00126     void setNoteP(const char *, int len=-1) ;
00127 
00128 private:
00129     struct ToDo fTodoInfo;
00130     struct ToDoAppInfo &fAppInfo;
00131 };
00132 
00133 typedef PilotAppInfo<ToDoAppInfo,unpack_ToDoAppInfo, pack_ToDoAppInfo> PilotToDoInfo;
00134 
00135 
00136 #endif
00137 
KDE Home | KDE Accessibility Home | Description of Access Keys