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.
Definition: karmdcopiface.h:28
Main window to tie the application together.
Definition: mainwindow.h:27
int addTask(const TQString &storage)
Definition: mainwindow.cpp:523
TQString setPerCentComplete(const TQString &taskName, int PerCent)
Definition: mainwindow.cpp:537
TQString setpromptdelete(bool prompt)
set if there will be a "really delete" question
Definition: mainwindow.cpp:503
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:716
int totalMinutesForTaskId(const TQString &taskId)
Total time currently associated with a task.
Definition: mainwindow.cpp:616
int bookTime(const TQString &taskId, const TQString &iso8601StartDateTime, long durationInMinutes)
Definition: mainwindow.cpp:558
TQString stoptimerfor(const TQString &taskname)
stop the timer for taskname
Definition: mainwindow.cpp:699
TQString getError(int karmErrorNumber) const
Definition: mainwindow.cpp:610
TQString version() const
Return karm version.
Definition: mainwindow.cpp:487
TQString starttimerfor(const TQString &taskname)
start the timer for taskname
Definition: mainwindow.cpp:682
TQString taskIdFromName(const TQString &taskName) const
Return id of task found, empty string if no match.
Definition: mainwindow.cpp:509
bool getpromptdelete()
shall there be a "really delete" question
Definition: mainwindow.cpp:498
TQString importplannerfile(TQString filename)
import planner project file
Definition: mainwindow.cpp:734
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:192
TQString deletetodo()
delete the current item
Definition: mainwindow.cpp:492
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