karm

mainwindow.h

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