-rw-r--r-- | core/pim/todo/mainwindow.h | 175 |
1 files changed, 175 insertions, 0 deletions
diff --git a/core/pim/todo/mainwindow.h b/core/pim/todo/mainwindow.h new file mode 100644 index 0000000..43666f0 --- a/dev/null +++ b/core/pim/todo/mainwindow.h | |||
@@ -0,0 +1,175 @@ | |||
1 | /* | ||
2 | =. This file is part of the OPIE Project | ||
3 | .=l. Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> | ||
4 | .>+-= | ||
5 | _;:, .> :=|. This program is free software; you can | ||
6 | .> <`_, > . <= redistribute it and/or modify it under | ||
7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | ||
8 | .="- .-=="i, .._ License as published by the Free Software | ||
9 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
10 | ._= =} : or (at your option) any later version. | ||
11 | .%`+i> _;_. | ||
12 | .i_,=:_. -<s. This program is distributed in the hope that | ||
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
14 | : .. .:, . . . without even the implied warranty of | ||
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
17 | ..}^=.= = ; Library General Public License for more | ||
18 | ++= -. .` .: details. | ||
19 | : = ...= . :.=- | ||
20 | -. .:....=;==+<; You should have received a copy of the GNU | ||
21 | -_. . . )=. = Library General Public License along with | ||
22 | -- :-=` this library; see the file COPYING.LIB. | ||
23 | If not, write to the Free Software Foundation, | ||
24 | Inc., 59 Temple Place - Suite 330, | ||
25 | Boston, MA 02111-1307, USA. | ||
26 | |||
27 | */ | ||
28 | |||
29 | #ifndef TODO_MAIN_WINDOW_H | ||
30 | #define TODO_MAIN_WINDOW_H | ||
31 | |||
32 | #include <qlist.h> | ||
33 | #include <qmainwindow.h> | ||
34 | |||
35 | #include <opie/otodoaccess.h> | ||
36 | #include <opie/otodo.h> | ||
37 | |||
38 | #include "smalltodo.h" | ||
39 | #include "todoview.h" | ||
40 | #include "todomanager.h" | ||
41 | |||
42 | class QPopupMenu; | ||
43 | class QMenuBar; | ||
44 | class QToolBar; | ||
45 | class QAction; | ||
46 | class QWidgetStack; | ||
47 | class Ir; | ||
48 | |||
49 | |||
50 | namespace Todo { | ||
51 | typedef TodoView View; | ||
52 | class TemplateManager; | ||
53 | class Editor; | ||
54 | class TodoShow; | ||
55 | class TemplateEditor; | ||
56 | |||
57 | class MainWindow : public QMainWindow { | ||
58 | Q_OBJECT | ||
59 | public: | ||
60 | MainWindow( QWidget *parent = 0, | ||
61 | const char* name = 0 ); | ||
62 | ~MainWindow(); | ||
63 | |||
64 | /** return a context menu for an OTodo */ | ||
65 | QPopupMenu* contextMenu(int uid ); | ||
66 | QPopupMenu* options(); | ||
67 | QPopupMenu* edit(); | ||
68 | QPopupMenu* view(); | ||
69 | QToolBar* toolbar(); | ||
70 | |||
71 | |||
72 | void updateList(); | ||
73 | OTodoAccess::List::Iterator begin(); | ||
74 | OTodoAccess::List::Iterator end(); | ||
75 | // OTodoAccess::List::Iterator &iterator(); | ||
76 | |||
77 | OTodo event(int uid ); | ||
78 | |||
79 | bool isSyncing()const; | ||
80 | bool showCompleted()const; | ||
81 | bool showDeadline()const; | ||
82 | bool showOverDue()const; | ||
83 | QString currentCategory()const; | ||
84 | int currentCatId(); | ||
85 | TemplateManager* templateManager(); | ||
86 | |||
87 | void updateTodo( const OTodo& ); | ||
88 | void populateTemplates(); | ||
89 | Editor* currentEditor(); | ||
90 | private slots: | ||
91 | void populateCategories(); | ||
92 | void slotReload(); | ||
93 | void slotFlush(); | ||
94 | |||
95 | protected: | ||
96 | void closeEvent( QCloseEvent* e ); | ||
97 | |||
98 | private: | ||
99 | void connectBase( ViewBase* ); | ||
100 | void initUI(); | ||
101 | void initActions(); | ||
102 | void initConfig(); | ||
103 | void initViews(); | ||
104 | void initEditor(); | ||
105 | void initShow(); | ||
106 | void initTemplate(); | ||
107 | void raiseCurrentView(); | ||
108 | ViewBase* currentView(); | ||
109 | ViewBase* m_curView; | ||
110 | Editor* m_curEdit; | ||
111 | TodoShow* currentShow(); | ||
112 | TodoShow* m_curShow; | ||
113 | TemplateEditor* currentTemplateEditor(); | ||
114 | TemplateEditor* m_curTempEd; | ||
115 | |||
116 | QMenuBar* m_bar; | ||
117 | QToolBar* m_tool; | ||
118 | QAction* m_editAction, | ||
119 | *m_deleteAction, | ||
120 | *m_findAction, | ||
121 | *m_completedAction, | ||
122 | *m_showDeadLineAction, | ||
123 | *m_deleteAllAction, | ||
124 | *m_deleteCompleteAction, | ||
125 | *m_duplicateAction, | ||
126 | *m_showOverDueAction, | ||
127 | *m_effectiveAction; | ||
128 | QWidgetStack *m_stack; | ||
129 | QPopupMenu* m_catMenu, | ||
130 | *m_edit, | ||
131 | *m_options, | ||
132 | *m_view, | ||
133 | *m_template; | ||
134 | |||
135 | bool m_syncing:1; | ||
136 | bool m_deadline:1; | ||
137 | bool m_completed:1; | ||
138 | bool m_overdue:1; | ||
139 | TodoManager m_todoMgr; | ||
140 | QString m_curCat; | ||
141 | QList<ViewBase> m_views; | ||
142 | uint m_counter; | ||
143 | TemplateManager* m_tempManager; | ||
144 | |||
145 | private slots: | ||
146 | void slotShow(int); | ||
147 | void slotEdit(int); | ||
148 | private slots: | ||
149 | void slotUpdate3( QWidget* ); | ||
150 | void slotNewFromTemplate(int id ); | ||
151 | void slotNew(); | ||
152 | void slotDuplicate(); | ||
153 | void slotDelete(); | ||
154 | void slotDeleteAll(); | ||
155 | void slotDeleteCompleted(); | ||
156 | |||
157 | void slotEdit(); | ||
158 | void slotFind(); | ||
159 | |||
160 | void setCategory( int ); | ||
161 | |||
162 | void slotShowDeadLine( bool ); | ||
163 | void slotShowCompleted( bool ); | ||
164 | |||
165 | void setDocument( const QString& ); | ||
166 | |||
167 | |||
168 | void slotBeam(); | ||
169 | void beamDone( Ir* ); | ||
170 | void slotShowDetails(); | ||
171 | void slotShowDue( bool ); | ||
172 | }; | ||
173 | }; | ||
174 | |||
175 | #endif | ||