1 // |
1 // |
2 // OSSP asgui - Accounting system graphical user interface |
2 // OSSP asgui - Accounting system graphical user interface |
3 // Copyright (c) 2002-2004 The OSSP Project (http://www.ossp.org/) |
3 // Copyright (c) 2002-2008 The OSSP Project (http://www.ossp.org/) |
4 // Copyright (c) 2002-2004 Ralf S. Engelschall <rse@engelschall.com> |
4 // Copyright (c) 2002-2008 Ralf S. Engelschall <rse@engelschall.com> |
5 // Copyright (c) 2002-2004 Michael Schloh von Bennewitz <michael@schloh.com> |
5 // Copyright (c) 2002-2008 Michael Schloh von Bennewitz <michael@schloh.com> |
6 // Copyright (c) 2002-2004 Cable & Wireless Telecommunications Services GmbH |
6 // Copyright (c) 2002-2008 Cable & Wireless Telecommunications Services GmbH |
7 // |
7 // |
8 // This file is part of OSSP asgui, an accounting system graphical user |
8 // This file is part of OSSP asgui, an accounting system graphical user |
9 // interface which can be found at http://www.ossp.org/pkg/tool/asgui/. |
9 // interface which can be found at http://asgui.europalab.com/. |
10 // |
10 // |
11 // Permission to use, copy, modify, and distribute this software for |
11 // Permission to use, copy, modify, and distribute this software for |
12 // any purpose with or without fee is hereby granted, provided that |
12 // any purpose with or without fee is hereby granted, provided that |
13 // the above copyright notice and this permission notice appear in all |
13 // the above copyright notice and this permission notice appear in all |
14 // copies. |
14 // copies. |
128 TITRAQ_STYLEPLAT, |
140 TITRAQ_STYLEPLAT, |
129 TITRAQ_STYLEMSOFT |
141 TITRAQ_STYLEMSOFT |
130 } styles_t; |
142 } styles_t; |
131 |
143 |
132 // Main application form window |
144 // Main application form window |
133 class Titraqform : public QMainWindow |
145 class Titraqform : public Q3MainWindow |
134 { |
146 { |
135 Q_OBJECT // Generate MOC object model stubs |
147 Q_OBJECT // Generate MOC object model stubs |
136 |
148 |
137 public: |
149 public: |
138 Titraqform(QWidget *pParent = 0, const char *kszName = 0, WFlags Flags = 0); |
150 Titraqform(QWidget *pParent = 0, const char *kszName = 0, Qt::WFlags Flags = 0); |
139 ~Titraqform(void); |
151 ~Titraqform(void); |
140 |
152 |
141 // Accessor methods |
153 // Accessor methods |
142 const QString getRowdata(void) const; // Get a whole row of data |
154 const QString getRowdata(void) const; // Get a whole row of data |
143 void setRowdata(QString &) const; // Set a whole row of data |
155 void setRowdata(QString &) const; // Set a whole row of data |
174 |
186 |
175 // Top level members |
187 // Top level members |
176 Preferences *m_pPrefs; |
188 Preferences *m_pPrefs; |
177 |
189 |
178 // Main application actions |
190 // Main application actions |
179 QAction *m_pFilenewact, *m_pFileopenact; |
191 Q3Action *m_pFilenewact, *m_pFileopenact; |
180 QAction *m_pFilesaveact, *m_pFilesaveasact; |
192 Q3Action *m_pFilesaveact, *m_pFilesaveasact; |
181 QAction *m_pFilecloseact, *m_pFilequitact; |
193 Q3Action *m_pFilecloseact, *m_pFilequitact; |
182 QAction *m_pAddrowact, *m_pDelrowact; |
194 Q3Action *m_pAddrowact, *m_pDelrowact; |
183 QAction *m_pRefreshact, *m_pCutact; |
195 Q3Action *m_pRefreshact, *m_pCutact; |
184 QAction *m_pCopyact, *m_pPasteact; |
196 Q3Action *m_pCopyact, *m_pPasteact; |
185 QAction *m_pSyncact, *m_pPrefsact; |
197 Q3Action *m_pSyncact, *m_pPrefsact; |
186 QAction *m_pReportact; |
198 Q3Action *m_pReportact; |
187 |
199 |
188 // Table, cells, and entries in package layout |
200 // Table, cells, and entries in package layout |
189 TiTable *m_pMaintable; |
201 TiTable *m_pMaintable; |
190 QHeader *m_pTablehead; |
202 Q3Header *m_pTablehead; |
191 QStringList *m_pTaskentries; |
203 QStringList *m_pTaskentries; |
192 |
204 |
193 // Edition widgets |
205 // Edition widgets |
194 QLabel *m_pStatusedit; // Control to show entry status |
206 QLabel *m_pStatusedit; // Control to show entry status |
195 QLineEdit *m_pLineedit; // Control to line number |
207 QLineEdit *m_pLineedit; // Control to line number |
196 QLineEdit *m_pUseredit; // Control to edit user name |
208 QLineEdit *m_pUseredit; // Control to edit user name |
197 QLineEdit *m_pGuidedit; // Control to edit GUID |
209 QLineEdit *m_pGuidedit; // Control to edit GUID |
198 QLineEdit *m_pCrcedit; // Control to edit CRC |
210 QLineEdit *m_pCrcedit; // Control to edit CRC |
199 QLineEdit *m_pRevedit; // Control to edit revision |
211 QLineEdit *m_pRevedit; // Control to edit revision |
200 Daydatedit *m_pDateedit; // Control to edit date |
212 Daydatedit *m_pDateedit; // Control to edit date |
201 QTimeEdit *m_pStarttime; // Control to edit start time |
213 Q3TimeEdit *m_pStarttime; // Control to edit start time |
202 QTimeEdit *m_pEndtime; // Control to edit finish time |
214 Q3TimeEdit *m_pEndtime; // Control to edit finish time |
203 // QTimeEdit *m_pAmount; // Control to edit total time |
215 // QTimeEdit *m_pAmount; // Control to edit total time |
204 ASTimeEdit *m_pAmount; // Control to edit total time |
216 ASTimeEdit *m_pAmount; // Control to edit total time |
205 QComboBox *m_pTasks; // Control to choose a task |
217 Q3ComboBox *m_pTasks; // Control to choose a task |
206 QLineEdit *m_pRemark; // Control to edit remark |
218 QLineEdit *m_pRemark; // Control to edit remark |
207 |
219 |
208 protected slots: |
220 protected slots: |
209 void cutEntry(void); // Cut task entries from the list |
221 void cutEntry(void); // Cut task entries from the list |
210 void copyEntry(void); // Copy task entries from the list |
222 void copyEntry(void); // Copy task entries from the list |
275 protected: |
287 protected: |
276 // Application main events |
288 // Application main events |
277 void closeEvent(QCloseEvent *); // Close current document in main window |
289 void closeEvent(QCloseEvent *); // Close current document in main window |
278 |
290 |
279 // Application main window widgets |
291 // Application main window widgets |
280 QFrame *m_pCenframe; // Central frame |
292 Q3Frame *m_pCenframe; // Central frame |
281 QVBoxLayout *m_pMainlayout; // Package and control layouts |
293 Q3VBoxLayout *m_pMainlayout; // Package and control layouts |
282 QVBoxLayout *m_pPackagelayout; // Main table control |
294 Q3VBoxLayout *m_pPackagelayout; // Main table control |
283 QHBoxLayout *m_pEditlayout; // Lower edition widgets |
295 Q3HBoxLayout *m_pEditlayout; // Lower edition widgets |
284 |
296 |
285 private: |
297 private: |
286 // Owned by QMainWindow |
298 // Owned by QMainWindow |
287 QMenuBar *m_pMenubar; |
299 QMenuBar *m_pMenubar; |
288 QPopupMenu *m_pViewpopup; // Saved for manipulating views |
300 Q3PopupMenu *m_pViewpopup; // Saved for manipulating views |
289 QPopupMenu *m_pTbarspopup; // Saved for manipulating toolbars |
301 Q3PopupMenu *m_pTbarspopup; // Saved for manipulating toolbars |
290 QPopupMenu *m_pColspopup; // Saved for manipulating columns |
302 Q3PopupMenu *m_pColspopup; // Saved for manipulating columns |
291 QStatusBar *m_pStatbar; |
303 QStatusBar *m_pStatbar; |
292 |
304 |
293 // Belong to us |
305 // Belong to us |
294 QToolBar *m_pFiletools; |
306 Q3ToolBar *m_pFiletools; |
295 QToolBar *m_pEdittools; |
307 Q3ToolBar *m_pEdittools; |
296 QToolBar *m_pViewtools; |
308 Q3ToolBar *m_pViewtools; |
297 QToolBar *m_pPrefstools; |
309 Q3ToolBar *m_pPrefstools; |
298 QToolBar *m_pWhatstools; |
310 Q3ToolBar *m_pWhatstools; |
299 QString *m_szFilename; |
311 QString *m_szFilename; |
300 |
312 |
301 // Constructor helpers |
313 // Constructor helpers |
302 void setupPrefs(void); // Preferences |
314 void setupPrefs(void); // Preferences |
303 void setupActions(void); // Actions |
315 void setupActions(void); // Actions |
311 void setupColumns(void); // Arrange and configure columns |
323 void setupColumns(void); // Arrange and configure columns |
312 void enableIface(bool); // [En/dis]able most ui pieces |
324 void enableIface(bool); // [En/dis]able most ui pieces |
313 |
325 |
314 // Data processing |
326 // Data processing |
315 void loadAccounts(QFile &); // Load accounts from file |
327 void loadAccounts(QFile &); // Load accounts from file |
316 void loadAccounts(QTextStream &); // Load accounts from stream |
328 void loadAccounts(Q3TextStream &); // Load accounts from stream |
317 void loadData(QFile &); // Load personal data from file |
329 void loadData(QFile &); // Load personal data from file |
318 void loadData(QTextStream &); // Load personal data from stream |
330 void loadData(Q3TextStream &); // Load personal data from stream |
319 void saveData(QFile &); // Save accounting data to file |
331 void saveData(QFile &); // Save accounting data to file |
320 void saveData(QTextStream &); // Save accounting data to stream |
332 void saveData(Q3TextStream &); // Save accounting data to stream |
321 const bool validateData(QFile &) const; // Validate personal data in file |
333 const bool validateData(QFile &) const; // Validate personal data in file |
322 const bool validateData(QString &) const; // Validate personal data from string |
334 const bool validateData(QString &) const; // Validate personal data from string |
323 }; |
335 }; |
324 |
336 |
325 #endif // AS_GUI_MWIN_H |
337 #endif // AS_GUI_MWIN_H |