karm
timekard.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef KARM_TIMEKARD_H
00024 #define KARM_TIMEKARD_H
00025
00026 #undef Color // X11 headers
00027 #undef GrayScale // X11 headers
00028 #include <kprinter.h>
00029
00030
00031 #include "karmstorage.h"
00032
00033 class TQString;
00034 class TQDate;
00035
00036 class TaskView;
00037
00038
00046 class Week
00047 {
00048 public:
00050 Week();
00051 Week(TQDate from);
00052 TQDate start() const;
00053 TQDate end() const;
00054 TQValueList<TQDate> days() const;
00055
00066 static TQValueList<Week> weeksFromDateRange(const TQDate& from,
00067 const TQDate& to);
00068
00075 TQString name() const;
00076
00077
00078 private:
00079 TQDate _start;
00080 };
00081
00085 class TimeKard
00086 {
00087 public:
00088 TimeKard() {};
00089
00090 enum WhichTime { TotalTime, SessionTime };
00091
00104 TQString totalsAsText(TaskView* taskview, bool justThisTask, WhichTime which);
00105
00111 TQString historyAsText(TaskView* taskview, const TQDate& from,
00112 const TQDate& to, bool justThisTask, bool perWeek, bool totalsOnly);
00113
00114 private:
00115 void printTask(Task *t, TQString &s, int level, WhichTime which);
00116
00117 void printTaskHistory(const Task *t, const TQMap<TQString, long>& datamap,
00118 TQMap<TQString, long>& daytotals,
00119 const TQDate& from, const TQDate& to,
00120 const int level, TQString& retval, bool totalsOnly);
00121
00122 TQString sectionHistoryAsText(TaskView* taskview,
00123 const TQDate& sectionFrom, const TQDate& sectionTo,
00124 const TQDate& from, const TQDate& to,
00125 const TQString& name,
00126 bool justThisTask, bool totalsOnly);
00127
00128 };
00129 #endif // KARM_TIMEKARD_H
|