-rw-r--r-- | kabc/address.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kabc/address.h b/kabc/address.h index 6b53c7e..37dd851 100644 --- a/kabc/address.h +++ b/kabc/address.h | |||
@@ -1,160 +1,161 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libkabc. | 2 | This file is part of libkabc. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public |
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. |
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /* | 21 | /* |
22 | Enhanced Version of the file for platform independent KDE tools. | 22 | Enhanced Version of the file for platform independent KDE tools. |
23 | Copyright (c) 2004 Ulf Schenk | 23 | Copyright (c) 2004 Ulf Schenk |
24 | 24 | ||
25 | $Id$ | 25 | $Id$ |
26 | */ | 26 | */ |
27 | 27 | ||
28 | #ifndef KABC_ADDRESS_H | 28 | #ifndef KABC_ADDRESS_H |
29 | #define KABC_ADDRESS_H | 29 | #define KABC_ADDRESS_H |
30 | 30 | ||
31 | #include <qmap.h> | 31 | #include <qmap.h> |
32 | #include <qstring.h> | 32 | #include <qstring.h> |
33 | #include <qstringlist.h> | ||
33 | #include <qvaluelist.h> | 34 | #include <qvaluelist.h> |
34 | 35 | ||
35 | // template tags for address formatting localization | 36 | // template tags for address formatting localization |
36 | #define KABC_FMTTAG_realname QString("%n") | 37 | #define KABC_FMTTAG_realname QString("%n") |
37 | #define KABC_FMTTAG_REALNAME QString("%N") | 38 | #define KABC_FMTTAG_REALNAME QString("%N") |
38 | #define KABC_FMTTAG_company QString("%cm") | 39 | #define KABC_FMTTAG_company QString("%cm") |
39 | #define KABC_FMTTAG_COMPANY QString("%CM") | 40 | #define KABC_FMTTAG_COMPANY QString("%CM") |
40 | #define KABC_FMTTAG_pobox QString("%p") | 41 | #define KABC_FMTTAG_pobox QString("%p") |
41 | #define KABC_FMTTAG_street QString("%s") | 42 | #define KABC_FMTTAG_street QString("%s") |
42 | #define KABC_FMTTAG_STREET QString("%S") | 43 | #define KABC_FMTTAG_STREET QString("%S") |
43 | #define KABC_FMTTAG_zipcode QString("%z") | 44 | #define KABC_FMTTAG_zipcode QString("%z") |
44 | #define KABC_FMTTAG_location QString("%l") | 45 | #define KABC_FMTTAG_location QString("%l") |
45 | #define KABC_FMTTAG_LOCATION QString("%L") | 46 | #define KABC_FMTTAG_LOCATION QString("%L") |
46 | #define KABC_FMTTAG_region QString("%r") | 47 | #define KABC_FMTTAG_region QString("%r") |
47 | #define KABC_FMTTAG_REGION QString("%R") | 48 | #define KABC_FMTTAG_REGION QString("%R") |
48 | #define KABC_FMTTAG_newline QString("\\n") | 49 | #define KABC_FMTTAG_newline QString("\\n") |
49 | #define KABC_FMTTAG_condcomma QString("%,") | 50 | #define KABC_FMTTAG_condcomma QString("%,") |
50 | #define KABC_FMTTAG_condwhite QString("%w") | 51 | #define KABC_FMTTAG_condwhite QString("%w") |
51 | #define KABC_FMTTAG_purgeempty QString("%0") | 52 | #define KABC_FMTTAG_purgeempty QString("%0") |
52 | 53 | ||
53 | namespace KABC { | 54 | namespace KABC { |
54 | 55 | ||
55 | /** | 56 | /** |
56 | @short Postal address information. | 57 | @short Postal address information. |
57 | 58 | ||
58 | This class represents information about a postal address. | 59 | This class represents information about a postal address. |
59 | */ | 60 | */ |
60 | class Address | 61 | class Address |
61 | { | 62 | { |
62 | friend QDataStream &operator<<( QDataStream &, const Address & ); | 63 | friend QDataStream &operator<<( QDataStream &, const Address & ); |
63 | friend QDataStream &operator>>( QDataStream &, Address & ); | 64 | friend QDataStream &operator>>( QDataStream &, Address & ); |
64 | 65 | ||
65 | public: | 66 | public: |
66 | /** | 67 | /** |
67 | List of addresses. | 68 | List of addresses. |
68 | */ | 69 | */ |
69 | typedef QValueList<Address> List; | 70 | typedef QValueList<Address> List; |
70 | typedef QValueList<int> TypeList; | 71 | typedef QValueList<int> TypeList; |
71 | 72 | ||
72 | /** | 73 | /** |
73 | Address types: | 74 | Address types: |
74 | 75 | ||
75 | @li @p Dom - domestic | 76 | @li @p Dom - domestic |
76 | @li @p Intl - international | 77 | @li @p Intl - international |
77 | @li @p Postal - postal | 78 | @li @p Postal - postal |
78 | @li @p Parcel - parcel | 79 | @li @p Parcel - parcel |
79 | @li @p Home - home address | 80 | @li @p Home - home address |
80 | @li @p Work - address at work | 81 | @li @p Work - address at work |
81 | @li @p Pref - preferred address | 82 | @li @p Pref - preferred address |
82 | */ | 83 | */ |
83 | enum Type { Dom = 1, Intl = 2, Postal = 4, Parcel = 8, Home = 16, Work = 32, | 84 | enum Type { Dom = 1, Intl = 2, Postal = 4, Parcel = 8, Home = 16, Work = 32, |
84 | Pref = 64 }; | 85 | Pref = 64 }; |
85 | 86 | ||
86 | /** | 87 | /** |
87 | Constructor that creates an empty Address, which is initialized | 88 | Constructor that creates an empty Address, which is initialized |
88 | with a unique id (see @ref id()). | 89 | with a unique id (see @ref id()). |
89 | */ | 90 | */ |
90 | Address(); | 91 | Address(); |
91 | 92 | ||
92 | /** | 93 | /** |
93 | This is like @ref Address() just above, with the difference | 94 | This is like @ref Address() just above, with the difference |
94 | that you can specify the type. | 95 | that you can specify the type. |
95 | */ | 96 | */ |
96 | Address( int ); | 97 | Address( int ); |
97 | 98 | ||
98 | bool operator==( const Address & ) const; | 99 | bool operator==( const Address & ) const; |
99 | bool operator!=( const Address & ) const; | 100 | bool operator!=( const Address & ) const; |
100 | 101 | ||
101 | /** | 102 | /** |
102 | Returns true, if the address is empty. | 103 | Returns true, if the address is empty. |
103 | */ | 104 | */ |
104 | bool isEmpty() const; | 105 | bool isEmpty() const; |
105 | 106 | ||
106 | /** | 107 | /** |
107 | Clears all entries of the address. | 108 | Clears all entries of the address. |
108 | */ | 109 | */ |
109 | void clear(); | 110 | void clear(); |
110 | QStringList asList(); | 111 | QStringList asList(); |
111 | 112 | ||
112 | /** | 113 | /** |
113 | Sets the unique id. | 114 | Sets the unique id. |
114 | */ | 115 | */ |
115 | void setId( const QString & ); | 116 | void setId( const QString & ); |
116 | 117 | ||
117 | /* | 118 | /* |
118 | Returns the unique id. | 119 | Returns the unique id. |
119 | */ | 120 | */ |
120 | QString id() const; | 121 | QString id() const; |
121 | 122 | ||
122 | /** | 123 | /** |
123 | Sets the type of address. See enum for definiton of types. | 124 | Sets the type of address. See enum for definiton of types. |
124 | 125 | ||
125 | @param type type, can be a bitwise or of multiple types. | 126 | @param type type, can be a bitwise or of multiple types. |
126 | */ | 127 | */ |
127 | void setType( int type ); | 128 | void setType( int type ); |
128 | 129 | ||
129 | /** | 130 | /** |
130 | Returns the type of address. Can be a bitwise or of multiple types. | 131 | Returns the type of address. Can be a bitwise or of multiple types. |
131 | */ | 132 | */ |
132 | int type() const; | 133 | int type() const; |
133 | 134 | ||
134 | /** | 135 | /** |
135 | Returns a translated string of all types the address has. | 136 | Returns a translated string of all types the address has. |
136 | */ | 137 | */ |
137 | QString typeLabel() const; | 138 | QString typeLabel() const; |
138 | 139 | ||
139 | /** | 140 | /** |
140 | Sets the post office box. | 141 | Sets the post office box. |
141 | */ | 142 | */ |
142 | void setPostOfficeBox( const QString & ); | 143 | void setPostOfficeBox( const QString & ); |
143 | 144 | ||
144 | /** | 145 | /** |
145 | Returns the post office box. | 146 | Returns the post office box. |
146 | */ | 147 | */ |
147 | QString postOfficeBox() const; | 148 | QString postOfficeBox() const; |
148 | 149 | ||
149 | /** | 150 | /** |
150 | Returns the translated label for post office box field. | 151 | Returns the translated label for post office box field. |
151 | */ | 152 | */ |
152 | static QString postOfficeBoxLabel(); | 153 | static QString postOfficeBoxLabel(); |
153 | 154 | ||
154 | /** | 155 | /** |
155 | Sets the extended address information. | 156 | Sets the extended address information. |
156 | */ | 157 | */ |
157 | void setExtended( const QString & ); | 158 | void setExtended( const QString & ); |
158 | 159 | ||
159 | /** | 160 | /** |
160 | Returns the extended address information. | 161 | Returns the extended address information. |