karm

mainwindow.h
1 #ifndef KARM_MAIN_WINDOW_H
2 #define KARM_MAIN_WINDOW_H
3 
4 #include <kparts/mainwindow.h>
5 
6 #include "karmerrors.h"
7 #include <karmdcopiface.h>
8 #include "reportcriteria.h"
9 
10 class KAccel;
11 class KAccelMenuWatch;
12 class KarmTray;
13 class TQListViewItem;
14 class TQPoint;
15 class TQString;
16 
17 class Preferences;
18 class PrintDialog;
19 class Task;
20 class TaskView;
21 
26 class MainWindow : public KParts::MainWindow, virtual public KarmDCOPIface
27 {
28  Q_OBJECT
29  TQ_OBJECT
30 
31  private:
32  void makeMenus();
33  TQString _hasTask( Task* task, const TQString &taskname ) const;
34  Task* _hasUid( Task* task, const TQString &uid ) const;
35 
36  KAccel* _accel;
37  KAccelMenuWatch* _watcher;
38  TaskView* _taskView;
39  long _totalSum;
40  long _sessionSum;
41  Preferences* _preferences;
42  KarmTray* _tray;
43  KAction* actionStart;
44  KAction* actionStop;
45  KAction* actionStopAll;
46  KAction* actionDelete;
47  KAction* actionEdit;
48  KAction* actionMarkAsComplete;
49  KAction* actionMarkAsIncomplete;
50  KAction* actionPreferences;
51  KAction* actionClipTotals;
52  KAction* actionClipHistory;
53  TQString m_error[ KARM_MAX_ERROR_NO + 1 ];
54 
55  friend class KarmTray;
56 
57  //private:
58 
59  //KDialogBase *dialog;
60 
61 
62 
63  public:
64  MainWindow( const TQString &icsfile = "" );
65  virtual ~MainWindow();
66 
67  // DCOP
68  TQString version() const;
69  TQString taskIdFromName( const TQString &taskName ) const;
71  int addTask( const TQString &storage );
73  TQString setPerCentComplete( const TQString& taskName, int PerCent );
75  int bookTime( const TQString& taskId, const TQString& iso8601StartDateTime, long durationInMinutes );
77  TQString getError( int karmErrorNumber ) const;
78  int totalMinutesForTaskId( const TQString& taskId );
80  TQString starttimerfor( const TQString &taskname );
82  TQString stoptimerfor( const TQString &taskname );
83  TQString deletetodo();
85  bool getpromptdelete();
87  TQString setpromptdelete( bool prompt );
88  TQString exportcsvfile( TQString filename, TQString from, TQString to, int type, bool decimalMinutes, bool allTasks, TQString delimiter, TQString quote );
89  TQString importplannerfile( TQString filename );
90 
91  public slots:
92  void setStatusBar( TQString );
93  void quit();
94 
95  protected slots:
96  void keyBindings();
97  void startNewSession();
98  void resetAllTimes();
99  void updateTime( long, long );
100  void updateStatusBar();
101  bool save();
102  void exportcsvHistory();
103  void print();
104  void slotSelectionChanged();
105  void contextMenuRequest( TQListViewItem*, const TQPoint&, int );
106  void enableStopAll();
107  void disableStopAll();
108 // void timeLoggingChanged( bool on );
109 
110  protected:
111  void startStatusBar();
112  virtual void saveProperties( KConfig* );
113  virtual void readProperties( KConfig* );
114  void saveGeometry();
115  void loadGeometry();
116  bool queryClose();
117 
118 };
119 
120 #endif // KARM_MAIN_WINDOW_H