summaryrefslogtreecommitdiffabout
path: root/kabc/addressee.h
Unidiff
Diffstat (limited to 'kabc/addressee.h') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addressee.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/kabc/addressee.h b/kabc/addressee.h
index 27782f9..f098371 100644
--- a/kabc/addressee.h
+++ b/kabc/addressee.h
@@ -1,227 +1,236 @@
1/*** Warning! This file has been generated by the script makeaddressee ***/ 1/*** Warning! This file has been generated by the script makeaddressee ***/
2/* 2/*
3 This file is part of libkabc. 3 This file is part of libkabc.
4 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 4 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
5 5
6 This library is free software; you can redistribute it and/or 6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public 7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either 8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version. 9 version 2 of the License, or (at your option) any later version.
10 10
11 This library is distributed in the hope that it will be useful, 11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details. 14 Library General Public License for more details.
15 15
16 You should have received a copy of the GNU Library General Public License 16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to 17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22/* 22/*
23Enhanced Version of the file for platform independent KDE tools. 23Enhanced Version of the file for platform independent KDE tools.
24Copyright (c) 2004 Ulf Schenk 24Copyright (c) 2004 Ulf Schenk
25 25
26$Id$ 26$Id$
27*/ 27*/
28 28
29#ifndef KABC_ADDRESSEE_H 29#ifndef KABC_ADDRESSEE_H
30#define KABC_ADDRESSEE_H 30#define KABC_ADDRESSEE_H
31 31
32#include <qdatetime.h> 32#include <qdatetime.h>
33#include <qstring.h> 33#include <qstring.h>
34#include <qstringlist.h> 34#include <qstringlist.h>
35#include <qvaluelist.h> 35#include <qvaluelist.h>
36 36
37#include <ksharedptr.h> 37#include <ksharedptr.h>
38#include <kurl.h> 38#include <kurl.h>
39 39
40#include "address.h" 40#include "address.h"
41#include "agent.h" 41#include "agent.h"
42#include "geo.h" 42#include "geo.h"
43#include "key.h" 43#include "key.h"
44#include "phonenumber.h" 44#include "phonenumber.h"
45#include "picture.h" 45#include "picture.h"
46#include "secrecy.h" 46#include "secrecy.h"
47#include "sound.h" 47#include "sound.h"
48#include "timezone.h" 48#include "timezone.h"
49 49
50namespace KABC { 50namespace KABC {
51 51
52class Resource; 52class Resource;
53 53
54/** 54/**
55 @short address book entry 55 @short address book entry
56 56
57 This class represents an entry in the address book. 57 This class represents an entry in the address book.
58 58
59 The data of this class is implicitly shared. You can pass this class by value. 59 The data of this class is implicitly shared. You can pass this class by value.
60 60
61 If you need the name of a field for presenting it to the user you should use 61 If you need the name of a field for presenting it to the user you should use
62 the functions ending in Label(). They return a translated string which can be 62 the functions ending in Label(). They return a translated string which can be
63 used as label for the corresponding field. 63 used as label for the corresponding field.
64 64
65 About the name fields: 65 About the name fields:
66 66
67 givenName() is the first name and familyName() the last name. In some 67 givenName() is the first name and familyName() the last name. In some
68 countries the family name comes first, that's the reason for the 68 countries the family name comes first, that's the reason for the
69 naming. formattedName() is the full name with the correct formatting. 69 naming. formattedName() is the full name with the correct formatting.
70 It is used as an override, when the correct formatting can't be generated 70 It is used as an override, when the correct formatting can't be generated
71 from the other name fields automatically. 71 from the other name fields automatically.
72 72
73 realName() returns a fully formatted name(). It uses formattedName, if set, 73 realName() returns a fully formatted name(). It uses formattedName, if set,
74 otherwise it constucts the name from the name fields. As fallback, if 74 otherwise it constucts the name from the name fields. As fallback, if
75 nothing else is set it uses name(). 75 nothing else is set it uses name().
76 76
77 name() is the NAME type of RFC2426. It can be used as internal name for the 77 name() is the NAME type of RFC2426. It can be used as internal name for the
78 data enty, but shouldn't be used for displaying the data to the user. 78 data enty, but shouldn't be used for displaying the data to the user.
79 */ 79 */
80class Addressee 80class Addressee
81{ 81{
82 friend QDataStream &operator<<( QDataStream &, const Addressee & ); 82 friend QDataStream &operator<<( QDataStream &, const Addressee & );
83 friend QDataStream &operator>>( QDataStream &, Addressee & ); 83 friend QDataStream &operator>>( QDataStream &, Addressee & );
84 84
85 public: 85 public:
86 typedef QValueList<Addressee> List; 86 typedef QValueList<Addressee> List;
87 87
88 /** 88 /**
89 Construct an empty address book entry. 89 Construct an empty address book entry.
90 */ 90 */
91 Addressee(); 91 Addressee();
92 ~Addressee(); 92 ~Addressee();
93 93
94 Addressee( const Addressee & ); 94 Addressee( const Addressee & );
95 Addressee &operator=( const Addressee & ); 95 Addressee &operator=( const Addressee & );
96 96
97 bool operator==( const Addressee & ) const; 97 bool operator==( const Addressee & ) const;
98 bool operator!=( const Addressee & ) const; 98 bool operator!=( const Addressee & ) const;
99 99 // sync stuff
100 void setTempSyncStat(int id);
101 int tempSyncStat() const;
102 void setIDStr( const QString & );
103 QString IDStr() const;
104 void setID( const QString &, const QString & );
105 QString getID( const QString & );
106 void setCsum( const QString &, const QString & );
107 QString getCsum( const QString & );
108 void removeID(const QString &);
100 /** 109 /**
101 Return, if the address book entry is empty. 110 Return, if the address book entry is empty.
102 */ 111 */
103 bool isEmpty() const; 112 bool isEmpty() const;
104 113
105 /** 114 /**
106 Set unique identifier. 115 Set unique identifier.
107 */ 116 */
108 void setUid( const QString &uid ); 117 void setUid( const QString &uid );
109 /** 118 /**
110 Return unique identifier. 119 Return unique identifier.
111 */ 120 */
112 QString uid() const; 121 QString uid() const;
113 /** 122 /**
114 Return translated label for uid field. 123 Return translated label for uid field.
115 */ 124 */
116 static QString uidLabel(); 125 static QString uidLabel();
117 126
118 /** 127 /**
119 Set name. 128 Set name.
120 */ 129 */
121 void setName( const QString &name ); 130 void setName( const QString &name );
122 /** 131 /**
123 Return name. 132 Return name.
124 */ 133 */
125 QString name() const; 134 QString name() const;
126 /** 135 /**
127 Return translated label for name field. 136 Return translated label for name field.
128 */ 137 */
129 static QString nameLabel(); 138 static QString nameLabel();
130 139
131 /** 140 /**
132 Set formatted name. 141 Set formatted name.
133 */ 142 */
134 void setFormattedName( const QString &formattedName ); 143 void setFormattedName( const QString &formattedName );
135 /** 144 /**
136 Return formatted name. 145 Return formatted name.
137 */ 146 */
138 QString formattedName() const; 147 QString formattedName() const;
139 /** 148 /**
140 Return translated label for formattedName field. 149 Return translated label for formattedName field.
141 */ 150 */
142 static QString formattedNameLabel(); 151 static QString formattedNameLabel();
143 152
144 /** 153 /**
145 Set family name. 154 Set family name.
146 */ 155 */
147 void setFamilyName( const QString &familyName ); 156 void setFamilyName( const QString &familyName );
148 /** 157 /**
149 Return family name. 158 Return family name.
150 */ 159 */
151 QString familyName() const; 160 QString familyName() const;
152 /** 161 /**
153 Return translated label for familyName field. 162 Return translated label for familyName field.
154 */ 163 */
155 static QString familyNameLabel(); 164 static QString familyNameLabel();
156 165
157 /** 166 /**
158 Set given name. 167 Set given name.
159 */ 168 */
160 void setGivenName( const QString &givenName ); 169 void setGivenName( const QString &givenName );
161 /** 170 /**
162 Return given name. 171 Return given name.
163 */ 172 */
164 QString givenName() const; 173 QString givenName() const;
165 /** 174 /**
166 Return translated label for givenName field. 175 Return translated label for givenName field.
167 */ 176 */
168 static QString givenNameLabel(); 177 static QString givenNameLabel();
169 178
170 /** 179 /**
171 Set additional names. 180 Set additional names.
172 */ 181 */
173 void setAdditionalName( const QString &additionalName ); 182 void setAdditionalName( const QString &additionalName );
174 /** 183 /**
175 Return additional names. 184 Return additional names.
176 */ 185 */
177 QString additionalName() const; 186 QString additionalName() const;
178 /** 187 /**
179 Return translated label for additionalName field. 188 Return translated label for additionalName field.
180 */ 189 */
181 static QString additionalNameLabel(); 190 static QString additionalNameLabel();
182 191
183 /** 192 /**
184 Set honorific prefixes. 193 Set honorific prefixes.
185 */ 194 */
186 void setPrefix( const QString &prefix ); 195 void setPrefix( const QString &prefix );
187 /** 196 /**
188 Return honorific prefixes. 197 Return honorific prefixes.
189 */ 198 */
190 QString prefix() const; 199 QString prefix() const;
191 /** 200 /**
192 Return translated label for prefix field. 201 Return translated label for prefix field.
193 */ 202 */
194 static QString prefixLabel(); 203 static QString prefixLabel();
195 204
196 /** 205 /**
197 Set honorific suffixes. 206 Set honorific suffixes.
198 */ 207 */
199 void setSuffix( const QString &suffix ); 208 void setSuffix( const QString &suffix );
200 /** 209 /**
201 Return honorific suffixes. 210 Return honorific suffixes.
202 */ 211 */
203 QString suffix() const; 212 QString suffix() const;
204 /** 213 /**
205 Return translated label for suffix field. 214 Return translated label for suffix field.
206 */ 215 */
207 static QString suffixLabel(); 216 static QString suffixLabel();
208 217
209 /** 218 /**
210 Set nick name. 219 Set nick name.
211 */ 220 */
212 void setNickName( const QString &nickName ); 221 void setNickName( const QString &nickName );
213 /** 222 /**
214 Return nick name. 223 Return nick name.
215 */ 224 */
216 QString nickName() const; 225 QString nickName() const;
217 /** 226 /**
218 Return translated label for nickName field. 227 Return translated label for nickName field.
219 */ 228 */
220 static QString nickNameLabel(); 229 static QString nickNameLabel();
221 230
222 /** 231 /**
223 Set birthday. 232 Set birthday.
224 */ 233 */
225 void setBirthday( const QDateTime &birthday ); 234 void setBirthday( const QDateTime &birthday );
226 /** 235 /**
227 Return birthday. 236 Return birthday.
@@ -690,139 +699,140 @@ class Addressee
690 in this addressee it is not duplicated. 699 in this addressee it is not duplicated.
691 */ 700 */
692 void insertAddress( const Address &address ); 701 void insertAddress( const Address &address );
693 702
694 /** 703 /**
695 Remove address. If no address with the given id exists for this 704 Remove address. If no address with the given id exists for this
696 addresse nothing happens. 705 addresse nothing happens.
697 */ 706 */
698 void removeAddress( const Address &address ); 707 void removeAddress( const Address &address );
699 708
700 /** 709 /**
701 Return address, which matches the given type. 710 Return address, which matches the given type.
702 */ 711 */
703 Address address( int type ) const; 712 Address address( int type ) const;
704 713
705 /** 714 /**
706 Return list of all addresses. 715 Return list of all addresses.
707 */ 716 */
708 Address::List addresses() const; 717 Address::List addresses() const;
709 718
710 /** 719 /**
711 Return list of addresses with a special type. 720 Return list of addresses with a special type.
712 */ 721 */
713 Address::List addresses( int type ) const; 722 Address::List addresses( int type ) const;
714 723
715 /** 724 /**
716 Return address with the given id. 725 Return address with the given id.
717 */ 726 */
718 Address findAddress( const QString &id ) const; 727 Address findAddress( const QString &id ) const;
719 728
720 /** 729 /**
721 Insert category. If the category already exists it is not duplicated. 730 Insert category. If the category already exists it is not duplicated.
722 */ 731 */
723 void insertCategory( const QString & ); 732 void insertCategory( const QString & );
724 733
725 /** 734 /**
726 Remove category. 735 Remove category.
727 */ 736 */
728 void removeCategory( const QString & ); 737 void removeCategory( const QString & );
729 738
730 /** 739 /**
731 Return, if addressee has the given category. 740 Return, if addressee has the given category.
732 */ 741 */
733 bool hasCategory( const QString & ) const; 742 bool hasCategory( const QString & ) const;
734 743
735 /** 744 /**
736 Set categories to given value. 745 Set categories to given value.
737 */ 746 */
738 void setCategories( const QStringList & ); 747 void setCategories( const QStringList & );
739 748
740 /** 749 /**
741 Return list of all set categories. 750 Return list of all set categories.
742 */ 751 */
743 QStringList categories() const; 752 QStringList categories() const;
744 753
745 /** 754 /**
746 Insert custom entry. The entry is identified by the name of the inserting 755 Insert custom entry. The entry is identified by the name of the inserting
747 application and a unique name. If an entry with the given app and name 756 application and a unique name. If an entry with the given app and name
748 already exists its value is replaced with the new given value. 757 already exists its value is replaced with the new given value.
749 */ 758 */
750 void insertCustom( const QString &app, const QString &name, 759 void insertCustom( const QString &app, const QString &name,
751 const QString &value ); 760 const QString &value );
752 761
753 /** 762 /**
754 Remove custom entry. 763 Remove custom entry.
755 */ 764 */
756 void removeCustom( const QString &app, const QString &name ); 765 void removeCustom( const QString &app, const QString &name );
757 766
758 /** 767 /**
759 Return value of custom entry, identified by app and entry name. 768 Return value of custom entry, identified by app and entry name.
760 */ 769 */
761 QString custom( const QString &app, const QString &name ) const; 770 QString custom( const QString &app, const QString &name ) const;
762 771
763 /** 772 /**
764 Set all custom entries. 773 Set all custom entries.
765 */ 774 */
766 void setCustoms( const QStringList & ); 775 void setCustoms( const QStringList & );
767 776
768 /** 777 /**
769 Return list of all custom entries. 778 Return list of all custom entries.
770 */ 779 */
771 QStringList customs() const; 780 QStringList customs() const;
772 781
773 /** 782 /**
774 Parse full email address. The result is given back in fullName and email. 783 Parse full email address. The result is given back in fullName and email.
775 */ 784 */
776 static void parseEmailAddress( const QString &rawEmail, QString &fullName, 785 static void parseEmailAddress( const QString &rawEmail, QString &fullName,
777 QString &email ); 786 QString &email );
778 787
779 /** 788 /**
780 Debug output. 789 Debug output.
781 */ 790 */
782 void dump() const; 791 void dump() const;
783 792
784 /** 793 /**
785 Returns string representation of the addressee. 794 Returns string representation of the addressee.
786 */ 795 */
787 QString asString() const; 796 QString asString() const;
788 797
789 /** 798 /**
790 Set resource where the addressee is from. 799 Set resource where the addressee is from.
791 */ 800 */
792 void setResource( Resource *resource ); 801 void setResource( Resource *resource );
793 802
794 /** 803 /**
795 Return pointer to resource. 804 Return pointer to resource.
796 */ 805 */
797 Resource *resource() const; 806 Resource *resource() const;
798 807
799 /** 808 /**
800 Return resourcelabel. 809 Return resourcelabel.
801 */ 810 */
802 //US 811 //US
803 static QString resourceLabel(); 812 static QString resourceLabel();
804 813
805 /** 814 /**
806 Mark addressee as changed. 815 Mark addressee as changed.
807 */ 816 */
808 void setChanged( bool value ); 817 void setChanged( bool value );
809 818
810 /** 819 /**
811 Return whether the addressee is changed. 820 Return whether the addressee is changed.
812 */ 821 */
813 bool changed() const; 822 bool changed() const;
814 823
815 private: 824 private:
816 Addressee copy(); 825 Addressee copy();
817 void detach(); 826 void detach();
827 int mTempSyncStat;
818 828
819 struct AddresseeData; 829 struct AddresseeData;
820 mutable KSharedPtr<AddresseeData> mData; 830 mutable KSharedPtr<AddresseeData> mData;
821}; 831};
822 832
823QDataStream &operator<<( QDataStream &, const Addressee & ); 833QDataStream &operator<<( QDataStream &, const Addressee & );
824QDataStream &operator>>( QDataStream &, Addressee & ); 834QDataStream &operator>>( QDataStream &, Addressee & );
825 835
826} 836}
827 837
828#endif 838#endif