Diffstat (limited to 'libopie2/opiepim/backend/opimbackendoccurrence.h') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/opimbackendoccurrence.h | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/libopie2/opiepim/backend/opimbackendoccurrence.h b/libopie2/opiepim/backend/opimbackendoccurrence.h new file mode 100644 index 0000000..08c3cdf --- a/dev/null +++ b/libopie2/opiepim/backend/opimbackendoccurrence.h | |||
@@ -0,0 +1,108 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | Copyright (C) 2004 Holger Hans Peter Freyther <zecke@handhelds.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 | */ | ||
29 | |||
30 | #ifndef OPIE_PIM_BACKEND_OCCURRENCE_H | ||
31 | #define OPIE_PIM_BACKEND_OCCURRENCE_H | ||
32 | |||
33 | #include <opie2/opimglobal.h> | ||
34 | |||
35 | #include <qarray.h> | ||
36 | #include <qdatetime.h> | ||
37 | #include <qvaluelist.h> | ||
38 | |||
39 | namespace Opie { | ||
40 | |||
41 | /** | ||
42 | * \brief Internal representation of an Occurence | ||
43 | * | ||
44 | * This class is used by the Backends to express | ||
45 | * Occurences for the Period Based Query to | ||
46 | * the by the Backend represanted Database. | ||
47 | * In the Frontend this single representation is splitted | ||
48 | * into per day \sa OPimOccurrence 's. | ||
49 | * OPimBackendOccurrence can be understand as a hint to | ||
50 | * the Frontend and must contain the \sa UID, the Start Date | ||
51 | * and End Date of the Occurence. If you have no time associated | ||
52 | * to the datetime use the QDate constructors. | ||
53 | * If OPimRecord::summary() does not describe the Occurrence | ||
54 | * right you can call setSummary() and then the supplied | ||
55 | * summary will be used. | ||
56 | * All Dates and Times are in the local time. | ||
57 | * | ||
58 | * @version 1.0 | ||
59 | * @author Holger Hans Peter Freyther zecke@handhelds.org | ||
60 | */ | ||
61 | class OPimBackendOccurrence { | ||
62 | public: | ||
63 | typedef QValueList<OPimBackendOccurrence> List; | ||
64 | |||
65 | //@{ | ||
66 | OPimBackendOccurrence(); | ||
67 | OPimBackendOccurrence( const QDate& date, | ||
68 | const UID& , const QString& = QString::null ); | ||
69 | OPimBackendOccurrence( const QDate& date, const QDate& end, | ||
70 | const UID& ); | ||
71 | OPimBackendOccurrence( const QDateTime& start, | ||
72 | const QDateTime& end, | ||
73 | const UID& uid ); | ||
74 | //@} | ||
75 | |||
76 | //@{ | ||
77 | QDateTime startDateTime()const; | ||
78 | QDateTime endDateTime()const; | ||
79 | UID uid()const; | ||
80 | bool isAllDay()const; | ||
81 | QString summary()const; | ||
82 | QString location()const; | ||
83 | QString note()const; | ||
84 | //@} | ||
85 | |||
86 | //@{ | ||
87 | void setStartDate( const QDate& ); | ||
88 | void setStartDateTime( const QDateTime& dt ); | ||
89 | void setEndDate( const QDate& ); | ||
90 | void setEndDateTime( const QDateTime& dt ); | ||
91 | void setUid( const UID& ); | ||
92 | void setSummary( const QString& ); | ||
93 | void setLocation( const QString& ); | ||
94 | void setNote( const QString& ); | ||
95 | //@} | ||
96 | |||
97 | private: | ||
98 | QDateTime m_start, m_end; | ||
99 | UID m_uid; | ||
100 | bool m_haveTime : 1; | ||
101 | QString m_summary, m_note, m_location; | ||
102 | |||
103 | struct Private; | ||
104 | Private *d; | ||
105 | }; | ||
106 | } | ||
107 | |||
108 | #endif | ||