-rw-r--r-- | kabc/addressee.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index 39d14bb..7f592e9 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp | |||
@@ -1,181 +1,182 @@ | |||
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 | /* |
23 | Enhanced Version of the file for platform independent KDE tools. | 23 | Enhanced Version of the file for platform independent KDE tools. |
24 | Copyright (c) 2004 Ulf Schenk | 24 | Copyright (c) 2004 Ulf Schenk |
25 | 25 | ||
26 | $Id$ | 26 | $Id$ |
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include <kconfig.h> | 29 | #include <kconfig.h> |
30 | 30 | ||
31 | #include <ksharedptr.h> | 31 | #include <ksharedptr.h> |
32 | #include <kdebug.h> | 32 | #include <kdebug.h> |
33 | #include <kapplication.h> | 33 | #include <kapplication.h> |
34 | #include <klocale.h> | 34 | #include <klocale.h> |
35 | #include <kidmanager.h> | 35 | #include <kidmanager.h> |
36 | //US | 36 | //US |
37 | #include <kstandarddirs.h> | 37 | #include <kstandarddirs.h> |
38 | #include <libkcal/syncdefines.h> | 38 | #include <libkcal/syncdefines.h> |
39 | 39 | ||
40 | //US #include "resource.h" | 40 | //US #include "resource.h" |
41 | #include "addressee.h" | 41 | #include "addressee.h" |
42 | 42 | ||
43 | using namespace KABC; | 43 | using namespace KABC; |
44 | 44 | ||
45 | static bool matchBinaryPattern( int value, int pattern ); | 45 | static bool matchBinaryPattern( int value, int pattern ); |
46 | static bool matchBinaryPatternA( int value, int pattern ); | 46 | static bool matchBinaryPatternA( int value, int pattern ); |
47 | static bool matchBinaryPatternP( int value, int pattern ); | 47 | static bool matchBinaryPatternP( int value, int pattern ); |
48 | 48 | ||
49 | struct Addressee::AddresseeData : public KShared | 49 | struct Addressee::AddresseeData : public KShared |
50 | { | 50 | { |
51 | QString uid; | 51 | QString uid; |
52 | QString name; | 52 | QString name; |
53 | QString formattedName; | 53 | QString formattedName; |
54 | QString defaultFormattedName; | ||
54 | QString familyName; | 55 | QString familyName; |
55 | QString givenName; | 56 | QString givenName; |
56 | QString additionalName; | 57 | QString additionalName; |
57 | QString prefix; | 58 | QString prefix; |
58 | QString suffix; | 59 | QString suffix; |
59 | QString nickName; | 60 | QString nickName; |
60 | QDateTime birthday; | 61 | QDateTime birthday; |
61 | QString mailer; | 62 | QString mailer; |
62 | TimeZone timeZone; | 63 | TimeZone timeZone; |
63 | Geo geo; | 64 | Geo geo; |
64 | QString title; | 65 | QString title; |
65 | QString role; | 66 | QString role; |
66 | QString organization; | 67 | QString organization; |
67 | QString note; | 68 | QString note; |
68 | QString productId; | 69 | QString productId; |
69 | QDateTime revision; | 70 | QDateTime revision; |
70 | QString sortString; | 71 | QString sortString; |
71 | QString externalUID; | 72 | QString externalUID; |
72 | QString originalExternalUID; | 73 | QString originalExternalUID; |
73 | KURL url; | 74 | KURL url; |
74 | Secrecy secrecy; | 75 | Secrecy secrecy; |
75 | Picture logo; | 76 | Picture logo; |
76 | Picture photo; | 77 | Picture photo; |
77 | Sound sound; | 78 | Sound sound; |
78 | Agent agent; | 79 | Agent agent; |
79 | QString mExternalId; | 80 | QString mExternalId; |
80 | PhoneNumber::List phoneNumbers; | 81 | PhoneNumber::List phoneNumbers; |
81 | Address::List addresses; | 82 | Address::List addresses; |
82 | Key::List keys; | 83 | Key::List keys; |
83 | QStringList emails; | 84 | QStringList emails; |
84 | QStringList categories; | 85 | QStringList categories; |
85 | QStringList custom; | 86 | QStringList custom; |
86 | int mTempSyncStat; | 87 | int mTempSyncStat; |
87 | Resource *resource; | 88 | Resource *resource; |
88 | 89 | ||
89 | bool empty :1; | 90 | bool empty :1; |
90 | bool changed :1; | 91 | bool changed :1; |
91 | bool tagged :1; | 92 | bool tagged :1; |
92 | }; | 93 | }; |
93 | 94 | ||
94 | Addressee::Addressee() | 95 | Addressee::Addressee() |
95 | { | 96 | { |
96 | mData = new AddresseeData; | 97 | mData = new AddresseeData; |
97 | mData->empty = true; | 98 | mData->empty = true; |
98 | mData->changed = false; | 99 | mData->changed = false; |
99 | mData->resource = 0; | 100 | mData->resource = 0; |
100 | mData->mExternalId = ":"; | 101 | mData->mExternalId = ":"; |
101 | mData->revision = QDateTime ( QDate( 2003,1,1)); | 102 | mData->revision = QDateTime ( QDate( 2003,1,1)); |
102 | mData->mTempSyncStat = SYNC_TEMPSTATE_INITIAL; | 103 | mData->mTempSyncStat = SYNC_TEMPSTATE_INITIAL; |
103 | } | 104 | } |
104 | 105 | ||
105 | Addressee::~Addressee() | 106 | Addressee::~Addressee() |
106 | { | 107 | { |
107 | } | 108 | } |
108 | 109 | ||
109 | Addressee::Addressee( const Addressee &a ) | 110 | Addressee::Addressee( const Addressee &a ) |
110 | { | 111 | { |
111 | mData = a.mData; | 112 | mData = a.mData; |
112 | } | 113 | } |
113 | 114 | ||
114 | Addressee &Addressee::operator=( const Addressee &a ) | 115 | Addressee &Addressee::operator=( const Addressee &a ) |
115 | { | 116 | { |
116 | mData = a.mData; | 117 | mData = a.mData; |
117 | return (*this); | 118 | return (*this); |
118 | } | 119 | } |
119 | 120 | ||
120 | Addressee Addressee::copy() | 121 | Addressee Addressee::copy() |
121 | { | 122 | { |
122 | Addressee a; | 123 | Addressee a; |
123 | *(a.mData) = *mData; | 124 | *(a.mData) = *mData; |
124 | return a; | 125 | return a; |
125 | } | 126 | } |
126 | 127 | ||
127 | void Addressee::detach() | 128 | void Addressee::detach() |
128 | { | 129 | { |
129 | if ( mData.count() == 1 ) return; | 130 | if ( mData.count() == 1 ) return; |
130 | *this = copy(); | 131 | *this = copy(); |
131 | } | 132 | } |
132 | 133 | ||
133 | bool Addressee::operator==( const Addressee &a ) const | 134 | bool Addressee::operator==( const Addressee &a ) const |
134 | { | 135 | { |
135 | if ( uid() != a.uid() ) return false; | 136 | if ( uid() != a.uid() ) return false; |
136 | if ( mData->name != a.mData->name ) return false; | 137 | if ( mData->name != a.mData->name ) return false; |
137 | if ( mData->formattedName != a.mData->formattedName ) return false; | 138 | if ( mData->formattedName != a.mData->formattedName ) return false; |
138 | if ( mData->familyName != a.mData->familyName ) return false; | 139 | if ( mData->familyName != a.mData->familyName ) return false; |
139 | if ( mData->givenName != a.mData->givenName ) return false; | 140 | if ( mData->givenName != a.mData->givenName ) return false; |
140 | if ( mData->additionalName != a.mData->additionalName ) return false; | 141 | if ( mData->additionalName != a.mData->additionalName ) return false; |
141 | if ( mData->prefix != a.mData->prefix ) return false; | 142 | if ( mData->prefix != a.mData->prefix ) return false; |
142 | if ( mData->suffix != a.mData->suffix ) return false; | 143 | if ( mData->suffix != a.mData->suffix ) return false; |
143 | if ( mData->nickName != a.mData->nickName ) return false; | 144 | if ( mData->nickName != a.mData->nickName ) return false; |
144 | if ( mData->birthday != a.mData->birthday ) return false; | 145 | if ( mData->birthday != a.mData->birthday ) return false; |
145 | if ( mData->mailer != a.mData->mailer ) return false; | 146 | if ( mData->mailer != a.mData->mailer ) return false; |
146 | if ( mData->timeZone != a.mData->timeZone ) return false; | 147 | if ( mData->timeZone != a.mData->timeZone ) return false; |
147 | if ( mData->geo != a.mData->geo ) return false; | 148 | if ( mData->geo != a.mData->geo ) return false; |
148 | if ( mData->title != a.mData->title ) return false; | 149 | if ( mData->title != a.mData->title ) return false; |
149 | if ( mData->role != a.mData->role ) return false; | 150 | if ( mData->role != a.mData->role ) return false; |
150 | if ( mData->organization != a.mData->organization ) return false; | 151 | if ( mData->organization != a.mData->organization ) return false; |
151 | if ( mData->note != a.mData->note ) return false; | 152 | if ( mData->note != a.mData->note ) return false; |
152 | if ( mData->productId != a.mData->productId ) return false; | 153 | if ( mData->productId != a.mData->productId ) return false; |
153 | //if ( mData->revision != a.mData->revision ) return false; | 154 | //if ( mData->revision != a.mData->revision ) return false; |
154 | if ( mData->sortString != a.mData->sortString ) return false; | 155 | if ( mData->sortString != a.mData->sortString ) return false; |
155 | if ( mData->secrecy != a.mData->secrecy ) return false; | 156 | if ( mData->secrecy != a.mData->secrecy ) return false; |
156 | if ( mData->logo != a.mData->logo ) return false; | 157 | if ( mData->logo != a.mData->logo ) return false; |
157 | if ( mData->photo != a.mData->photo ) return false; | 158 | if ( mData->photo != a.mData->photo ) return false; |
158 | if ( mData->sound != a.mData->sound ) return false; | 159 | if ( mData->sound != a.mData->sound ) return false; |
159 | if ( mData->agent != a.mData->agent ) return false; | 160 | if ( mData->agent != a.mData->agent ) return false; |
160 | if ( ( mData->url.isValid() || a.mData->url.isValid() ) && | 161 | if ( ( mData->url.isValid() || a.mData->url.isValid() ) && |
161 | ( mData->url != a.mData->url ) ) return false; | 162 | ( mData->url != a.mData->url ) ) return false; |
162 | if ( mData->phoneNumbers != a.mData->phoneNumbers ) return false; | 163 | if ( mData->phoneNumbers != a.mData->phoneNumbers ) return false; |
163 | if ( mData->addresses != a.mData->addresses ) return false; | 164 | if ( mData->addresses != a.mData->addresses ) return false; |
164 | if ( mData->keys != a.mData->keys ) return false; | 165 | if ( mData->keys != a.mData->keys ) return false; |
165 | if ( mData->emails != a.mData->emails ) return false; | 166 | if ( mData->emails != a.mData->emails ) return false; |
166 | if ( mData->categories != a.mData->categories ) return false; | 167 | if ( mData->categories != a.mData->categories ) return false; |
167 | if ( mData->custom != a.mData->custom ) return false; | 168 | if ( mData->custom != a.mData->custom ) return false; |
168 | 169 | ||
169 | return true; | 170 | return true; |
170 | } | 171 | } |
171 | 172 | ||
172 | bool Addressee::operator!=( const Addressee &a ) const | 173 | bool Addressee::operator!=( const Addressee &a ) const |
173 | { | 174 | { |
174 | return !( a == *this ); | 175 | return !( a == *this ); |
175 | } | 176 | } |
176 | 177 | ||
177 | bool Addressee::isEmpty() const | 178 | bool Addressee::isEmpty() const |
178 | { | 179 | { |
179 | return mData->empty; | 180 | return mData->empty; |
180 | } | 181 | } |
181 | ulong Addressee::getCsum4List( const QStringList & attList) | 182 | ulong Addressee::getCsum4List( const QStringList & attList) |
@@ -622,489 +623,513 @@ void Addressee::removeID(const QString &prof) | |||
622 | { | 623 | { |
623 | detach(); | 624 | detach(); |
624 | if ( prof.isEmpty() ) | 625 | if ( prof.isEmpty() ) |
625 | mData->mExternalId = ":"; | 626 | mData->mExternalId = ":"; |
626 | else | 627 | else |
627 | mData->mExternalId = KIdManager::removeId ( mData->mExternalId, prof); | 628 | mData->mExternalId = KIdManager::removeId ( mData->mExternalId, prof); |
628 | 629 | ||
629 | } | 630 | } |
630 | void Addressee::setID( const QString & prof , const QString & id ) | 631 | void Addressee::setID( const QString & prof , const QString & id ) |
631 | { | 632 | { |
632 | detach(); | 633 | detach(); |
633 | mData->mExternalId = KIdManager::setId ( mData->mExternalId, prof, id ); | 634 | mData->mExternalId = KIdManager::setId ( mData->mExternalId, prof, id ); |
634 | //qDebug("setID2 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); | 635 | //qDebug("setID2 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); |
635 | } | 636 | } |
636 | void Addressee::setTempSyncStat( int id ) | 637 | void Addressee::setTempSyncStat( int id ) |
637 | { | 638 | { |
638 | if ( mData->mTempSyncStat == id ) return; | 639 | if ( mData->mTempSyncStat == id ) return; |
639 | detach(); | 640 | detach(); |
640 | mData->mTempSyncStat = id; | 641 | mData->mTempSyncStat = id; |
641 | } | 642 | } |
642 | int Addressee::tempSyncStat() const | 643 | int Addressee::tempSyncStat() const |
643 | { | 644 | { |
644 | return mData->mTempSyncStat; | 645 | return mData->mTempSyncStat; |
645 | } | 646 | } |
646 | 647 | ||
647 | const QString Addressee::getID( const QString & prof) const | 648 | const QString Addressee::getID( const QString & prof) const |
648 | { | 649 | { |
649 | return KIdManager::getId ( mData->mExternalId, prof ); | 650 | return KIdManager::getId ( mData->mExternalId, prof ); |
650 | } | 651 | } |
651 | 652 | ||
652 | void Addressee::setCsum( const QString & prof , const QString & id ) | 653 | void Addressee::setCsum( const QString & prof , const QString & id ) |
653 | { | 654 | { |
654 | detach(); | 655 | detach(); |
655 | //qDebug("setcsum1 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); | 656 | //qDebug("setcsum1 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); |
656 | mData->mExternalId = KIdManager::setCsum ( mData->mExternalId, prof, id ); | 657 | mData->mExternalId = KIdManager::setCsum ( mData->mExternalId, prof, id ); |
657 | //qDebug("setcsum2 %s ",mData->mExternalId.latin1() ); | 658 | //qDebug("setcsum2 %s ",mData->mExternalId.latin1() ); |
658 | } | 659 | } |
659 | 660 | ||
660 | const QString Addressee::getCsum( const QString & prof) const | 661 | const QString Addressee::getCsum( const QString & prof) const |
661 | { | 662 | { |
662 | return KIdManager::getCsum ( mData->mExternalId, prof ); | 663 | return KIdManager::getCsum ( mData->mExternalId, prof ); |
663 | } | 664 | } |
664 | 665 | ||
665 | void Addressee::setIDStr( const QString & s ) | 666 | void Addressee::setIDStr( const QString & s ) |
666 | { | 667 | { |
667 | detach(); | 668 | detach(); |
668 | mData->mExternalId = s; | 669 | mData->mExternalId = s; |
669 | } | 670 | } |
670 | 671 | ||
671 | const QString Addressee::IDStr() const | 672 | const QString Addressee::IDStr() const |
672 | { | 673 | { |
673 | return mData->mExternalId; | 674 | return mData->mExternalId; |
674 | } | 675 | } |
675 | 676 | ||
676 | void Addressee::setExternalUID( const QString &id ) | 677 | void Addressee::setExternalUID( const QString &id ) |
677 | { | 678 | { |
678 | if ( id == mData->externalUID ) return; | 679 | if ( id == mData->externalUID ) return; |
679 | detach(); | 680 | detach(); |
680 | mData->empty = false; | 681 | mData->empty = false; |
681 | mData->externalUID = id; | 682 | mData->externalUID = id; |
682 | } | 683 | } |
683 | 684 | ||
684 | const QString Addressee::externalUID() const | 685 | const QString Addressee::externalUID() const |
685 | { | 686 | { |
686 | return mData->externalUID; | 687 | return mData->externalUID; |
687 | } | 688 | } |
688 | void Addressee::setOriginalExternalUID( const QString &id ) | 689 | void Addressee::setOriginalExternalUID( const QString &id ) |
689 | { | 690 | { |
690 | if ( id == mData->originalExternalUID ) return; | 691 | if ( id == mData->originalExternalUID ) return; |
691 | detach(); | 692 | detach(); |
692 | mData->empty = false; | 693 | mData->empty = false; |
693 | //qDebug("*******Set orig uid %s ", id.latin1()); | 694 | //qDebug("*******Set orig uid %s ", id.latin1()); |
694 | mData->originalExternalUID = id; | 695 | mData->originalExternalUID = id; |
695 | } | 696 | } |
696 | 697 | ||
697 | QString Addressee::originalExternalUID() const | 698 | QString Addressee::originalExternalUID() const |
698 | { | 699 | { |
699 | return mData->originalExternalUID; | 700 | return mData->originalExternalUID; |
700 | } | 701 | } |
701 | 702 | ||
702 | void Addressee::setUid( const QString &id ) | 703 | void Addressee::setUid( const QString &id ) |
703 | { | 704 | { |
704 | if ( id == mData->uid ) return; | 705 | if ( id == mData->uid ) return; |
705 | detach(); | 706 | detach(); |
706 | //qDebug("****setuid %s ", id.latin1()); | 707 | //qDebug("****setuid %s ", id.latin1()); |
707 | mData->empty = false; | 708 | mData->empty = false; |
708 | mData->uid = id; | 709 | mData->uid = id; |
709 | } | 710 | } |
710 | 711 | ||
711 | const QString Addressee::uid() const | 712 | const QString Addressee::uid() const |
712 | { | 713 | { |
713 | if ( mData->uid.isEmpty() ) | 714 | if ( mData->uid.isEmpty() ) |
714 | mData->uid = KApplication::randomString( 10 ); | 715 | mData->uid = KApplication::randomString( 10 ); |
715 | 716 | ||
716 | return mData->uid; | 717 | return mData->uid; |
717 | } | 718 | } |
718 | 719 | ||
719 | QString Addressee::uidLabel() | 720 | QString Addressee::uidLabel() |
720 | { | 721 | { |
721 | return i18n("Unique Identifier"); | 722 | return i18n("Unique Identifier"); |
722 | } | 723 | } |
723 | 724 | ||
724 | void Addressee::setName( const QString &name ) | 725 | void Addressee::setName( const QString &name ) |
725 | { | 726 | { |
726 | if ( name == mData->name ) return; | 727 | if ( name == mData->name ) return; |
727 | detach(); | 728 | detach(); |
728 | mData->empty = false; | 729 | mData->empty = false; |
729 | mData->name = name; | 730 | mData->name = name; |
730 | } | 731 | } |
731 | 732 | ||
732 | QString Addressee::name() const | 733 | QString Addressee::name() const |
733 | { | 734 | { |
734 | return mData->name; | 735 | return mData->name; |
735 | } | 736 | } |
736 | 737 | ||
737 | QString Addressee::nameLabel() | 738 | QString Addressee::nameLabel() |
738 | { | 739 | { |
739 | return i18n("Name"); | 740 | return i18n("Name"); |
740 | } | 741 | } |
741 | 742 | ||
742 | 743 | ||
743 | void Addressee::setFormattedName( const QString &formattedName ) | 744 | void Addressee::setFormattedName( const QString &formattedName ) |
744 | { | 745 | { |
745 | if ( formattedName == mData->formattedName ) return; | 746 | if ( formattedName == mData->formattedName ) return; |
746 | detach(); | 747 | detach(); |
747 | mData->empty = false; | 748 | mData->empty = false; |
748 | mData->formattedName = formattedName; | 749 | mData->formattedName = formattedName; |
749 | } | 750 | } |
751 | void Addressee::setDefaultFormattedName( const QString &formattedName ) | ||
752 | { | ||
753 | if ( formattedName == mData->defaultFormattedName ) return; | ||
754 | detach(); | ||
755 | mData->empty = false; | ||
756 | mData->defaultFormattedName = formattedName; | ||
757 | } | ||
750 | 758 | ||
751 | QString Addressee::formattedName() const | 759 | QString Addressee::formattedName() const |
752 | { | 760 | { |
753 | return mData->formattedName; | 761 | return mData->formattedName; |
754 | } | 762 | } |
763 | QString Addressee::defaultFormattedName() const | ||
764 | { | ||
765 | return mData->defaultFormattedName; | ||
766 | } | ||
755 | 767 | ||
756 | QString Addressee::formattedNameLabel() | 768 | QString Addressee::formattedNameLabel() |
757 | { | 769 | { |
758 | return i18n("Formatted Name"); | 770 | return i18n("Formatted Name"); |
759 | } | 771 | } |
760 | 772 | ||
773 | QString Addressee::defaultFormattedNameLabel() | ||
774 | { | ||
775 | return i18n("Def.Formatted Name"); | ||
776 | } | ||
777 | |||
761 | 778 | ||
762 | void Addressee::setFamilyName( const QString &familyName ) | 779 | void Addressee::setFamilyName( const QString &familyName ) |
763 | { | 780 | { |
764 | if ( familyName == mData->familyName ) return; | 781 | if ( familyName == mData->familyName ) return; |
765 | detach(); | 782 | detach(); |
766 | mData->empty = false; | 783 | mData->empty = false; |
767 | mData->familyName = familyName; | 784 | mData->familyName = familyName; |
768 | } | 785 | } |
769 | 786 | ||
770 | QString Addressee::familyName() const | 787 | QString Addressee::familyName() const |
771 | { | 788 | { |
772 | return mData->familyName; | 789 | return mData->familyName; |
773 | } | 790 | } |
774 | 791 | ||
775 | QString Addressee::familyNameLabel() | 792 | QString Addressee::familyNameLabel() |
776 | { | 793 | { |
777 | return i18n("Family Name"); | 794 | return i18n("Family Name"); |
778 | } | 795 | } |
779 | 796 | ||
780 | 797 | ||
781 | void Addressee::setGivenName( const QString &givenName ) | 798 | void Addressee::setGivenName( const QString &givenName ) |
782 | { | 799 | { |
783 | if ( givenName == mData->givenName ) return; | 800 | if ( givenName == mData->givenName ) return; |
784 | detach(); | 801 | detach(); |
785 | mData->empty = false; | 802 | mData->empty = false; |
786 | mData->givenName = givenName; | 803 | mData->givenName = givenName; |
787 | } | 804 | } |
788 | 805 | ||
789 | QString Addressee::givenName() const | 806 | QString Addressee::givenName() const |
790 | { | 807 | { |
791 | return mData->givenName; | 808 | return mData->givenName; |
792 | } | 809 | } |
793 | 810 | ||
794 | QString Addressee::givenNameLabel() | 811 | QString Addressee::givenNameLabel() |
795 | { | 812 | { |
796 | return i18n("Given Name"); | 813 | return i18n("Given Name"); |
797 | } | 814 | } |
798 | 815 | ||
799 | 816 | ||
800 | void Addressee::setAdditionalName( const QString &additionalName ) | 817 | void Addressee::setAdditionalName( const QString &additionalName ) |
801 | { | 818 | { |
802 | if ( additionalName == mData->additionalName ) return; | 819 | if ( additionalName == mData->additionalName ) return; |
803 | detach(); | 820 | detach(); |
804 | mData->empty = false; | 821 | mData->empty = false; |
805 | mData->additionalName = additionalName; | 822 | mData->additionalName = additionalName; |
806 | } | 823 | } |
807 | 824 | ||
808 | QString Addressee::additionalName() const | 825 | QString Addressee::additionalName() const |
809 | { | 826 | { |
810 | return mData->additionalName; | 827 | return mData->additionalName; |
811 | } | 828 | } |
812 | 829 | ||
813 | QString Addressee::additionalNameLabel() | 830 | QString Addressee::additionalNameLabel() |
814 | { | 831 | { |
815 | return i18n("Additional Names"); | 832 | return i18n("Additional Names"); |
816 | } | 833 | } |
817 | 834 | ||
818 | 835 | ||
819 | void Addressee::setPrefix( const QString &prefix ) | 836 | void Addressee::setPrefix( const QString &prefix ) |
820 | { | 837 | { |
821 | if ( prefix == mData->prefix ) return; | 838 | if ( prefix == mData->prefix ) return; |
822 | detach(); | 839 | detach(); |
823 | mData->empty = false; | 840 | mData->empty = false; |
824 | mData->prefix = prefix; | 841 | mData->prefix = prefix; |
825 | } | 842 | } |
826 | 843 | ||
827 | QString Addressee::prefix() const | 844 | QString Addressee::prefix() const |
828 | { | 845 | { |
829 | return mData->prefix; | 846 | return mData->prefix; |
830 | } | 847 | } |
831 | 848 | ||
832 | QString Addressee::prefixLabel() | 849 | QString Addressee::prefixLabel() |
833 | { | 850 | { |
834 | return i18n("Honorific Prefixes"); | 851 | return i18n("Honorific Prefixes"); |
835 | } | 852 | } |
836 | 853 | ||
837 | 854 | ||
838 | void Addressee::setSuffix( const QString &suffix ) | 855 | void Addressee::setSuffix( const QString &suffix ) |
839 | { | 856 | { |
840 | if ( suffix == mData->suffix ) return; | 857 | if ( suffix == mData->suffix ) return; |
841 | detach(); | 858 | detach(); |
842 | mData->empty = false; | 859 | mData->empty = false; |
843 | mData->suffix = suffix; | 860 | mData->suffix = suffix; |
844 | } | 861 | } |
845 | 862 | ||
846 | QString Addressee::suffix() const | 863 | QString Addressee::suffix() const |
847 | { | 864 | { |
848 | return mData->suffix; | 865 | return mData->suffix; |
849 | } | 866 | } |
850 | 867 | ||
851 | QString Addressee::suffixLabel() | 868 | QString Addressee::suffixLabel() |
852 | { | 869 | { |
853 | return i18n("Honorific Suffixes"); | 870 | return i18n("Honorific Suffixes"); |
854 | } | 871 | } |
855 | 872 | ||
856 | 873 | ||
857 | void Addressee::setNickName( const QString &nickName ) | 874 | void Addressee::setNickName( const QString &nickName ) |
858 | { | 875 | { |
859 | if ( nickName == mData->nickName ) return; | 876 | if ( nickName == mData->nickName ) return; |
860 | detach(); | 877 | detach(); |
861 | mData->empty = false; | 878 | mData->empty = false; |
862 | mData->nickName = nickName; | 879 | mData->nickName = nickName; |
863 | } | 880 | } |
864 | 881 | ||
865 | QString Addressee::nickName() const | 882 | QString Addressee::nickName() const |
866 | { | 883 | { |
867 | return mData->nickName; | 884 | return mData->nickName; |
868 | } | 885 | } |
869 | 886 | ||
870 | QString Addressee::nickNameLabel() | 887 | QString Addressee::nickNameLabel() |
871 | { | 888 | { |
872 | return i18n("Nick Name"); | 889 | return i18n("Nick Name"); |
873 | } | 890 | } |
874 | 891 | ||
875 | 892 | ||
876 | void Addressee::setBirthday( const QDateTime &birthday ) | 893 | void Addressee::setBirthday( const QDateTime &birthday ) |
877 | { | 894 | { |
878 | if ( birthday == mData->birthday ) return; | 895 | if ( birthday == mData->birthday ) return; |
879 | detach(); | 896 | detach(); |
880 | mData->empty = false; | 897 | mData->empty = false; |
881 | mData->birthday = birthday; | 898 | mData->birthday = birthday; |
882 | } | 899 | } |
883 | 900 | ||
884 | QDateTime Addressee::birthday() const | 901 | QDateTime Addressee::birthday() const |
885 | { | 902 | { |
886 | return mData->birthday; | 903 | return mData->birthday; |
887 | } | 904 | } |
888 | 905 | ||
889 | QString Addressee::birthdayLabel() | 906 | QString Addressee::birthdayLabel() |
890 | { | 907 | { |
891 | return i18n("Birthday"); | 908 | return i18n("Birthday"); |
892 | } | 909 | } |
893 | 910 | ||
894 | 911 | ||
895 | QString Addressee::homeAddressStreetLabel() | 912 | QString Addressee::homeAddressStreetLabel() |
896 | { | 913 | { |
897 | return i18n("Home Address Street"); | 914 | return i18n("Home Address Street"); |
898 | } | 915 | } |
899 | 916 | ||
900 | 917 | ||
901 | QString Addressee::homeAddressLocalityLabel() | 918 | QString Addressee::homeAddressLocalityLabel() |
902 | { | 919 | { |
903 | return i18n("Home Address Locality"); | 920 | return i18n("Home Address Locality"); |
904 | } | 921 | } |
905 | 922 | ||
906 | 923 | ||
907 | QString Addressee::homeAddressRegionLabel() | 924 | QString Addressee::homeAddressRegionLabel() |
908 | { | 925 | { |
909 | return i18n("Home Address Region"); | 926 | return i18n("Home Address Region"); |
910 | } | 927 | } |
911 | 928 | ||
912 | 929 | ||
913 | QString Addressee::homeAddressPostalCodeLabel() | 930 | QString Addressee::homeAddressPostalCodeLabel() |
914 | { | 931 | { |
915 | return i18n("Home Address Postal Code"); | 932 | return i18n("Home Address Postal Code"); |
916 | } | 933 | } |
917 | 934 | ||
918 | 935 | ||
919 | QString Addressee::homeAddressCountryLabel() | 936 | QString Addressee::homeAddressCountryLabel() |
920 | { | 937 | { |
921 | return i18n("Home Address Country"); | 938 | return i18n("Home Address Country"); |
922 | } | 939 | } |
923 | 940 | ||
924 | 941 | ||
925 | QString Addressee::homeAddressLabelLabel() | 942 | QString Addressee::homeAddressLabelLabel() |
926 | { | 943 | { |
927 | return i18n("Home Address Label"); | 944 | return i18n("Home Address Label"); |
928 | } | 945 | } |
929 | 946 | ||
930 | 947 | ||
931 | QString Addressee::businessAddressStreetLabel() | 948 | QString Addressee::businessAddressStreetLabel() |
932 | { | 949 | { |
933 | return i18n("Business Address Street"); | 950 | return i18n("Business Address Street"); |
934 | } | 951 | } |
935 | 952 | ||
936 | 953 | ||
937 | QString Addressee::businessAddressLocalityLabel() | 954 | QString Addressee::businessAddressLocalityLabel() |
938 | { | 955 | { |
939 | return i18n("Business Address Locality"); | 956 | return i18n("Business Address Locality"); |
940 | } | 957 | } |
941 | 958 | ||
942 | 959 | ||
943 | QString Addressee::businessAddressRegionLabel() | 960 | QString Addressee::businessAddressRegionLabel() |
944 | { | 961 | { |
945 | return i18n("Business Address Region"); | 962 | return i18n("Business Address Region"); |
946 | } | 963 | } |
947 | 964 | ||
948 | 965 | ||
949 | QString Addressee::businessAddressPostalCodeLabel() | 966 | QString Addressee::businessAddressPostalCodeLabel() |
950 | { | 967 | { |
951 | return i18n("Business Address Postal Code"); | 968 | return i18n("Business Address Postal Code"); |
952 | } | 969 | } |
953 | 970 | ||
954 | 971 | ||
955 | QString Addressee::businessAddressCountryLabel() | 972 | QString Addressee::businessAddressCountryLabel() |
956 | { | 973 | { |
957 | return i18n("Business Address Country"); | 974 | return i18n("Business Address Country"); |
958 | } | 975 | } |
959 | 976 | ||
960 | 977 | ||
961 | QString Addressee::businessAddressLabelLabel() | 978 | QString Addressee::businessAddressLabelLabel() |
962 | { | 979 | { |
963 | return i18n("Business Address Label"); | 980 | return i18n("Business Address Label"); |
964 | } | 981 | } |
965 | 982 | ||
966 | 983 | ||
967 | QString Addressee::homePhoneLabel() | 984 | QString Addressee::homePhoneLabel() |
968 | { | 985 | { |
969 | return i18n("Home Phone"); | 986 | return i18n("Home Phone"); |
970 | } | 987 | } |
971 | 988 | ||
972 | 989 | ||
973 | QString Addressee::businessPhoneLabel() | 990 | QString Addressee::businessPhoneLabel() |
974 | { | 991 | { |
975 | return i18n("Business Phone"); | 992 | return i18n("Business Phone"); |
976 | } | 993 | } |
977 | 994 | ||
978 | 995 | ||
979 | QString Addressee::mobilePhoneLabel() | 996 | QString Addressee::mobilePhoneLabel() |
980 | { | 997 | { |
981 | return i18n("Mobile Phone"); | 998 | return i18n("Mobile Phone"); |
982 | } | 999 | } |
1000 | QString Addressee::mobileWorkPhoneLabel() | ||
1001 | { | ||
1002 | return i18n("Mobile (work)"); | ||
1003 | } | ||
1004 | QString Addressee::mobileHomePhoneLabel() | ||
1005 | { | ||
1006 | return i18n("Mobile (home)"); | ||
1007 | } | ||
983 | 1008 | ||
984 | 1009 | ||
985 | QString Addressee::homeFaxLabel() | 1010 | QString Addressee::homeFaxLabel() |
986 | { | 1011 | { |
987 | return i18n("Home Fax"); | 1012 | return i18n("Home Fax"); |
988 | } | 1013 | } |
989 | 1014 | ||
990 | 1015 | ||
991 | QString Addressee::businessFaxLabel() | 1016 | QString Addressee::businessFaxLabel() |
992 | { | 1017 | { |
993 | return i18n("Business Fax"); | 1018 | return i18n("Business Fax"); |
994 | } | 1019 | } |
995 | 1020 | ||
996 | 1021 | ||
997 | QString Addressee::carPhoneLabel() | 1022 | QString Addressee::carPhoneLabel() |
998 | { | 1023 | { |
999 | return i18n("Car Phone"); | 1024 | return i18n("Car Phone"); |
1000 | } | 1025 | } |
1001 | 1026 | ||
1002 | 1027 | ||
1003 | QString Addressee::isdnLabel() | 1028 | QString Addressee::isdnLabel() |
1004 | { | 1029 | { |
1005 | return i18n("ISDN"); | 1030 | return i18n("ISDN"); |
1006 | } | 1031 | } |
1007 | 1032 | ||
1008 | 1033 | ||
1009 | QString Addressee::pagerLabel() | 1034 | QString Addressee::pagerLabel() |
1010 | { | 1035 | { |
1011 | return i18n("Pager"); | 1036 | return i18n("Pager"); |
1012 | } | 1037 | } |
1013 | 1038 | ||
1014 | QString Addressee::sipLabel() | 1039 | QString Addressee::sipLabel() |
1015 | { | 1040 | { |
1016 | return i18n("SIP"); | 1041 | return i18n("SIP"); |
1017 | } | 1042 | } |
1018 | 1043 | ||
1019 | QString Addressee::emailLabel() | 1044 | QString Addressee::emailLabel() |
1020 | { | 1045 | { |
1021 | return i18n("Email Address"); | 1046 | return i18n("Email Address"); |
1022 | } | 1047 | } |
1023 | 1048 | ||
1024 | 1049 | ||
1025 | void Addressee::setMailer( const QString &mailer ) | 1050 | void Addressee::setMailer( const QString &mailer ) |
1026 | { | 1051 | { |
1027 | if ( mailer == mData->mailer ) return; | 1052 | if ( mailer == mData->mailer ) return; |
1028 | detach(); | 1053 | detach(); |
1029 | mData->empty = false; | 1054 | mData->empty = false; |
1030 | mData->mailer = mailer; | 1055 | mData->mailer = mailer; |
1031 | } | 1056 | } |
1032 | 1057 | ||
1033 | QString Addressee::mailer() const | 1058 | QString Addressee::mailer() const |
1034 | { | 1059 | { |
1035 | return mData->mailer; | 1060 | return mData->mailer; |
1036 | } | 1061 | } |
1037 | 1062 | ||
1038 | QString Addressee::mailerLabel() | 1063 | QString Addressee::mailerLabel() |
1039 | { | 1064 | { |
1040 | return i18n("Mail Client"); | 1065 | return i18n("Mail Client"); |
1041 | } | 1066 | } |
1042 | 1067 | ||
1043 | 1068 | ||
1044 | void Addressee::setTimeZone( const TimeZone &timeZone ) | 1069 | void Addressee::setTimeZone( const TimeZone &timeZone ) |
1045 | { | 1070 | { |
1046 | if ( timeZone == mData->timeZone ) return; | 1071 | if ( timeZone == mData->timeZone ) return; |
1047 | detach(); | 1072 | detach(); |
1048 | mData->empty = false; | 1073 | mData->empty = false; |
1049 | mData->timeZone = timeZone; | 1074 | mData->timeZone = timeZone; |
1050 | } | 1075 | } |
1051 | 1076 | ||
1052 | TimeZone Addressee::timeZone() const | 1077 | TimeZone Addressee::timeZone() const |
1053 | { | 1078 | { |
1054 | return mData->timeZone; | 1079 | return mData->timeZone; |
1055 | } | 1080 | } |
1056 | 1081 | ||
1057 | QString Addressee::timeZoneLabel() | 1082 | QString Addressee::timeZoneLabel() |
1058 | { | 1083 | { |
1059 | return i18n("Time Zone"); | 1084 | return i18n("Time Zone"); |
1060 | } | 1085 | } |
1061 | 1086 | ||
1062 | 1087 | ||
1063 | void Addressee::setGeo( const Geo &geo ) | 1088 | void Addressee::setGeo( const Geo &geo ) |
1064 | { | 1089 | { |
1065 | if ( geo == mData->geo ) return; | 1090 | if ( geo == mData->geo ) return; |
1066 | detach(); | 1091 | detach(); |
1067 | mData->empty = false; | 1092 | mData->empty = false; |
1068 | mData->geo = geo; | 1093 | mData->geo = geo; |
1069 | } | 1094 | } |
1070 | 1095 | ||
1071 | Geo Addressee::geo() const | 1096 | Geo Addressee::geo() const |
1072 | { | 1097 | { |
1073 | return mData->geo; | 1098 | return mData->geo; |
1074 | } | 1099 | } |
1075 | 1100 | ||
1076 | QString Addressee::geoLabel() | 1101 | QString Addressee::geoLabel() |
1077 | { | 1102 | { |
1078 | return i18n("Geographic Position"); | 1103 | return i18n("Geographic Position"); |
1079 | } | 1104 | } |
1080 | 1105 | ||
1081 | 1106 | ||
1082 | void Addressee::setTitle( const QString &title ) | 1107 | void Addressee::setTitle( const QString &title ) |
1083 | { | 1108 | { |
1084 | if ( title == mData->title ) return; | 1109 | if ( title == mData->title ) return; |
1085 | detach(); | 1110 | detach(); |
1086 | mData->empty = false; | 1111 | mData->empty = false; |
1087 | mData->title = title; | 1112 | mData->title = title; |
1088 | } | 1113 | } |
1089 | 1114 | ||
1090 | QString Addressee::title() const | 1115 | QString Addressee::title() const |
1091 | { | 1116 | { |
1092 | return mData->title; | 1117 | return mData->title; |
1093 | } | 1118 | } |
1094 | 1119 | ||
1095 | QString Addressee::titleLabel() | 1120 | QString Addressee::titleLabel() |
1096 | { | 1121 | { |
1097 | return i18n("Title"); | 1122 | return i18n("Title"); |
1098 | } | 1123 | } |
1099 | 1124 | ||
1100 | 1125 | ||
1101 | void Addressee::setRole( const QString &role ) | 1126 | void Addressee::setRole( const QString &role ) |
1102 | { | 1127 | { |
1103 | if ( role == mData->role ) return; | 1128 | if ( role == mData->role ) return; |
1104 | detach(); | 1129 | detach(); |
1105 | mData->empty = false; | 1130 | mData->empty = false; |
1106 | mData->role = role; | 1131 | mData->role = role; |
1107 | } | 1132 | } |
1108 | 1133 | ||
1109 | QString Addressee::role() const | 1134 | QString Addressee::role() const |
1110 | { | 1135 | { |