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/ocontact.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.
-rw-r--r-- | libopie2/opiepim/ocontact.h | 51 |
1 files changed, 31 insertions, 20 deletions
diff --git a/libopie2/opiepim/ocontact.h b/libopie2/opiepim/ocontact.h index 1d46b81..34888dc 100644 --- a/libopie2/opiepim/ocontact.h +++ b/libopie2/opiepim/ocontact.h | |||
@@ -1,82 +1,92 @@ | |||
1 | /********************************************************************** | 1 | /* |
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | 2 | This file is part of the Opie Project |
3 | ** Copyright (C) 2002-2003 by Stefan Eilers (eilers.stefan@epost.de) | 3 | Copyright (C) The Main Author <main-author@whereever.org> |
4 | ** | 4 | =. Copyright (C) The Opie Team <opie-devel@handhelds.org> |
5 | ** This file may be distributed and/or modified under the terms of the | 5 | .=l. |
6 | ** GNU General Public License version 2 as published by the Free Software | 6 | .>+-= |
7 | ** Foundation and appearing in the file LICENSE.GPL included in the | 7 | _;:, .> :=|. This program is free software; you can |
8 | ** packaging of this file. | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | ** | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
10 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ** | 12 | ._= =} : or (at your option) any later version. |
13 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 13 | .%`+i> _;_. |
14 | ** | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | ** Contact info@trolltech.com if any conditions of this licensing are | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | ** not clear to you. | 16 | : .. .:, . . . without even the implied warranty of |
17 | ** | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | **********************************************************************/ | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | 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 | */ | ||
20 | #ifndef __OCONTACT_H__ | 29 | #ifndef __OCONTACT_H__ |
21 | #define __OCONTACT_H__ | 30 | #define __OCONTACT_H__ |
22 | 31 | ||
23 | #include <opie/opimrecord.h> | 32 | #include <opie2/opimrecord.h> |
24 | #include <qpe/recordfields.h> | 33 | #include <qpe/recordfields.h> |
25 | 34 | ||
26 | #include <qdatetime.h> | 35 | #include <qdatetime.h> |
27 | #include <qstringlist.h> | 36 | #include <qstringlist.h> |
28 | 37 | ||
29 | #if defined(QPC_TEMPLATEDLL) | 38 | #if defined(QPC_TEMPLATEDLL) |
30 | // MOC_SKIP_BEGIN | 39 | // MOC_SKIP_BEGIN |
31 | QPC_TEMPLATEEXTERN template class QPC_EXPORT QMap<int, QString>; | 40 | QPC_TEMPLATEEXTERN template class QPC_EXPORT QMap<int, QString>; |
32 | // MOC_SKIP_END | 41 | // MOC_SKIP_END |
33 | #endif | 42 | #endif |
34 | 43 | ||
44 | namespace Opie { | ||
35 | class OContactPrivate; | 45 | class OContactPrivate; |
36 | 46 | ||
37 | /** | 47 | /** |
38 | * OContact class represents a specialised PIM Record for contacts. | 48 | * OContact class represents a specialised PIM Record for contacts. |
39 | * It does store all kind of persopn related information. | 49 | * It does store all kind of persopn related information. |
40 | * | 50 | * |
41 | * @short Contact Container | 51 | * @short Contact Container |
42 | * @author TT, Stefan Eiler, Holger Freyther | 52 | * @author TT, Stefan Eiler, Holger Freyther |
43 | */ | 53 | */ |
44 | class QPC_EXPORT OContact : public OPimRecord | 54 | class QPC_EXPORT OContact : public OPimRecord |
45 | { | 55 | { |
46 | friend class DataSet; | 56 | friend class DataSet; |
47 | public: | 57 | public: |
48 | OContact(); | 58 | OContact(); |
49 | OContact( const QMap<int, QString> &fromMap ); | 59 | OContact( const QMap<int, QString> &fromMap ); |
50 | virtual ~OContact(); | 60 | virtual ~OContact(); |
51 | 61 | ||
52 | enum DateFormat{ | 62 | enum DateFormat{ |
53 | Zip_City_State = 0, | 63 | Zip_City_State = 0, |
54 | City_State_Zip | 64 | City_State_Zip |
55 | }; | 65 | }; |
56 | 66 | ||
57 | /* | 67 | /* |
58 | * do we need to inline them | 68 | * do we need to inline them |
59 | * if yes do we need to inline them this way? | 69 | * if yes do we need to inline them this way? |
60 | * -zecke | 70 | * -zecke |
61 | */ | 71 | */ |
62 | void setTitle( const QString &v ) { replace( Qtopia::Title, v ); } | 72 | void setTitle( const QString &v ) { replace( Qtopia::Title, v ); } |
63 | void setFirstName( const QString &v ) { replace( Qtopia::FirstName, v ); } | 73 | void setFirstName( const QString &v ) { replace( Qtopia::FirstName, v ); } |
64 | void setMiddleName( const QString &v ) { replace( Qtopia::MiddleName, v ); } | 74 | void setMiddleName( const QString &v ) { replace( Qtopia::MiddleName, v ); } |
65 | void setLastName( const QString &v ) { replace( Qtopia::LastName, v ); } | 75 | void setLastName( const QString &v ) { replace( Qtopia::LastName, v ); } |
66 | void setSuffix( const QString &v ) { replace( Qtopia::Suffix, v ); } | 76 | void setSuffix( const QString &v ) { replace( Qtopia::Suffix, v ); } |
67 | void setFileAs( const QString &v ) { replace( Qtopia::FileAs, v ); } | 77 | void setFileAs( const QString &v ) { replace( Qtopia::FileAs, v ); } |
68 | void setFileAs(); | 78 | void setFileAs(); |
69 | 79 | ||
70 | // default email address | 80 | // default email address |
71 | void setDefaultEmail( const QString &v ); | 81 | void setDefaultEmail( const QString &v ); |
72 | // inserts email to list and ensure's doesn't already exist | 82 | // inserts email to list and ensure's doesn't already exist |
73 | void insertEmail( const QString &v ); | 83 | void insertEmail( const QString &v ); |
74 | void removeEmail( const QString &v ); | 84 | void removeEmail( const QString &v ); |
75 | void clearEmails(); | 85 | void clearEmails(); |
76 | void insertEmails( const QStringList &v ); | 86 | void insertEmails( const QStringList &v ); |
77 | 87 | ||
78 | // home | 88 | // home |
79 | void setHomeStreet( const QString &v ) { replace( Qtopia::HomeStreet, v ); } | 89 | void setHomeStreet( const QString &v ) { replace( Qtopia::HomeStreet, v ); } |
80 | void setHomeCity( const QString &v ) { replace( Qtopia::HomeCity, v ); } | 90 | void setHomeCity( const QString &v ) { replace( Qtopia::HomeCity, v ); } |
81 | void setHomeState( const QString &v ) { replace( Qtopia::HomeState, v ); } | 91 | void setHomeState( const QString &v ) { replace( Qtopia::HomeState, v ); } |
82 | void setHomeZip( const QString &v ) { replace( Qtopia::HomeZip, v ); } | 92 | void setHomeZip( const QString &v ) { replace( Qtopia::HomeZip, v ); } |
@@ -191,50 +201,51 @@ public: | |||
191 | QString children() const { return find( Qtopia::Children ); } | 201 | QString children() const { return find( Qtopia::Children ); } |
192 | QStringList childrenList() const; | 202 | QStringList childrenList() const; |
193 | 203 | ||
194 | // other | 204 | // other |
195 | QString notes() const { return find( Qtopia::Notes ); } | 205 | QString notes() const { return find( Qtopia::Notes ); } |
196 | QString groups() const { return find( Qtopia::Groups ); } | 206 | QString groups() const { return find( Qtopia::Groups ); } |
197 | QStringList groupList() const; | 207 | QStringList groupList() const; |
198 | 208 | ||
199 | QString toRichText() const; | 209 | QString toRichText() const; |
200 | QMap<int, QString> toMap() const; | 210 | QMap<int, QString> toMap() const; |
201 | QString field( int key ) const { return find( key ); } | 211 | QString field( int key ) const { return find( key ); } |
202 | 212 | ||
203 | 213 | ||
204 | void setUid( int i ); | 214 | void setUid( int i ); |
205 | 215 | ||
206 | QString toShortText()const; | 216 | QString toShortText()const; |
207 | QString type()const; | 217 | QString type()const; |
208 | class QString recordField(int) const; | 218 | class QString recordField(int) const; |
209 | 219 | ||
210 | // Why private ? (eilers,se) | 220 | // Why private ? (eilers,se) |
211 | QString emailSeparator() const { return " "; } | 221 | QString emailSeparator() const { return " "; } |
212 | 222 | ||
213 | // the emails should be seperated by a comma | 223 | // the emails should be seperated by a comma |
214 | void setEmails( const QString &v ); | 224 | void setEmails( const QString &v ); |
215 | QString emails() const { return find( Qtopia::Emails ); } | 225 | QString emails() const { return find( Qtopia::Emails ); } |
216 | static int rtti(); | 226 | static int rtti(); |
217 | 227 | ||
218 | private: | 228 | private: |
219 | // The XML Backend needs some access to the private functions | 229 | // The XML Backend needs some access to the private functions |
220 | friend class OContactAccessBackend_XML; | 230 | friend class OContactAccessBackend_XML; |
221 | 231 | ||
222 | void insert( int key, const QString &value ); | 232 | void insert( int key, const QString &value ); |
223 | void replace( int key, const QString &value ); | 233 | void replace( int key, const QString &value ); |
224 | QString find( int key ) const; | 234 | QString find( int key ) const; |
225 | static QStringList fields(); | 235 | static QStringList fields(); |
226 | 236 | ||
227 | void save( QString &buf ) const; | 237 | void save( QString &buf ) const; |
228 | 238 | ||
229 | QString displayAddress( const QString &street, | 239 | QString displayAddress( const QString &street, |
230 | const QString &city, | 240 | const QString &city, |
231 | const QString &state, | 241 | const QString &state, |
232 | const QString &zip, | 242 | const QString &zip, |
233 | const QString &country ) const; | 243 | const QString &country ) const; |
234 | 244 | ||
235 | QMap<int, QString> mMap; | 245 | QMap<int, QString> mMap; |
236 | OContactPrivate *d; | 246 | OContactPrivate *d; |
237 | }; | 247 | }; |
238 | 248 | ||
249 | } | ||
239 | 250 | ||
240 | #endif | 251 | #endif |