ktimetracker
timetrackerwidget.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef TIMETRACKER_WIDGET_H
00023 #define TIMETRACKER_WIDGET_H
00024
00025 #include <kconfiggroup.h>
00026 #include <QWidget>
00027 #include <QDateTime>
00028
00029 class KAction;
00030 class KActionCollection;
00031 class KUrl;
00032
00033 class Task;
00034 class TaskView;
00035
00036 class TimetrackerWidget : public QWidget
00037 {
00038 Q_OBJECT
00039
00040 public:
00041 explicit TimetrackerWidget( QWidget *parent = 0 );
00042 ~TimetrackerWidget();
00043 virtual void saveProperties( KConfigGroup& );
00044 virtual void readProperties( const KConfigGroup& );
00045
00051 bool allEventsHaveEndTiMe();
00052
00053 private:
00054 void addTaskView( const QString &fileName = "" );
00055
00061 bool saveCurrentTaskView();
00062
00063 bool eventFilter( QObject *obj, QEvent *event );
00064
00065 public:
00069 TaskView* currentTaskView();
00070
00074 Task* currentTask();
00075
00083 void setupActions( KActionCollection *actionCollection );
00084
00091 KAction *action( const QString &name ) const;
00092
00093 public Q_SLOTS:
00098 void newFile();
00099
00103 void openFile( const QString &fileName = QString() );
00104
00108 void openFile( const KUrl &fileName );
00109
00116 bool closeFile();
00117
00122 void saveFile();
00123
00128 void reconfigureFiles();
00129
00133 void showSearchBar( bool visible );
00134
00138 void showTabBar( bool visible );
00139
00147 bool closeAllFiles();
00148
00149
00150
00151
00152
00153
00154
00155 void startCurrentTimer();
00156 void stopCurrentTimer();
00157 void stopAllTimers( const QDateTime &when = QDateTime::currentDateTime() );
00158 void newTask();
00159 void newSubTask();
00160 void editTask();
00161 void deleteTask();
00162 void markTaskAsComplete();
00163 void markTaskAsIncomplete();
00164 void exportcsvFile();
00165 void exportcsvHistory();
00166 void importPlanner( const QString &fileName = "" );
00167 void startNewSession();
00168 void editHistory();
00169 void resetAllTimes();
00170 void focusTracking();
00171 void slotSearchBar();
00172
00173
00174
00175 QString version() const;
00176 QStringList taskIdsFromName( const QString &taskName ) const;
00177 void addTask( const QString &taskName );
00178 void addSubTask( const QString& taskName, const QString &taskId );
00179 void deleteTask( const QString &taskId );
00180 void setPercentComplete( const QString &taskId, int percent );
00181 int bookTime( const QString &taskId, const QString &dateTime, int minutes );
00182 QString error( int errorCode ) const;
00183 int totalMinutesForTaskId( const QString &taskId ) const;
00184 void startTimerFor( const QString &taskId );
00185 void stopTimerFor( const QString &taskId );
00186
00187 bool startTimerForTaskName( const QString &taskName );
00188 bool stopTimerForTaskName( const QString &taskName );
00189
00190
00191 void stopAllTimersDBUS();
00192 QString exportCSVFile( const QString &filename, const QString &from,
00193 const QString &to, int type, bool decimalMinutes,
00194 bool allTasks, const QString &delimiter,
00195 const QString "e );
00196 void importPlannerFile( const QString &filename );
00197 QStringList tasks() const;
00198 QStringList activeTasks() const;
00199 bool isActive( const QString &taskId ) const;
00200 bool isTaskNameActive( const QString &taskId ) const;
00201 void saveAll();
00202 void quit();
00203
00204
00205 protected:
00206 bool event ( QEvent * event );
00207
00208 private Q_SLOTS:
00209 void slotCurrentChanged();
00210 void updateTabs();
00211 void slotAddTask( const QString &taskName );
00212 void slotUpdateButtons();
00213 void showSettingsDialog();
00214
00215 Q_SIGNALS:
00216 void setCaption( const QString& qs );
00217 void currentTaskChanged();
00218 void currentTaskViewChanged();
00219 void updateButtons();
00220 void totalTimesChanged( long session, long total );
00221 void reSetTimes();
00222 void statusBarTextChangeRequested( const QString &text );
00223 void contextMenuRequested( const QPoint &pos );
00224 void timersActive();
00225 void timersInactive();
00226 void tasksChanged( const QList< Task* >& );
00227
00228 private:
00229
00230 class Private;
00231 Private *const d;
00232
00233 };
00234
00235 #endif