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
10class TDEAccel;
12class KarmTray;
13class TQListViewItem;
14class TQPoint;
15class TQString;
16
17class Preferences;
18class PrintDialog;
19class Task;
20class TaskView;
21
26class MainWindow : public KParts::MainWindow, virtual public KarmDCOPIface
27{
28 TQ_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* actionStopAll;
46 TDEAction* actionDelete;
47 TDEAction* actionEdit;
48 TDEAction* actionMarkAsComplete;
49 TDEAction* actionMarkAsIncomplete;
50 TDEAction* actionPreferences;
51 TDEAction* actionClipTotals;
52 TDEAction* 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( TDEConfig* );
113 virtual void readProperties( TDEConfig* );
114 void saveGeometry();
115 void loadGeometry();
116 bool queryClose();
117
118};
119
120#endif // KARM_MAIN_WINDOW_H
Define DCOP interface to karm.
virtual TQString exportcsvfile(TQString filename, TQString from, TQString to, int type=0, bool decimalMinutes=true, bool allTasks=true, TQString delimiter=";", TQString quote="'")=0
export csv history or totals file
virtual int addTask(const TQString &taskName)=0
Add a new top-level task.
virtual TQString starttimerfor(const TQString &taskname)=0
Start timer for all tasks with the summary taskname.
virtual TQString setPerCentComplete(const TQString &taskName, int perCent)=0
Set percent complete to a task.
virtual int totalMinutesForTaskId(const TQString &taskId)=0
Total time currently associated with a task.
virtual TQString stoptimerfor(const TQString &taskname)=0
Stop timer for all tasks with the summary taskname.
virtual TQString importplannerfile(TQString filename)=0
import planner project file
virtual TQString getError(int karmErrorNumber) const =0
Return error string associated with karm error number.
virtual TQString taskIdFromName(const TQString &taskName) const =0
Return id of task found, empty string if no match.
virtual TQString setpromptdelete(bool prompt)=0
set if prompted on deleting a task
virtual int bookTime(const TQString &taskId, const TQString &iso8601StartDateTime, long durationInMinutes)=0
Add time to a task.
Main window to tie the application together.
Definition mainwindow.h:27
TQString version() const
Return karm version.
bool getpromptdelete()
shall there be a "really delete" question
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...
TQString deletetodo()
delete the current item
Provide an interface to the configuration options for the program.
Definition preferences.h:17
Easy updating of menu accels when changing a TDEAccel object.
Container and interface for the tasks.
Definition taskview.h:43
A class representing a task.
Definition task.h:42