karm

mainwindow.h
00001 #ifndef KARM_MAIN_WINDOW_H
00002 #define KARM_MAIN_WINDOW_H
00003 
00004 #include <tdeparts/mainwindow.h>
00005 
00006 #include "karmerrors.h"
00007 #include <karmdcopiface.h>
00008 #include "reportcriteria.h"
00009 
00010 class TDEAccel;
00011 class TDEAccelMenuWatch;
00012 class KarmTray;
00013 class TQListViewItem;
00014 class TQPoint;
00015 class TQString;
00016 
00017 class Preferences;
00018 class PrintDialog;
00019 class Task;
00020 class TaskView;
00021 
00026 class MainWindow : public KParts::MainWindow, virtual public KarmDCOPIface
00027 {
00028   Q_OBJECT
00029   
00030 
00031   private:
00032     void             makeMenus();
00033     TQString          _hasTask( Task* task, const TQString &taskname ) const;
00034     Task*            _hasUid( Task* task, const TQString &uid ) const;
00035 
00036     TDEAccel*          _accel;
00037     TDEAccelMenuWatch* _watcher;
00038     TaskView*        _taskView;
00039     long             _totalSum;
00040     long             _sessionSum;
00041     Preferences*     _preferences;
00042     KarmTray*        _tray;
00043     TDEAction*         actionStart;
00044     TDEAction*         actionStop;
00045     TDEAction*         actionStopAll;
00046     TDEAction*         actionDelete;
00047     TDEAction*         actionEdit;
00048     TDEAction*         actionMarkAsComplete;
00049     TDEAction*         actionMarkAsIncomplete;
00050     TDEAction*         actionPreferences;
00051     TDEAction*         actionClipTotals;
00052     TDEAction*         actionClipHistory;
00053     TQString          m_error[ KARM_MAX_ERROR_NO + 1 ];
00054 
00055     friend class KarmTray;
00056 
00057   //private:
00058 
00059     //KDialogBase *dialog;
00060 
00061 
00062 
00063   public:
00064     MainWindow( const TQString &icsfile = "" );
00065     virtual ~MainWindow();
00066 
00067     // DCOP
00068     TQString version() const;
00069     TQString taskIdFromName( const TQString &taskName ) const;
00071     int addTask( const TQString &storage );
00073     TQString setPerCentComplete( const TQString& taskName, int PerCent );
00075     int bookTime( const TQString& taskId, const TQString& iso8601StartDateTime, long durationInMinutes );
00077     TQString getError( int karmErrorNumber ) const;
00078     int totalMinutesForTaskId( const TQString& taskId );
00080     TQString starttimerfor( const TQString &taskname );
00082     TQString stoptimerfor( const TQString &taskname );
00083     TQString deletetodo();
00085     bool    getpromptdelete();
00087     TQString setpromptdelete( bool prompt );
00088     TQString exportcsvfile( TQString filename, TQString from, TQString to, int type, bool decimalMinutes, bool allTasks, TQString delimiter, TQString quote );
00089     TQString importplannerfile( TQString filename );
00090 
00091   public slots:
00092     void setStatusBar( TQString );
00093     void quit();
00094 
00095   protected slots:
00096     void keyBindings();
00097     void startNewSession();
00098     void resetAllTimes();
00099     void updateTime( long, long );
00100     void updateStatusBar();
00101     bool save();
00102     void exportcsvHistory();
00103     void print();
00104     void slotSelectionChanged();
00105     void contextMenuRequest( TQListViewItem*, const TQPoint&, int );
00106     void enableStopAll();
00107     void disableStopAll();
00108 //    void timeLoggingChanged( bool on );
00109 
00110   protected:
00111     void startStatusBar();
00112     virtual void saveProperties( TDEConfig* );
00113     virtual void readProperties( TDEConfig* );
00114     void saveGeometry();
00115     void loadGeometry();
00116     bool queryClose();
00117 
00118 };
00119 
00120 #endif // KARM_MAIN_WINDOW_H