author | zautrix <zautrix> | 2006-02-24 18:49:56 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2006-02-24 18:49:56 (UTC) |
commit | d7738fdfc685192eb2f8317db6ffad3c246001c8 (patch) (unidiff) | |
tree | d9aae6ca97851fd1b53c4d9e74740a5ee2b69ea9 /kabc/addressee.h | |
parent | 987757f168bbae56100f2aff763b865e81ceec18 (diff) | |
download | kdepimpi-d7738fdfc685192eb2f8317db6ffad3c246001c8.zip kdepimpi-d7738fdfc685192eb2f8317db6ffad3c246001c8.tar.gz kdepimpi-d7738fdfc685192eb2f8317db6ffad3c246001c8.tar.bz2 |
kapi sync
-rw-r--r-- | kabc/addressee.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kabc/addressee.h b/kabc/addressee.h index aac78dc..0ea1803 100644 --- a/kabc/addressee.h +++ b/kabc/addressee.h | |||
@@ -73,96 +73,97 @@ class Resource; | |||
73 | 73 | ||
74 | realName() returns a fully formatted name(). It uses formattedName, if set, | 74 | realName() returns a fully formatted name(). It uses formattedName, if set, |
75 | otherwise it constucts the name from the name fields. As fallback, if | 75 | otherwise it constucts the name from the name fields. As fallback, if |
76 | nothing else is set it uses name(). | 76 | nothing else is set it uses name(). |
77 | 77 | ||
78 | name() is the NAME type of RFC2426. It can be used as internal name for the | 78 | name() is the NAME type of RFC2426. It can be used as internal name for the |
79 | data enty, but shouldn't be used for displaying the data to the user. | 79 | data enty, but shouldn't be used for displaying the data to the user. |
80 | */ | 80 | */ |
81 | class Addressee | 81 | class Addressee |
82 | { | 82 | { |
83 | friend QDataStream &operator<<( QDataStream &, const Addressee & ); | 83 | friend QDataStream &operator<<( QDataStream &, const Addressee & ); |
84 | friend QDataStream &operator>>( QDataStream &, Addressee & ); | 84 | friend QDataStream &operator>>( QDataStream &, Addressee & ); |
85 | 85 | ||
86 | public: | 86 | public: |
87 | typedef QValueList<Addressee> List; | 87 | typedef QValueList<Addressee> List; |
88 | 88 | ||
89 | /** | 89 | /** |
90 | Construct an empty address book entry. | 90 | Construct an empty address book entry. |
91 | */ | 91 | */ |
92 | Addressee(); | 92 | Addressee(); |
93 | ~Addressee(); | 93 | ~Addressee(); |
94 | 94 | ||
95 | Addressee( const Addressee & ); | 95 | Addressee( const Addressee & ); |
96 | Addressee &operator=( const Addressee & ); | 96 | Addressee &operator=( const Addressee & ); |
97 | 97 | ||
98 | bool operator==( const Addressee & ) const; | 98 | bool operator==( const Addressee & ) const; |
99 | bool operator!=( const Addressee & ) const; | 99 | bool operator!=( const Addressee & ) const; |
100 | // sync stuff | 100 | // sync stuff |
101 | void setTempSyncStat(int id); | 101 | void setTempSyncStat(int id); |
102 | int tempSyncStat() const; | 102 | int tempSyncStat() const; |
103 | void setIDStr( const QString & ); | 103 | void setIDStr( const QString & ); |
104 | const QString IDStr() const; | 104 | const QString IDStr() const; |
105 | void setID( const QString &, const QString & ); | 105 | void setID( const QString &, const QString & ); |
106 | const QString getID( const QString & ) const; | 106 | const QString getID( const QString & ) const; |
107 | void setCsum( const QString &, const QString & ); | 107 | void setCsum( const QString &, const QString & ); |
108 | const QString getCsum( const QString & ) const ; | 108 | const QString getCsum( const QString & ) const ; |
109 | void removeID(const QString &); | 109 | void removeID(const QString &); |
110 | void computeCsum(const QString &dev); | 110 | void computeCsum(const QString &dev); |
111 | ulong getCsum4List( const QStringList & attList); | 111 | ulong getCsum4List( const QStringList & attList); |
112 | /** | 112 | /** |
113 | Return, if the address book entry is empty. | 113 | Return, if the address book entry is empty. |
114 | */ | 114 | */ |
115 | bool isEmpty() const; | 115 | bool isEmpty() const; |
116 | void setExternalUID( const QString &id ); | 116 | void setExternalUID( const QString &id ); |
117 | const QString externalUID() const; | 117 | const QString externalUID() const; |
118 | void setOriginalExternalUID( const QString &id ); | 118 | void setOriginalExternalUID( const QString &id ); |
119 | QString originalExternalUID() const; | 119 | QString originalExternalUID() const; |
120 | void mergeContact( const Addressee& ad, bool isSubSet ); | 120 | void mergeContact( const Addressee& ad, bool isSubSet ); |
121 | void mergeOLContact( const Addressee& ad ); | ||
121 | void simplifyEmails(); | 122 | void simplifyEmails(); |
122 | void simplifyAddresses(); | 123 | void simplifyAddresses(); |
123 | void simplifyPhoneNumbers(); | 124 | void simplifyPhoneNumbers(); |
124 | void simplifyPhoneNumberTypes(); | 125 | void simplifyPhoneNumberTypes(); |
125 | void makePhoneNumbersOLcompatible(); | 126 | void makePhoneNumbersOLcompatible(); |
126 | int hasPhoneNumberType( int type ); | 127 | int hasPhoneNumberType( int type ); |
127 | bool removeVoice(); | 128 | bool removeVoice(); |
128 | bool containsAdr(const Addressee& addr ); | 129 | bool containsAdr(const Addressee& addr ); |
129 | 130 | ||
130 | /** | 131 | /** |
131 | Set unique identifier. | 132 | Set unique identifier. |
132 | */ | 133 | */ |
133 | void setUid( const QString &uid ); | 134 | void setUid( const QString &uid ); |
134 | /** | 135 | /** |
135 | Return unique identifier. | 136 | Return unique identifier. |
136 | */ | 137 | */ |
137 | const QString uid() const; | 138 | const QString uid() const; |
138 | /** | 139 | /** |
139 | Return translated label for uid field. | 140 | Return translated label for uid field. |
140 | */ | 141 | */ |
141 | static QString uidLabel(); | 142 | static QString uidLabel(); |
142 | 143 | ||
143 | /** | 144 | /** |
144 | Set name. | 145 | Set name. |
145 | */ | 146 | */ |
146 | void setName( const QString &name ); | 147 | void setName( const QString &name ); |
147 | /** | 148 | /** |
148 | Return name. | 149 | Return name. |
149 | */ | 150 | */ |
150 | QString name() const; | 151 | QString name() const; |
151 | /** | 152 | /** |
152 | Return translated label for name field. | 153 | Return translated label for name field. |
153 | */ | 154 | */ |
154 | static QString nameLabel(); | 155 | static QString nameLabel(); |
155 | 156 | ||
156 | /** | 157 | /** |
157 | Set formatted name. | 158 | Set formatted name. |
158 | */ | 159 | */ |
159 | void setFormattedName( const QString &formattedName ); | 160 | void setFormattedName( const QString &formattedName ); |
160 | /** | 161 | /** |
161 | Return formatted name. | 162 | Return formatted name. |
162 | */ | 163 | */ |
163 | QString formattedName() const; | 164 | QString formattedName() const; |
164 | /** | 165 | /** |
165 | Return translated label for formattedName field. | 166 | Return translated label for formattedName field. |
166 | */ | 167 | */ |
167 | static QString formattedNameLabel(); | 168 | static QString formattedNameLabel(); |
168 | 169 | ||
@@ -602,181 +603,182 @@ class Addressee | |||
602 | Insert an email address. If the email address already exists in this | 603 | Insert an email address. If the email address already exists in this |
603 | addressee it is not duplicated. | 604 | addressee it is not duplicated. |
604 | 605 | ||
605 | @param email Email address | 606 | @param email Email address |
606 | @param preferred Set to true, if this is the preferred email address of | 607 | @param preferred Set to true, if this is the preferred email address of |
607 | the addressee. | 608 | the addressee. |
608 | */ | 609 | */ |
609 | void insertEmail( const QString &email, bool preferred=false ); | 610 | void insertEmail( const QString &email, bool preferred=false ); |
610 | 611 | ||
611 | /** | 612 | /** |
612 | Remove email address. If the email address doesn't exist, nothing happens. | 613 | Remove email address. If the email address doesn't exist, nothing happens. |
613 | */ | 614 | */ |
614 | void removeEmail( const QString &email ); | 615 | void removeEmail( const QString &email ); |
615 | 616 | ||
616 | /** | 617 | /** |
617 | Return preferred email address. This is the first email address or the | 618 | Return preferred email address. This is the first email address or the |
618 | last one added with @ref insertEmail() with a set preferred parameter. | 619 | last one added with @ref insertEmail() with a set preferred parameter. |
619 | */ | 620 | */ |
620 | QString preferredEmail() const; | 621 | QString preferredEmail() const; |
621 | 622 | ||
622 | /** | 623 | /** |
623 | Return list of all email addresses. | 624 | Return list of all email addresses. |
624 | */ | 625 | */ |
625 | QStringList emails() const; | 626 | QStringList emails() const; |
626 | 627 | ||
627 | /** | 628 | /** |
628 | Set the emails to @param. | 629 | Set the emails to @param. |
629 | The first email address gets the preferred one! | 630 | The first email address gets the preferred one! |
630 | @param list The list of email addresses. | 631 | @param list The list of email addresses. |
631 | */ | 632 | */ |
632 | void setEmails( const QStringList& list); | 633 | void setEmails( const QStringList& list); |
633 | 634 | ||
634 | /** | 635 | /** |
635 | Insert a phone number. If a phone number with the same id already exists | 636 | Insert a phone number. If a phone number with the same id already exists |
636 | in this addressee it is not duplicated. | 637 | in this addressee it is not duplicated. |
637 | */ | 638 | */ |
638 | void insertPhoneNumber( const PhoneNumber &phoneNumber ); | 639 | void insertPhoneNumber( const PhoneNumber &phoneNumber ); |
639 | 640 | ||
640 | /** | 641 | /** |
641 | Remove phone number. If no phone number with the given id exists for this | 642 | Remove phone number. If no phone number with the given id exists for this |
642 | addresse nothing happens. | 643 | addresse nothing happens. |
643 | */ | 644 | */ |
644 | void removePhoneNumber( const PhoneNumber &phoneNumber ); | 645 | void removePhoneNumber( const PhoneNumber &phoneNumber ); |
645 | 646 | ||
646 | /** | 647 | /** |
647 | Return phone number, which matches the given type. | 648 | Return phone number, which matches the given type. |
648 | */ | 649 | */ |
649 | PhoneNumber phoneNumber( int type ) const; | 650 | PhoneNumber phoneNumber( int type ) const; |
651 | QString phoneNumberString( int type ) const; | ||
650 | 652 | ||
651 | bool matchPhoneNumber( QRegExp* searchExp ) const; | 653 | bool matchPhoneNumber( QRegExp* searchExp ) const; |
652 | bool matchAddress( QRegExp* searchExp ) const; | 654 | bool matchAddress( QRegExp* searchExp ) const; |
653 | 655 | ||
654 | /** | 656 | /** |
655 | Return list of all phone numbers. | 657 | Return list of all phone numbers. |
656 | */ | 658 | */ |
657 | PhoneNumber::List phoneNumbers() const; | 659 | PhoneNumber::List phoneNumbers() const; |
658 | 660 | ||
659 | /** | 661 | /** |
660 | Return list of phone numbers with a special type. | 662 | Return list of phone numbers with a special type. |
661 | */ | 663 | */ |
662 | PhoneNumber::List phoneNumbers( int type ) const; | 664 | PhoneNumber::List phoneNumbers( int type ) const; |
663 | 665 | ||
664 | /** | 666 | /** |
665 | Return phone number with the given id. | 667 | Return phone number with the given id. |
666 | */ | 668 | */ |
667 | PhoneNumber findPhoneNumber( const QString &id ) const; | 669 | PhoneNumber findPhoneNumber( const QString &id ) const; |
668 | 670 | ||
669 | /** | 671 | /** |
670 | Insert a key. If a key with the same id already exists | 672 | Insert a key. If a key with the same id already exists |
671 | in this addressee it is not duplicated. | 673 | in this addressee it is not duplicated. |
672 | */ | 674 | */ |
673 | void insertKey( const Key &key ); | 675 | void insertKey( const Key &key ); |
674 | 676 | ||
675 | /** | 677 | /** |
676 | Remove a key. If no key with the given id exists for this | 678 | Remove a key. If no key with the given id exists for this |
677 | addresse nothing happens. | 679 | addresse nothing happens. |
678 | */ | 680 | */ |
679 | void removeKey( const Key &key ); | 681 | void removeKey( const Key &key ); |
680 | 682 | ||
681 | /** | 683 | /** |
682 | Return key, which matches the given type. | 684 | Return key, which matches the given type. |
683 | If @p type == Key::Custom you can specify a string | 685 | If @p type == Key::Custom you can specify a string |
684 | that should match. If you leave the string empty, the first | 686 | that should match. If you leave the string empty, the first |
685 | key with a custom value is returned. | 687 | key with a custom value is returned. |
686 | */ | 688 | */ |
687 | Key key( int type, QString customTypeString = QString::null ) const; | 689 | Key key( int type, QString customTypeString = QString::null ) const; |
688 | 690 | ||
689 | /** | 691 | /** |
690 | Return list of all keys. | 692 | Return list of all keys. |
691 | */ | 693 | */ |
692 | Key::List keys() const; | 694 | Key::List keys() const; |
693 | 695 | ||
694 | /** | 696 | /** |
695 | Set the list of keys | 697 | Set the list of keys |
696 | @param keys The keys to be set. | 698 | @param keys The keys to be set. |
697 | */ | 699 | */ |
698 | void setKeys( const Key::List& keys); | 700 | void setKeys( const Key::List& keys); |
699 | 701 | ||
700 | /** | 702 | /** |
701 | Return list of keys with a special type. | 703 | Return list of keys with a special type. |
702 | If @p type == Key::Custom you can specify a string | 704 | If @p type == Key::Custom you can specify a string |
703 | that should match. If you leave the string empty, all custom | 705 | that should match. If you leave the string empty, all custom |
704 | keys will be returned. | 706 | keys will be returned. |
705 | */ | 707 | */ |
706 | Key::List keys( int type, QString customTypeString = QString::null ) const; | 708 | Key::List keys( int type, QString customTypeString = QString::null ) const; |
707 | 709 | ||
708 | /** | 710 | /** |
709 | Return key with the given id. | 711 | Return key with the given id. |
710 | */ | 712 | */ |
711 | Key findKey( const QString &id ) const; | 713 | Key findKey( const QString &id ) const; |
712 | 714 | ||
713 | /** | 715 | /** |
714 | Insert an address. If an address with the same id already exists | 716 | Insert an address. If an address with the same id already exists |
715 | in this addressee it is not duplicated. | 717 | in this addressee it is not duplicated. |
716 | */ | 718 | */ |
717 | void insertAddress( const Address &address ); | 719 | void insertAddress( const Address &address ); |
718 | 720 | ||
719 | /** | 721 | /** |
720 | Remove address. If no address with the given id exists for this | 722 | Remove address. If no address with the given id exists for this |
721 | addresse nothing happens. | 723 | addresse nothing happens. |
722 | */ | 724 | */ |
723 | void removeAddress( const Address &address ); | 725 | void removeAddress( const Address &address ); |
724 | 726 | ||
725 | /** | 727 | /** |
726 | Return address, which matches the given type. | 728 | Return address, which matches the given type. |
727 | */ | 729 | */ |
728 | Address address( int type ) const; | 730 | Address address( int type ) const; |
729 | 731 | ||
730 | /** | 732 | /** |
731 | Return list of all addresses. | 733 | Return list of all addresses. |
732 | */ | 734 | */ |
733 | Address::List addresses() const; | 735 | Address::List addresses() const; |
734 | 736 | Address otherAddress() const; | |
735 | /** | 737 | /** |
736 | Return list of addresses with a special type. | 738 | Return list of addresses with a special type. |
737 | */ | 739 | */ |
738 | Address::List addresses( int type ) const; | 740 | Address::List addresses( int type ) const; |
739 | 741 | ||
740 | /** | 742 | /** |
741 | Return address with the given id. | 743 | Return address with the given id. |
742 | */ | 744 | */ |
743 | Address findAddress( const QString &id ) const; | 745 | Address findAddress( const QString &id ) const; |
744 | 746 | ||
745 | /** | 747 | /** |
746 | Insert category. If the category already exists it is not duplicated. | 748 | Insert category. If the category already exists it is not duplicated. |
747 | */ | 749 | */ |
748 | void insertCategory( const QString & ); | 750 | void insertCategory( const QString & ); |
749 | 751 | ||
750 | /** | 752 | /** |
751 | Remove category. | 753 | Remove category. |
752 | */ | 754 | */ |
753 | void removeCategory( const QString & ); | 755 | void removeCategory( const QString & ); |
754 | 756 | ||
755 | /** | 757 | /** |
756 | Return, if addressee has the given category. | 758 | Return, if addressee has the given category. |
757 | */ | 759 | */ |
758 | bool hasCategory( const QString & ) const; | 760 | bool hasCategory( const QString & ) const; |
759 | 761 | ||
760 | /** | 762 | /** |
761 | Set categories to given value. | 763 | Set categories to given value. |
762 | */ | 764 | */ |
763 | void setCategories( const QStringList & ); | 765 | void setCategories( const QStringList & ); |
764 | 766 | ||
765 | /** | 767 | /** |
766 | Return list of all set categories. | 768 | Return list of all set categories. |
767 | */ | 769 | */ |
768 | QStringList categories() const; | 770 | QStringList categories() const; |
769 | 771 | ||
770 | /** | 772 | /** |
771 | Insert custom entry. The entry is identified by the name of the inserting | 773 | Insert custom entry. The entry is identified by the name of the inserting |
772 | application and a unique name. If an entry with the given app and name | 774 | application and a unique name. If an entry with the given app and name |
773 | already exists its value is replaced with the new given value. | 775 | already exists its value is replaced with the new given value. |
774 | */ | 776 | */ |
775 | void insertCustom( const QString &app, const QString &name, | 777 | void insertCustom( const QString &app, const QString &name, |
776 | const QString &value ); | 778 | const QString &value ); |
777 | 779 | ||
778 | /** | 780 | /** |
779 | Remove custom entry. | 781 | Remove custom entry. |
780 | */ | 782 | */ |
781 | void removeCustom( const QString &app, const QString &name ); | 783 | void removeCustom( const QString &app, const QString &name ); |
782 | 784 | ||