todo.h
00001 /* 00002 This file is part of libkcal. 00003 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00018 Boston, MA 02111-1307, USA. 00019 */ 00020 #ifndef TODO_H 00021 #define TODO_H 00022 // 00023 // Todo component, representing a VTODO object 00024 // 00025 00026 #include "incidence.h" 00027 00028 namespace KCal { 00029 00033 class Todo : public Incidence 00034 { 00035 public: 00036 Todo(); 00037 Todo(const Todo &); 00038 ~Todo(); 00039 00040 QCString type() const { return "Todo"; } 00041 00043 Incidence *clone(); 00044 00046 void setDtDue(const QDateTime &dtDue); 00048 QDateTime dtDue() const; 00051 QString dtDueTimeStr() const; 00054 QString dtDueDateStr(bool shortfmt=true) const; 00057 QString dtDueStr() const; 00058 00060 bool hasDueDate() const; 00062 void setHasDueDate(bool f); 00063 00065 bool hasStartDate() const; 00067 void setHasStartDate(bool f); 00068 00072 // void setStatus(const QString &statStr); 00075 // void setStatus(int); 00077 // int status() const; 00079 // QString statusStr() const; 00080 00082 bool isCompleted() const; 00084 void setCompleted(bool); 00085 00090 int percentComplete() const; 00095 void setPercentComplete(int); 00096 00098 QDateTime completed() const; 00099 QString completedStr() const; 00101 void setCompleted(const QDateTime &completed); 00102 00104 bool hasCompletedDate() const; 00105 00106 private: 00107 bool accept(Visitor &v) { return v.visit(this); } 00108 00109 QDateTime mDtDue; // due date of todo 00110 00111 bool mHasDueDate; // if todo has associated due date 00112 bool mHasStartDate; // if todo has associated start date 00113 00114 // int mStatus; // confirmed/delegated/tentative/etc 00115 00116 QDateTime mCompleted; 00117 bool mHasCompletedDate; 00118 00119 int mPercentComplete; 00120 }; 00121 00122 } 00123 00124 #endif