summaryrefslogtreecommitdiff
path: root/libopie/pim/orecur.h
Unidiff
Diffstat (limited to 'libopie/pim/orecur.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/orecur.h107
1 files changed, 0 insertions, 107 deletions
diff --git a/libopie/pim/orecur.h b/libopie/pim/orecur.h
deleted file mode 100644
index d7ecd90..0000000
--- a/libopie/pim/orecur.h
+++ b/dev/null
@@ -1,107 +0,0 @@
1/*
2 * GPL from TT
3 */
4
5#ifndef OPIE_RECUR_H
6#define OPIE_RECUR_H
7
8#include <sys/types.h>
9
10#include <qdatetime.h>
11#include <qvaluelist.h>
12#include <qmap.h>
13
14
15/**
16 * Class to handle Recurrencies..
17 */
18
19class ORecur {
20public:
21 typedef QValueList<QDate> ExceptionList;
22 enum RepeatType{ NoRepeat = -1, Daily, Weekly, MonthlyDay,
23 MonthlyDate, Yearly };
24 enum Days { MON = 0x01, TUE = 0x02, WED = 0x04, THU = 0x08,
25 FRI = 0x10, SAT = 0x20, SUN = 0x40 };
26 enum Fields{ RType = 0, RWeekdays, RPosition, RFreq, RHasEndDate,
27 EndDate, Created, Exceptions };
28
29 ORecur();
30 ORecur( const QMap<int, QString>& map );
31 ORecur( const ORecur& );
32 ~ORecur();
33
34 ORecur &operator=( const ORecur& );
35 bool operator==(const ORecur& )const;
36
37 bool doesRecur()const;
38 /* if it recurrs on that day */
39 bool doesRecur( const QDate& );
40 RepeatType type()const;
41 int frequency()const;
42 int position()const;
43 char days()const;
44 bool hasEndDate()const;
45 QDate start()const;
46 QDate endDate()const;
47 QDateTime createdDateTime()const;
48 /**
49 * starting on monday=0, sunday=6
50 * for convience
51 */
52 bool repeatOnWeekDay( int day )const;
53
54 /**
55 * FromWhereToStart is not included!!!
56 */
57 bool nextOcurrence( const QDate& FromWhereToStart, QDate &recurDate );
58
59 /**
60 * The module this ORecur belongs to
61 */
62 QString service()const;
63
64 /*
65 * reference to the exception list
66 */
67 ExceptionList &exceptions();
68
69 /**
70 * the current repetition
71 */
72 int repetition()const;
73
74 void setType( const RepeatType& );
75 void setFrequency( int freq );
76 void setPosition( int pos );
77 void setDays( char c);
78 void setEndDate( const QDate& dt );
79 void setStart( const QDate& dt );
80 void setCreatedDateTime( const QDateTime& );
81 void setHasEndDate( bool b );
82 void setRepitition(int );
83
84 void setService( const QString& ser );
85
86 QMap<int, QString> toMap() const;
87 void fromMap( const QMap<int, QString>& map );
88
89 /* almost internal */
90 QString toString()const;
91private:
92 bool p_nextOccurrence( const QDate& from, QDate& next );
93 void deref();
94 inline void checkOrModify();
95
96 /* Converts rType to String */
97 QString rTypeString() const;
98 /* Returns a map to convert Stringname for RType to RepeatType */
99 QMap<QString, RepeatType> rTypeValueConvertMap() const;
100
101 class Data;
102 Data* data;
103 class ORecurPrivate;
104 ORecurPrivate *d;
105};
106
107#endif