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

ktimetracker

timetrackerwidget.h

Go to the documentation of this file.
00001 /*
00002  *     Copyright (C) 2007 by Mathias Soeken <msoeken@tzi.de>
00003  *
00004  *   This program is free software; you can redistribute it and/or modify
00005  *   it under the terms of the GNU General Public License as published by
00006  *   the Free Software Foundation; either version 2 of the License, or
00007  *   (at your option) any later version.
00008  *
00009  *   This program is distributed in the hope that it will be useful,
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *   GNU General Public License for more details.
00013  *
00014  *   You should have received a copy of the GNU General Public License along
00015  *   with this program; if not, write to the
00016  *      Free Software Foundation, Inc.
00017  *      51 Franklin Street, Fifth Floor
00018  *      Boston, MA  02110-1301  USA.
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     //BEGIN wrapper slots
00151     /*
00152      * The following slots are wrapper slots which fires the corresponding
00153      * slot of the current taskview.
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     //END
00173 
00174     //BEGIN dbus slots
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   // FIXME rename, when the wrapper slot is removed
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 &quote );
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     //END
00204 
00205   protected:
00206     bool event ( QEvent * event ); // inherited from QWidget
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     //@cond PRIVATE
00230     class Private;
00231     Private *const d;
00232     //@endcond
00233 };
00234 
00235 #endif

ktimetracker

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

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
  • 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