author | mickeyl <mickeyl> | 2004-02-21 12:25:50 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-02-21 12:25:50 (UTC) |
commit | 6155f1be5c19fc51a4929c9e173f9e5a24d193e6 (patch) (unidiff) | |
tree | c18ca863f82a559c60728f922519ac696387ec53 /libopie2/opiepim/core/orecur.h | |
parent | a570c2824fcecaf1c278e1b5a592fa14cc0647f8 (diff) | |
download | opie-6155f1be5c19fc51a4929c9e173f9e5a24d193e6.zip opie-6155f1be5c19fc51a4929c9e173f9e5a24d193e6.tar.gz opie-6155f1be5c19fc51a4929c9e173f9e5a24d193e6.tar.bz2 |
the usual cosmetics
Diffstat (limited to 'libopie2/opiepim/core/orecur.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/orecur.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/libopie2/opiepim/core/orecur.h b/libopie2/opiepim/core/orecur.h index 60508f5..7808897 100644 --- a/libopie2/opiepim/core/orecur.h +++ b/libopie2/opiepim/core/orecur.h | |||
@@ -1,134 +1,137 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | Copyright (C) The Main Author <main-author@whereever.org> | 3 | Copyright (C) The Main Author <main-author@whereever.org> |
4 | =. Copyright (C) The Opie Team <opie-devel@handhelds.org> | 4 | =. Copyright (C) The Opie Team <opie-devel@handhelds.org> |
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #ifndef OPIE_RECUR_H | 30 | #ifndef ORECUR_H |
31 | #define OPIE_RECUR_H | 31 | #define ORECUR_H |
32 | |||
33 | #include <sys/types.h> | ||
34 | 32 | ||
33 | /* QT */ | ||
35 | #include <qdatetime.h> | 34 | #include <qdatetime.h> |
36 | #include <qvaluelist.h> | 35 | #include <qvaluelist.h> |
37 | #include <qmap.h> | 36 | #include <qmap.h> |
38 | 37 | ||
38 | /* STD */ | ||
39 | #include <sys/types.h> | ||
39 | 40 | ||
40 | namespace Opie { | 41 | namespace Opie { |
41 | /** | 42 | /** |
42 | * Class to handle Recurrencies.. | 43 | * Class to handle Recurrencies.. |
43 | */ | 44 | */ |
44 | 45 | ||
45 | class ORecur { | 46 | class ORecur { |
46 | public: | 47 | |
48 | public: | ||
47 | typedef QValueList<QDate> ExceptionList; | 49 | typedef QValueList<QDate> ExceptionList; |
48 | enum RepeatType{ NoRepeat = -1, Daily, Weekly, MonthlyDay, | 50 | enum RepeatType{ NoRepeat = -1, Daily, Weekly, MonthlyDay, |
49 | MonthlyDate, Yearly }; | 51 | MonthlyDate, Yearly }; |
50 | enum Days { MON = 0x01, TUE = 0x02, WED = 0x04, THU = 0x08, | 52 | enum Days { MON = 0x01, TUE = 0x02, WED = 0x04, THU = 0x08, |
51 | FRI = 0x10, SAT = 0x20, SUN = 0x40 }; | 53 | FRI = 0x10, SAT = 0x20, SUN = 0x40 }; |
52 | enum Fields{ RType = 0, RWeekdays, RPosition, RFreq, RHasEndDate, | 54 | enum Fields{ RType = 0, RWeekdays, RPosition, RFreq, RHasEndDate, |
53 | EndDate, Created, Exceptions }; | 55 | EndDate, Created, Exceptions }; |
54 | 56 | ||
55 | ORecur(); | 57 | ORecur(); |
56 | ORecur( const QMap<int, QString>& map ); | 58 | ORecur( const QMap<int, QString>& map ); |
57 | ORecur( const ORecur& ); | 59 | ORecur( const ORecur& ); |
58 | ~ORecur(); | 60 | ~ORecur(); |
59 | 61 | ||
60 | ORecur &operator=( const ORecur& ); | 62 | ORecur &operator=( const ORecur& ); |
61 | bool operator==(const ORecur& )const; | 63 | bool operator==(const ORecur& )const; |
62 | 64 | ||
63 | bool doesRecur()const; | 65 | bool doesRecur()const; |
64 | /* if it recurrs on that day */ | 66 | /* if it recurrs on that day */ |
65 | bool doesRecur( const QDate& ); | 67 | bool doesRecur( const QDate& ); |
66 | RepeatType type()const; | 68 | RepeatType type()const; |
67 | int frequency()const; | 69 | int frequency()const; |
68 | int position()const; | 70 | int position()const; |
69 | char days()const; | 71 | char days()const; |
70 | bool hasEndDate()const; | 72 | bool hasEndDate()const; |
71 | QDate start()const; | 73 | QDate start()const; |
72 | QDate endDate()const; | 74 | QDate endDate()const; |
73 | QDateTime createdDateTime()const; | 75 | QDateTime createdDateTime()const; |
74 | /** | 76 | /** |
75 | * starting on monday=0, sunday=6 | 77 | * starting on monday=0, sunday=6 |
76 | * for convience | 78 | * for convience |
77 | */ | 79 | */ |
78 | bool repeatOnWeekDay( int day )const; | 80 | bool repeatOnWeekDay( int day )const; |
79 | 81 | ||
80 | /** | 82 | /** |
81 | * FromWhereToStart is not included!!! | 83 | * FromWhereToStart is not included!!! |
82 | */ | 84 | */ |
83 | bool nextOcurrence( const QDate& FromWhereToStart, QDate &recurDate ); | 85 | bool nextOcurrence( const QDate& FromWhereToStart, QDate &recurDate ); |
84 | 86 | ||
85 | /** | 87 | /** |
86 | * The module this ORecur belongs to | 88 | * The module this ORecur belongs to |
87 | */ | 89 | */ |
88 | QString service()const; | 90 | QString service()const; |
89 | 91 | ||
90 | /* | 92 | /* |
91 | * reference to the exception list | 93 | * reference to the exception list |
92 | */ | 94 | */ |
93 | ExceptionList &exceptions(); | 95 | ExceptionList &exceptions(); |
94 | 96 | ||
95 | /** | 97 | /** |
96 | * the current repetition | 98 | * the current repetition |
97 | */ | 99 | */ |
98 | int repetition()const; | 100 | int repetition()const; |
99 | 101 | ||
100 | void setType( const RepeatType& ); | 102 | void setType( const RepeatType& ); |
101 | void setFrequency( int freq ); | 103 | void setFrequency( int freq ); |
102 | void setPosition( int pos ); | 104 | void setPosition( int pos ); |
103 | void setDays( char c); | 105 | void setDays( char c); |
104 | void setEndDate( const QDate& dt ); | 106 | void setEndDate( const QDate& dt ); |
105 | void setStart( const QDate& dt ); | 107 | void setStart( const QDate& dt ); |
106 | void setCreatedDateTime( const QDateTime& ); | 108 | void setCreatedDateTime( const QDateTime& ); |
107 | void setHasEndDate( bool b ); | 109 | void setHasEndDate( bool b ); |
108 | void setRepitition(int ); | 110 | void setRepitition(int ); |
109 | 111 | ||
110 | void setService( const QString& ser ); | 112 | void setService( const QString& ser ); |
111 | 113 | ||
112 | QMap<int, QString> toMap() const; | 114 | QMap<int, QString> toMap() const; |
113 | void fromMap( const QMap<int, QString>& map ); | 115 | void fromMap( const QMap<int, QString>& map ); |
114 | 116 | ||
115 | /* almost internal */ | 117 | /* almost internal */ |
116 | QString toString()const; | 118 | QString toString()const; |
117 | private: | 119 | |
120 | private: | ||
118 | bool p_nextOccurrence( const QDate& from, QDate& next ); | 121 | bool p_nextOccurrence( const QDate& from, QDate& next ); |
119 | void deref(); | 122 | void deref(); |
120 | inline void checkOrModify(); | 123 | inline void checkOrModify(); |
121 | 124 | ||
122 | /* Converts rType to String */ | 125 | /* Converts rType to String */ |
123 | QString rTypeString() const; | 126 | QString rTypeString() const; |
124 | /* Returns a map to convert Stringname for RType to RepeatType */ | 127 | /* Returns a map to convert Stringname for RType to RepeatType */ |
125 | QMap<QString, RepeatType> rTypeValueConvertMap() const; | 128 | QMap<QString, RepeatType> rTypeValueConvertMap() const; |
126 | 129 | ||
127 | class Data; | 130 | class Data; |
128 | Data* data; | 131 | Data* data; |
129 | class ORecurPrivate; | 132 | class ORecurPrivate; |
130 | ORecurPrivate *d; | 133 | ORecurPrivate *d; |
131 | }; | 134 | }; |
132 | 135 | ||
133 | } | 136 | } |
134 | #endif | 137 | #endif |