author | alwin <alwin> | 2004-02-20 02:06:52 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-02-20 02:06:52 (UTC) |
commit | 55f4d502486e01927356908223622e435c975f7e (patch) (unidiff) | |
tree | 824b5c1e8992564677c4f39473bc108a32a2cf2a /libopie2/opiepim/core/orecur.h | |
parent | 060b4fc7a3fd5c1b5f745167fe084f7486719b7e (diff) | |
download | opie-55f4d502486e01927356908223622e435c975f7e.zip opie-55f4d502486e01927356908223622e435c975f7e.tar.gz opie-55f4d502486e01927356908223622e435c975f7e.tar.bz2 |
moved the opie pim stuff to libopie2 - pim. Tried to resort them, may be someone should take a look for a better file order. but now all applications can start using libopiepim2 instead of libopie1-pim-stuff.
Diffstat (limited to 'libopie2/opiepim/core/orecur.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/orecur.h | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/libopie2/opiepim/core/orecur.h b/libopie2/opiepim/core/orecur.h index d7ecd90..60508f5 100644 --- a/libopie2/opiepim/core/orecur.h +++ b/libopie2/opiepim/core/orecur.h | |||
@@ -1,38 +1,64 @@ | |||
1 | /* | 1 | /* |
2 | * GPL from TT | 2 | This file is part of the Opie Project |
3 | */ | 3 | Copyright (C) The Main Author <main-author@whereever.org> |
4 | =. Copyright (C) The Opie Team <opie-devel@handhelds.org> | ||
5 | .=l. | ||
6 | .>+-= | ||
7 | _;:, .> :=|. This program is free software; you can | ||
8 | .> <`_, > . <= redistribute it and/or modify it under | ||
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
10 | .="- .-=="i, .._ License as published by the Free Software | ||
11 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
12 | ._= =} : or (at your option) any later version. | ||
13 | .%`+i> _;_. | ||
14 | .i_,=:_. -<s. This program is distributed in the hope that | ||
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
16 | : .. .:, . . . without even the implied warranty of | ||
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
19 | ..}^=.= = ; Library General Public License for more | ||
20 | ++= -. .` .: details. | ||
21 | : = ...= . :.=- | ||
22 | -. .:....=;==+<; You should have received a copy of the GNU | ||
23 | -_. . . )=. = Library General Public License along with | ||
24 | -- :-=` this library; see the file COPYING.LIB. | ||
25 | If not, write to the Free Software Foundation, | ||
26 | Inc., 59 Temple Place - Suite 330, | ||
27 | Boston, MA 02111-1307, USA. | ||
28 | */ | ||
4 | 29 | ||
5 | #ifndef OPIE_RECUR_H | 30 | #ifndef OPIE_RECUR_H |
6 | #define OPIE_RECUR_H | 31 | #define OPIE_RECUR_H |
7 | 32 | ||
8 | #include <sys/types.h> | 33 | #include <sys/types.h> |
9 | 34 | ||
10 | #include <qdatetime.h> | 35 | #include <qdatetime.h> |
11 | #include <qvaluelist.h> | 36 | #include <qvaluelist.h> |
12 | #include <qmap.h> | 37 | #include <qmap.h> |
13 | 38 | ||
14 | 39 | ||
40 | namespace Opie { | ||
15 | /** | 41 | /** |
16 | * Class to handle Recurrencies.. | 42 | * Class to handle Recurrencies.. |
17 | */ | 43 | */ |
18 | 44 | ||
19 | class ORecur { | 45 | class ORecur { |
20 | public: | 46 | public: |
21 | typedef QValueList<QDate> ExceptionList; | 47 | typedef QValueList<QDate> ExceptionList; |
22 | enum RepeatType{ NoRepeat = -1, Daily, Weekly, MonthlyDay, | 48 | enum RepeatType{ NoRepeat = -1, Daily, Weekly, MonthlyDay, |
23 | MonthlyDate, Yearly }; | 49 | MonthlyDate, Yearly }; |
24 | enum Days { MON = 0x01, TUE = 0x02, WED = 0x04, THU = 0x08, | 50 | enum Days { MON = 0x01, TUE = 0x02, WED = 0x04, THU = 0x08, |
25 | FRI = 0x10, SAT = 0x20, SUN = 0x40 }; | 51 | FRI = 0x10, SAT = 0x20, SUN = 0x40 }; |
26 | enum Fields{ RType = 0, RWeekdays, RPosition, RFreq, RHasEndDate, | 52 | enum Fields{ RType = 0, RWeekdays, RPosition, RFreq, RHasEndDate, |
27 | EndDate, Created, Exceptions }; | 53 | EndDate, Created, Exceptions }; |
28 | 54 | ||
29 | ORecur(); | 55 | ORecur(); |
30 | ORecur( const QMap<int, QString>& map ); | 56 | ORecur( const QMap<int, QString>& map ); |
31 | ORecur( const ORecur& ); | 57 | ORecur( const ORecur& ); |
32 | ~ORecur(); | 58 | ~ORecur(); |
33 | 59 | ||
34 | ORecur &operator=( const ORecur& ); | 60 | ORecur &operator=( const ORecur& ); |
35 | bool operator==(const ORecur& )const; | 61 | bool operator==(const ORecur& )const; |
36 | 62 | ||
37 | bool doesRecur()const; | 63 | bool doesRecur()const; |
38 | /* if it recurrs on that day */ | 64 | /* if it recurrs on that day */ |
@@ -83,25 +109,26 @@ public: | |||
83 | 109 | ||
84 | void setService( const QString& ser ); | 110 | void setService( const QString& ser ); |
85 | 111 | ||
86 | QMap<int, QString> toMap() const; | 112 | QMap<int, QString> toMap() const; |
87 | void fromMap( const QMap<int, QString>& map ); | 113 | void fromMap( const QMap<int, QString>& map ); |
88 | 114 | ||
89 | /* almost internal */ | 115 | /* almost internal */ |
90 | QString toString()const; | 116 | QString toString()const; |
91 | private: | 117 | private: |
92 | bool p_nextOccurrence( const QDate& from, QDate& next ); | 118 | bool p_nextOccurrence( const QDate& from, QDate& next ); |
93 | void deref(); | 119 | void deref(); |
94 | inline void checkOrModify(); | 120 | inline void checkOrModify(); |
95 | 121 | ||
96 | /* Converts rType to String */ | 122 | /* Converts rType to String */ |
97 | QString rTypeString() const; | 123 | QString rTypeString() const; |
98 | /* Returns a map to convert Stringname for RType to RepeatType */ | 124 | /* Returns a map to convert Stringname for RType to RepeatType */ |
99 | QMap<QString, RepeatType> rTypeValueConvertMap() const; | 125 | QMap<QString, RepeatType> rTypeValueConvertMap() const; |
100 | 126 | ||
101 | class Data; | 127 | class Data; |
102 | Data* data; | 128 | Data* data; |
103 | class ORecurPrivate; | 129 | class ORecurPrivate; |
104 | ORecurPrivate *d; | 130 | ORecurPrivate *d; |
105 | }; | 131 | }; |
106 | 132 | ||
133 | } | ||
107 | #endif | 134 | #endif |