• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

ktimetracker

taskview.h

Go to the documentation of this file.
00001 /*
00002  *     Copyright (C) 2003 by Scott Monachello <smonach@cox.net>
00003  *                   2007 the ktimetracker developers
00004  *
00005  *   This program is free software; you can redistribute it and/or modify
00006  *   it under the terms of the GNU General Public License as published by
00007  *   the Free Software Foundation; either version 2 of the License, or
00008  *   (at your option) any later version.
00009  *
00010  *   This program is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details.
00014  *
00015  *   You should have received a copy of the GNU General Public License along
00016  *   with this program; if not, write to the
00017  *      Free Software Foundation, Inc.
00018  *      51 Franklin Street, Fifth Floor
00019  *      Boston, MA  02110-1301  USA.
00020  *
00021  */
00022 
00023 #ifndef KARM_TASK_VIEW_H
00024 #define KARM_TASK_VIEW_H
00025 
00026 #include <QList>
00027 #include <QTreeWidget>
00028 
00029 #include <kcal/resourcecalendar.h>
00030 
00031 #include "desktoplist.h"
00032 #include "karmstorage.h"
00033 #include "reportcriteria.h"
00034 
00035 class QMouseEvent;
00036 class QString;
00037 class QTableWidget;
00038 class QTimer;
00039 
00040 class DesktopTracker;
00041 class IdleTimeDetector;
00042 class Preferences;
00043 class Task;
00044 class KarmStorage;
00045 class HistoryEvent;
00046 
00047 using namespace KCal;
00048 
00053 class TaskView : public QTreeWidget
00054 {
00055   Q_OBJECT
00056 
00057   public:
00058     explicit TaskView( QWidget *parent = 0 );
00059     virtual ~TaskView();
00060 
00061     //BEGIN view specified
00063     Task* currentItem() const;
00064 
00066     Task* itemAt( int i );
00067     //END
00068 
00069     //BEGIN model specified
00071     void load( const QString &filename );
00072 
00074     void closeStorage();
00075 
00077     void startNewSession();
00078 
00080     bool allEventsHaveEndTiMe();
00081 
00083     void resetTimeForAllTasks();
00084 
00086     long count();
00087 
00089     QList<HistoryEvent> getHistory(const QDate& from, const QDate& to) const;
00090 
00092     void scheduleSave();
00093 
00095     QStringList tasks();
00096 
00098     Task* task( const QString& uid );
00099 
00101     QString addTask( const QString& taskame, long total = 0, long session = 0, const DesktopList& desktops = QVector<int>(0,0),
00102                      Task* parent = 0 );
00103 
00105     QList< Task* > activeTasks() const;
00106     //END
00107 
00108     //BEGIN behavior
00110     bool isFocusTrackingActive() const;
00111     //END
00112 
00113   public Q_SLOTS:
00115     QString save();
00116 
00118     void startCurrentTimer();
00119 
00121     void stopCurrentTimer();
00122 
00127     void stopAllTimers( const QDateTime &when = QDateTime::currentDateTime() );
00128 
00131     void toggleFocusTracking();
00132 
00134     void newTask();
00135 
00139     void newTask( const QString &caption, Task* parent );
00140 
00142     void refresh();
00143 
00145     void importPlanner( const QString &fileName = "" );
00146 
00148     QString report( const ReportCriteria &rc );
00149 
00151     void exportcsvFile();
00152 
00154     QString exportcsvHistory();
00155 
00157     void newSubTask();
00158 
00160     void editTask();
00161 
00171     KarmStorage* storage();
00172 
00179     void deleteTaskBatch( Task* task=0 );
00180 
00187     void deleteTask( Task* task=0 );
00188 
00191     void reinstateTask(int completion);
00192     void markTaskAsComplete();
00193     void markTaskAsIncomplete();
00194 
00196     void extractTime( int minutes );
00197     void taskTotalTimesChanged( long session, long total)
00198                                 { emit totalTimesChanged( session, total); }
00200     void deletingTask(Task* deletedTask);
00201 
00206     void startTimerFor( Task* task, 
00207                         const QDateTime &startTime = QDateTime::currentDateTime() );
00208     void stopTimerFor( Task* task );
00209 
00213     void clearActiveTasks();
00214 
00216     QString clipTotals( const ReportCriteria &rc );
00217 
00219     QString setClipBoardText(const QString& s);
00220 
00222     void reconfigure();
00223 
00225     QString reFreshTimes();
00226 
00227   Q_SIGNALS:
00228     void totalTimesChanged( long session, long total );
00229     void reSetTimes();
00230     void updateButtons();
00231     void timersActive();
00232     void timersInactive();
00233     void tasksChanged( QList<Task*> activeTasks );
00234     void setStatusBarText(QString);
00235     void contextMenuRequested( const QPoint & );
00236 
00237   private: // member variables
00238     IdleTimeDetector* _idleTimeDetector;
00239     QTimer *_minuteTimer;
00240     QTimer *_autoSaveTimer;
00241     QTimer *_manualSaveTimer;
00242     Preferences *_preferences;
00243     DesktopTracker* _desktopTracker;
00244     bool _isloading;
00245     QTableWidget* historywidget;
00246 
00247     //@cond PRIVATE
00248     class Private;
00249     Private *const d;
00250     //@endcond
00251 
00252   private:
00253     void updateParents( Task* task, long totalDiff, long sesssionDiff);
00254     void deleteChildTasks( Task *item );
00255     void addTimeToActiveTasks( int minutes, bool save_data = true );
00257     void restoreItemState();
00258 
00259   protected:
00260     void mouseMoveEvent( QMouseEvent* );
00261     void mousePressEvent( QMouseEvent* );
00262 
00263   protected Q_SLOTS:
00264     void minuteUpdate();
00265 
00267     void itemStateChanged( QTreeWidgetItem *item );
00268 
00271     void iCalFileModified(ResourceCalendar *);
00272     void slotItemDoubleClicked( QTreeWidgetItem *item, int );
00273 
00275     void newFocusWindowDetected( const QString & );
00276 
00277     void slotColumnToggled( int );
00278     void slotCustomContextMenuRequested( const QPoint & );
00279     void slotSetPercentage( QAction * );
00280     void slotSetPriority( QAction * );
00281 };
00282 
00283 #endif // KARM_TASK_VIEW

ktimetracker

Skip menu "ktimetracker"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  •   doc
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal