00001 /* 00002 This file is part of the Opie Project 00003 00004 Copyright (C) Opie Team <opie-devel@handhelds.org> 00005 =. 00006 .=l. 00007 .>+-= 00008 _;:, .> :=|. This program is free software; you can 00009 .> <`_, > . <= redistribute it and/or modify it under 00010 :`=1 )Y*s>-.-- : the terms of the GNU Library General Public 00011 .="- .-=="i, .._ License as published by the Free Software 00012 - . .-<_> .<> Foundation; either version 2 of the License, 00013 ._= =} : or (at your option) any later version. 00014 .%`+i> _;_. 00015 .i_,=:_. -<s. This program is distributed in the hope that 00016 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 00017 : .. .:, . . . without even the implied warranty of 00018 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 00019 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU 00020 ..}^=.= = ; Library General Public License for more 00021 ++= -. .` .: details. 00022 : = ...= . :.=- 00023 -. .:....=;==+<; You should have received a copy of the GNU 00024 -_. . . )=. = Library General Public License along with 00025 -- :-=` this library; see the file COPYING.LIB. 00026 If not, write to the Free Software Foundation, 00027 Inc., 59 Temple Place - Suite 330, 00028 Boston, MA 02111-1307, USA. 00029 */ 00030 00031 #ifndef TODO_VIEW_H 00032 #define TODO_VIEW_H 00033 00034 #include <qarray.h> 00035 #include <qstring.h> 00036 #include <qvaluelist.h> 00037 #include <qwidget.h> 00038 00039 #include <opie2/otodoaccess.h> 00040 00041 #include "smalltodo.h" 00042 00043 using Opie::OPimTodo; 00044 using Opie::OPimTodoAccess; 00045 00046 namespace Todo { 00047 class MainWindow; 00048 00052 struct ViewBase { 00053 public: 00054 virtual QWidget* widget() = 0; 00055 virtual QString type()const = 0; 00056 virtual int current() = 0; 00057 virtual QString currentRepresentation() = 0; 00058 virtual void showOverDue( bool ) = 0; 00059 00063 virtual int next() = 0; 00064 00068 virtual int prev() = 0; 00069 00070 /* 00071 * update the view 00072 */ 00073 virtual void updateView() = 0; 00074 00075 virtual void addEvent( const OPimTodo& ) = 0; 00076 virtual void replaceEvent( const OPimTodo& ) = 0; 00077 virtual void removeEvent( int uid ) = 0; 00078 virtual void setShowCompleted( bool ) = 0; 00079 virtual void setShowDeadline( bool ) = 0; 00080 virtual void setShowCategory( const QString& = QString::null ) = 0; 00081 virtual void clear() = 0; 00082 virtual void newDay() = 0; 00083 }; 00084 00096 class TodoView : public ViewBase{ 00097 00098 public: 00102 TodoView( MainWindow* win ); 00103 00107 virtual ~TodoView(); 00108 00109 protected: 00110 MainWindow* todoWindow(); 00111 OPimTodo event(int uid ); 00112 OPimTodoAccess::List list(); 00113 OPimTodoAccess::List sorted()const; 00114 void sort(); 00115 void sort(int sort ); 00116 void setSortOrder( int order ); 00117 void setAscending( bool ); 00118 00119 /* 00120 * These things needs to be implemented 00121 * in a implementation 00122 */ 00123 void showTodo( int uid ); 00124 void edit( int uid ); 00125 void update(int uid, const SmallTodo& to ); 00126 void update(int uid, const OPimTodo& ev); 00127 void remove( int uid ); 00128 /* will ask the user if the item should be deleted */ 00129 void removeQuery(int uid ); 00130 void complete( int uid ); 00131 void complete( const OPimTodo& ev ); 00132 private: 00133 MainWindow *m_main; 00134 OPimTodoAccess::List m_sort; 00135 bool m_asc : 1; 00136 int m_sortOrder; 00137 }; 00138 }; 00139 00140 #endif
1.4.2