Diffstat (limited to 'libopie2/opiepim/core/opimrecord.h') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/opimrecord.h | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/libopie2/opiepim/core/opimrecord.h b/libopie2/opiepim/core/opimrecord.h index 3d774e2..63a3a98 100644 --- a/libopie2/opiepim/core/opimrecord.h +++ b/libopie2/opiepim/core/opimrecord.h | |||
@@ -1,41 +1,70 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
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 | */ | ||
1 | #ifndef OPIE_PIM_RECORD_H | 29 | #ifndef OPIE_PIM_RECORD_H |
2 | #define OPIE_PIM_RECORD_H | 30 | #define OPIE_PIM_RECORD_H |
3 | 31 | ||
4 | #include <qdatastream.h> | 32 | #include <qdatastream.h> |
5 | #include <qmap.h> | 33 | #include <qmap.h> |
6 | #include <qstring.h> | 34 | #include <qstring.h> |
7 | #include <qstringlist.h> | 35 | #include <qstringlist.h> |
8 | 36 | ||
9 | /* | 37 | /* |
10 | * we need to get customMap which is private... | 38 | * we need to get customMap which is private... |
11 | */ | 39 | */ |
12 | #define private protected | 40 | #define private protected |
13 | #include <qpe/palmtoprecord.h> | 41 | #include <qpe/palmtoprecord.h> |
14 | #undef private | 42 | #undef private |
15 | 43 | ||
16 | #include <opie/opimxrefmanager.h> | 44 | #include <opie2/opimxrefmanager.h> |
17 | 45 | ||
46 | namespace Opie { | ||
18 | /** | 47 | /** |
19 | * This is the base class for | 48 | * This is the base class for |
20 | * all PIM Records | 49 | * all PIM Records |
21 | * | 50 | * |
22 | */ | 51 | */ |
23 | class OPimRecord : public Qtopia::Record { | 52 | class OPimRecord : public Qtopia::Record { |
24 | public: | 53 | public: |
25 | /** | 54 | /** |
26 | * c'tor | 55 | * c'tor |
27 | * uid of 0 isEmpty | 56 | * uid of 0 isEmpty |
28 | * uid of 1 will be assigned a new one | 57 | * uid of 1 will be assigned a new one |
29 | */ | 58 | */ |
30 | OPimRecord(int uid = 0); | 59 | OPimRecord(int uid = 0); |
31 | ~OPimRecord(); | 60 | ~OPimRecord(); |
32 | 61 | ||
33 | /** | 62 | /** |
34 | * copy c'tor | 63 | * copy c'tor |
35 | */ | 64 | */ |
36 | OPimRecord( const OPimRecord& rec ); | 65 | OPimRecord( const OPimRecord& rec ); |
37 | 66 | ||
38 | /** | 67 | /** |
39 | * copy operator | 68 | * copy operator |
40 | */ | 69 | */ |
41 | OPimRecord &operator=( const OPimRecord& ); | 70 | OPimRecord &operator=( const OPimRecord& ); |
@@ -132,27 +161,27 @@ public: | |||
132 | * saves the OPimRecord | 161 | * saves the OPimRecord |
133 | * to and from a DataStream | 162 | * to and from a DataStream |
134 | */ | 163 | */ |
135 | virtual bool loadFromStream(QDataStream& ); | 164 | virtual bool loadFromStream(QDataStream& ); |
136 | virtual bool saveToStream( QDataStream& stream )const; | 165 | virtual bool saveToStream( QDataStream& stream )const; |
137 | 166 | ||
138 | protected: | 167 | protected: |
139 | // need to be const cause it is called from const methods | 168 | // need to be const cause it is called from const methods |
140 | mutable int m_lastHit; | 169 | mutable int m_lastHit; |
141 | void setLastHitField( int lastHit )const; | 170 | void setLastHitField( int lastHit )const; |
142 | Qtopia::UidGen &uidGen(); | 171 | Qtopia::UidGen &uidGen(); |
143 | // QString crossToString()const; | 172 | // QString crossToString()const; |
144 | 173 | ||
145 | private: | 174 | private: |
146 | class OPimRecordPrivate; | 175 | class OPimRecordPrivate; |
147 | OPimRecordPrivate *d; | 176 | OPimRecordPrivate *d; |
148 | OPimXRefManager m_xrefman; | 177 | OPimXRefManager m_xrefman; |
149 | static Qtopia::UidGen m_uidGen; | 178 | static Qtopia::UidGen m_uidGen; |
150 | 179 | ||
151 | private: | 180 | private: |
152 | void flush( const OPimXRefPartner&, QDataStream& stream )const; | 181 | void flush( const OPimXRefPartner&, QDataStream& stream )const; |
153 | OPimXRefPartner partner( QDataStream& ); | 182 | OPimXRefPartner partner( QDataStream& ); |
154 | }; | 183 | }; |
155 | 184 | ||
156 | 185 | } | |
157 | 186 | ||
158 | #endif | 187 | #endif |