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* 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
Define DCOP interface to karm.
Definition: karmdcopiface.h:28
Main window to tie the application together.
Definition: mainwindow.h:27
int addTask(const TQString &storage)
Definition: mainwindow.cpp:532
TQString setPerCentComplete(const TQString &taskName, int PerCent)
Definition: mainwindow.cpp:546
TQString setpromptdelete(bool prompt)
set if there will be a "really delete" question
Definition: mainwindow.cpp:512
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
int totalMinutesForTaskId(const TQString &taskId)
Total time currently associated with a task.
Definition: mainwindow.cpp:625
int bookTime(const TQString &taskId, const TQString &iso8601StartDateTime, long durationInMinutes)
Definition: mainwindow.cpp:567
TQString stoptimerfor(const TQString &taskname)
stop the timer for taskname
Definition: mainwindow.cpp:708
TQString getError(int karmErrorNumber) const
Definition: mainwindow.cpp:619
TQString version() const
Return karm version.
Definition: mainwindow.cpp:496
TQString starttimerfor(const TQString &taskname)
start the timer for taskname
Definition: mainwindow.cpp:691
TQString taskIdFromName(const TQString &taskName) const
Return id of task found, empty string if no match.
Definition: mainwindow.cpp:518
bool getpromptdelete()
shall there be a "really delete" question
Definition: mainwindow.cpp:507
TQString importplannerfile(TQString filename)
import planner project file
Definition: mainwindow.cpp:743
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 deletetodo()
delete the current item
Definition: mainwindow.cpp:501
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