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

ktimetracker

task.h

Go to the documentation of this file.
00001 /*
00002  *     Copyright (C) 1997 by Stephan Kulow <coolo@kde.org>
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 KARM_TASK_H
00023 #define KARM_TASK_H
00024 
00025 #include <QDateTime>
00026 #include <QPixmap>
00027 #include <QVector>
00028 
00029 // Required b/c DesktopList is a typedef not a class.
00030 #include "desktoplist.h"
00031 
00032 // Required b/c of static cast below?  (How else can compiler know that a
00033 // TaskView is a subclass or QListView?)
00034 #include "taskview.h"
00035 
00036 class QObject;
00037 class QPixmap;
00038 class QString;
00039 
00040 class KarmStorage;
00041 
00042 namespace KCal 
00043 {
00044   class Incidence;
00045   class Todo;
00046 }
00047 
00061 class Task : public QObject, public QTreeWidgetItem
00062 {
00063   Q_OBJECT
00064 
00065   public:
00067     Task( const QString& taskame, long minutes, long sessionTime,
00068           DesktopList desktops, TaskView* parent = 0, bool konsolemode=false );
00069     Task( const QString& taskame, long minutes, long sessionTime,
00070           DesktopList desktops, Task* parent = 0);
00071     Task( KCal::Todo* incident, TaskView* parent, bool konsolemode=false );
00073     /* destructor */
00074     ~Task();
00075 
00079     Task* parent() const      { return (Task*)QTreeWidgetItem::parent(); }
00080 
00082     TaskView* taskView() const {
00083         return static_cast<TaskView *>( treeWidget() );
00084     }
00085 
00087     QString uid() const;
00088 
00089     int depth();
00090 
00091     void delete_recursive();
00092 
00100     void setUid( const QString &uid );
00101 
00103     void cut();
00104 
00107     void move(Task* destination);
00108 
00110     void paste(Task* destination);
00111 
00113 
00121       void changeTime( long minutes, KarmStorage* storage );
00122 
00131       void changeTimes
00132         ( long minutesSession, long minutes, KarmStorage* storage=0 );
00133 
00139       void changeTotalTimes( long minutesSession, long minutes );
00140 
00147       QString addTime( long minutes );
00148 
00155       QString addTotalTime( long minutes );
00156 
00163       QString addSessionTime( long minutes );
00164 
00171       QString addTotalSessionTime( long minutes );
00172 
00178       QString setTime( long minutes );
00179 
00189       QString setSessionTime( long minutes );
00190 
00194       void resetTimes();
00195 
00199       long time() const;
00200       long totalTime() const;
00201       long sessionTime() const;
00202       long totalSessionTime() const;
00203       KDateTime sessionStartTiMe() const;
00204 
00208       QDateTime startTime() const;
00209 
00211       void startNewSession();
00213 
00215 
00216       void setDesktopList ( DesktopList dl );
00217       DesktopList desktops() const;
00218 
00219       QString getDesktopStr() const;
00221 
00223 
00228       void setName( const QString& name, KarmStorage* storage );
00229 
00233       QString name() const;
00234 
00240       QString fullName() const;
00242 
00244     void update();
00245 
00247 
00256       void setRunning( bool on, KarmStorage* storage, 
00257                        const QDateTime &when = QDateTime::currentDateTime() );
00258 
00262       void resumeRunning();
00263 
00267       bool isRunning() const;
00269 
00275     bool parseIncidence( KCal::Incidence*, long& minutes,
00276         long& sessionMinutes, QString& sessionStartTiMe, QString& name, DesktopList& desktops,
00277         int& percent_complete, int& priority );
00278 
00282     KCal::Todo* asTodo(KCal::Todo* calendar) const;
00283 
00288     void setDescription( QString desc, KarmStorage* storage );
00289 
00294     void addComment( const QString &comment, KarmStorage* storage );
00295 
00297     QString comment() const;
00298 
00300     bool isRoot() const                 { return parent() == 0; }
00301 
00305     bool remove( KarmStorage* storage );
00306 
00314     void setPercentComplete(const int percent, KarmStorage *storage);
00315     int percentComplete() const;
00316 
00322     void setPriority( int priority );
00323     int priority() const;
00324 
00325 
00328     void setPixmapProgress();
00329 
00331     bool isComplete();
00332 
00333   protected:
00334     void changeParentTotalTimes( long minutesSession, long minutes );
00335 
00336   Q_SIGNALS:
00337     void totalTimesChanged( long minutesSession, long minutes);
00339     void deletingTask(Task* thisTask);
00340 
00341   protected Q_SLOTS:
00343     void updateActiveIcon();
00344 
00345   private:
00346 
00348     void noNegativeTimes();
00349 
00351     void init( const QString& taskame, long minutes, long sessionTime, QString sessionStartTiMe, 
00352                DesktopList desktops, int percent_complete, int priority, bool konsolemode=false );
00353 
00354     static QVector<QPixmap*> *icons;
00355 
00357     QString mUid;
00358 
00360     QString mComment;
00361 
00362     int mPercentComplete;
00363 
00365     QString mName;
00366 
00368     QDateTime mLastStart;
00369 
00371     long mTotalTime;
00372     long mTotalSessionTime;
00373 
00375     long mTime;
00376     long mSessionTime;
00377 
00379     KDateTime mSessionStartTiMe;
00380 
00381     DesktopList mDesktops;
00382     QTimer *mTimer;
00383     int mCurrentPic;
00384 
00386     bool mRemoving;
00387 
00389     int mPriority;
00390 };
00391 
00392 #endif // KARM_TASK_H

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