karm

mainwindow.h
1 #ifndef KARM_MAIN_WINDOW_H
2 #define KARM_MAIN_WINDOW_H
3 
4 #include <tdeparts/mainwindow.h>
5 
6 #include "karmerrors.h"
7 #include <karmdcopiface.h>
8 #include "reportcriteria.h"
9 
10 class TDEAccel;
11 class TDEAccelMenuWatch;
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 
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  TDEAccel* _accel;
37  TDEAccelMenuWatch* _watcher;
38  TaskView* _taskView;
39  long _totalSum;
40  long _sessionSum;
41  Preferences* _preferences;
42  KarmTray* _tray;
43  TDEAction* actionStart;
44  TDEAction* actionStop;
45  TDEAction* actionResetTime;
46  TDEAction* actionStopAll;
47  TDEAction* actionDelete;
48  TDEAction* actionEdit;
49  TDEAction* actionMarkAsComplete;
50  TDEAction* actionMarkAsIncomplete;
51  TDEAction* actionPreferences;
52  TDEAction* actionClipTotals;
53  TDEAction* actionClipHistory;
54  TQString m_error[ KARM_MAX_ERROR_NO + 1 ];
55 
56  friend class KarmTray;
57 
58  //private:
59 
60  //KDialogBase *dialog;
61 
62 
63 
64  public:
65  MainWindow( const TQString &icsfile = "" );
66  virtual ~MainWindow();
67 
68  // DCOP
69  TQString version() const;
70  TQString taskIdFromName( const TQString &taskName ) const;
72  int addTask( const TQString &storage );
74  TQString setPerCentComplete( const TQString& taskName, int PerCent );
76  int bookTime( const TQString& taskId, const TQString& iso8601StartDateTime, long durationInMinutes );
78  TQString getError( int karmErrorNumber ) const;
79  int totalMinutesForTaskId( const TQString& taskId );
81  TQString starttimerfor( const TQString &taskname );
83  TQString stoptimerfor( const TQString &taskname );
84  TQString deletetodo();
86  bool getpromptdelete();
88  TQString setpromptdelete( bool prompt );
89  TQString exportcsvfile( TQString filename, TQString from, TQString to, int type, bool decimalMinutes, bool allTasks, TQString delimiter, TQString quote );
90  TQString importplannerfile( TQString filename );
91 
92  public slots:
93  void setStatusBar( TQString );
94  void quit();
95 
96  protected slots:
97  void keyBindings();
98  void startNewSession();
99  void resetAllTimes();
100  void updateTime( long, long );
101  void updateStatusBar();
102  bool save();
103  void exportcsvHistory();
104  void print();
105  void slotSelectionChanged();
106  void contextMenuRequest( TQListViewItem*, const TQPoint&, int );
107  void enableStopAll();
108  void disableStopAll();
109 // void timeLoggingChanged( bool on );
110 
111  protected:
112  void startStatusBar();
113  virtual void saveProperties( TDEConfig* );
114  virtual void readProperties( TDEConfig* );
115  void saveGeometry();
116  void loadGeometry();
117  bool queryClose();
118 
119 };
120 
121 #endif // KARM_MAIN_WINDOW_H
int totalMinutesForTaskId(const TQString &taskId)
Total time currently associated with a task.
Definition: mainwindow.cpp:625
int addTask(const TQString &storage)
Definition: mainwindow.cpp:532
TQString exportcsvfile(TQString filename, TQString from, TQString to, int type, bool decimalMinutes, bool allTasks, TQString delimiter, TQString quote)
export csv history or totals file
Definition: mainwindow.cpp:725
bool getpromptdelete()
shall there be a "really delete" question
Definition: mainwindow.cpp:507
TQString setpromptdelete(bool prompt)
set if there will be a "really delete" question
Definition: mainwindow.cpp:512
Define DCOP interface to karm.
Definition: karmdcopiface.h:27
Easy updating of menu accels when changing a TDEAccel object.
TQString starttimerfor(const TQString &taskname)
start the timer for taskname
Definition: mainwindow.cpp:691
void updateTime(long, long)
Calculate the sum of the session time and the total time for all toplevel tasks and put it in the sta...
Definition: mainwindow.cpp:193
TQString stoptimerfor(const TQString &taskname)
stop the timer for taskname
Definition: mainwindow.cpp:708
TQString version() const
Return karm version.
Definition: mainwindow.cpp:496
TQString getError(int karmErrorNumber) const
Definition: mainwindow.cpp:619
TQString taskIdFromName(const TQString &taskName) const
Return id of task found, empty string if no match.
Definition: mainwindow.cpp:518
TQString setPerCentComplete(const TQString &taskName, int PerCent)
Definition: mainwindow.cpp:546
TQString importplannerfile(TQString filename)
import planner project file
Definition: mainwindow.cpp:743
TQString deletetodo()
delete the current item
Definition: mainwindow.cpp:501
int bookTime(const TQString &taskId, const TQString &iso8601StartDateTime, long durationInMinutes)
Definition: mainwindow.cpp:567
Provide an interface to the configuration options for the program.
Definition: preferences.h:16
Container and interface for the tasks.
Definition: taskview.h:42
A class representing a task.
Definition: task.h:41
Main window to tie the application together.
Definition: mainwindow.h:26