-rw-r--r-- | kabc/address.cpp | 27 | ||||
-rw-r--r-- | kabc/address.h | 2 | ||||
-rw-r--r-- | kabc/addressee.cpp | 25 | ||||
-rw-r--r-- | kabc/addressee.h | 4 |
4 files changed, 58 insertions, 0 deletions
diff --git a/kabc/address.cpp b/kabc/address.cpp index 5ffe511..6151f9e 100644 --- a/kabc/address.cpp +++ b/kabc/address.cpp @@ -8,192 +8,219 @@ version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Enhanced Version of the file for platform independent KDE tools. Copyright (c) 2004 Ulf Schenk $Id$ */ //US added kglobal.h #include <kglobal.h> #include <kapplication.h> #include <kdebug.h> #include <klocale.h> #include <ksimpleconfig.h> #include <kstandarddirs.h> #include <qfile.h> #include "address.h" using namespace KABC; QMap<QString, QString> Address::mISOMap; Address::Address() : mEmpty( true ), mType( 0 ) { mId = KApplication::randomString( 10 ); } Address::Address( int type ) : mEmpty( true ), mType( type ) { mId = KApplication::randomString( 10 ); } bool Address::operator==( const Address &a ) const { if ( mPostOfficeBox != a.mPostOfficeBox ) return false; if ( mExtended != a.mExtended ) return false; if ( mStreet != a.mStreet ) return false; if ( mLocality != a.mLocality ) return false; if ( mRegion != a.mRegion ) return false; if ( mPostalCode != a.mPostalCode ) return false; if ( mCountry != a.mCountry ) return false; if ( mLabel != a.mLabel ) return false; return true; } bool Address::operator!=( const Address &a ) const { return !( a == *this ); } bool Address::isEmpty() const { if ( mPostOfficeBox.isEmpty() && mExtended.isEmpty() && mStreet.isEmpty() && mLocality.isEmpty() && mRegion.isEmpty() && mPostalCode.isEmpty() && mCountry.isEmpty() && mLabel.isEmpty() ) { return true; } return false; } QStringList Address::asList() { QStringList result; if ( ! mPostOfficeBox.isEmpty() )result.append(mPostOfficeBox); if ( ! mExtended.isEmpty())result.append(mExtended); if ( ! mStreet.isEmpty())result.append(mStreet); if ( ! mLocality.isEmpty() )result.append(mLocality); if ( ! mRegion.isEmpty())result.append(mRegion); if ( ! mPostalCode.isEmpty())result.append(mPostalCode); if ( ! mCountry.isEmpty())result.append(mCountry); if ( ! mLabel.isEmpty() )result.append(mLabel); return result; } + +bool Address::matchAddress( QRegExp* re ) const +{ + +#if QT_VERSION >= 0x030000 + if (re->search( mPostOfficeBox ) == 0) return true; + if (re->search( mExtended ) == 0) return true; + if (re->search( mStreet ) == 0) return true; + if (re->search( mLocality ) == 0) return true; + if (re->search( mRegion ) == 0) return true; + if (re->search( mPostalCode ) == 0) return true; + if (re->search( mCountry ) == 0) return true; + if (re->search( mLabel ) == 0) return true; +#else + if (re->match( mPostOfficeBox ) == 0) return true; + if (re->match( mExtended ) == 0) return true; + if (re->match( mStreet ) == 0) return true; + if (re->match( mLocality ) == 0) return true; + if (re->match( mRegion ) == 0) return true; + if (re->match( mPostalCode ) == 0) return true; + if (re->match( mCountry ) == 0) return true; + if (re->match( mLabel ) == 0) return true; +#endif + + return false; +} + void Address::clear() { *this = Address(); } void Address::setId( const QString &id ) { mEmpty = false; mId = id; } QString Address::id() const { return mId; } void Address::setType( int type ) { mEmpty = false; mType = type; } int Address::type() const { return mType; } QString Address::typeLabel() const { QString label; bool first = true; TypeList list = typeList(); TypeList::Iterator it; for ( it = list.begin(); it != list.end(); ++it ) { if ( ( type() & (*it) ) && ( (*it) != Pref ) ) { label.append( ( first ? "" : "/" ) + typeLabel( *it ) ); if ( first ) first = false; } } return label; } void Address::setPostOfficeBox( const QString &s ) { mEmpty = false; mPostOfficeBox = s; } QString Address::postOfficeBox() const { return mPostOfficeBox; } QString Address::postOfficeBoxLabel() { return i18n("Post Office Box"); } void Address::setExtended( const QString &s ) { mEmpty = false; mExtended = s; } QString Address::extended() const { return mExtended; } QString Address::extendedLabel() { return i18n("Extended Address Information"); } void Address::setStreet( const QString &s ) { mEmpty = false; mStreet = s; } QString Address::street() const { return mStreet; } diff --git a/kabc/address.h b/kabc/address.h index 37dd851..38ad20b 100644 --- a/kabc/address.h +++ b/kabc/address.h @@ -1,193 +1,195 @@ /* This file is part of libkabc. Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Enhanced Version of the file for platform independent KDE tools. Copyright (c) 2004 Ulf Schenk $Id$ */ #ifndef KABC_ADDRESS_H #define KABC_ADDRESS_H #include <qmap.h> #include <qstring.h> +#include <qregexp.h> #include <qstringlist.h> #include <qvaluelist.h> // template tags for address formatting localization #define KABC_FMTTAG_realname QString("%n") #define KABC_FMTTAG_REALNAME QString("%N") #define KABC_FMTTAG_company QString("%cm") #define KABC_FMTTAG_COMPANY QString("%CM") #define KABC_FMTTAG_pobox QString("%p") #define KABC_FMTTAG_street QString("%s") #define KABC_FMTTAG_STREET QString("%S") #define KABC_FMTTAG_zipcode QString("%z") #define KABC_FMTTAG_location QString("%l") #define KABC_FMTTAG_LOCATION QString("%L") #define KABC_FMTTAG_region QString("%r") #define KABC_FMTTAG_REGION QString("%R") #define KABC_FMTTAG_newline QString("\\n") #define KABC_FMTTAG_condcomma QString("%,") #define KABC_FMTTAG_condwhite QString("%w") #define KABC_FMTTAG_purgeempty QString("%0") namespace KABC { /** @short Postal address information. This class represents information about a postal address. */ class Address { friend QDataStream &operator<<( QDataStream &, const Address & ); friend QDataStream &operator>>( QDataStream &, Address & ); public: /** List of addresses. */ typedef QValueList<Address> List; typedef QValueList<int> TypeList; /** Address types: @li @p Dom - domestic @li @p Intl - international @li @p Postal - postal @li @p Parcel - parcel @li @p Home - home address @li @p Work - address at work @li @p Pref - preferred address */ enum Type { Dom = 1, Intl = 2, Postal = 4, Parcel = 8, Home = 16, Work = 32, Pref = 64 }; /** Constructor that creates an empty Address, which is initialized with a unique id (see @ref id()). */ Address(); /** This is like @ref Address() just above, with the difference that you can specify the type. */ Address( int ); + bool matchAddress( QRegExp* searchExp ) const; bool operator==( const Address & ) const; bool operator!=( const Address & ) const; /** Returns true, if the address is empty. */ bool isEmpty() const; /** Clears all entries of the address. */ void clear(); QStringList asList(); /** Sets the unique id. */ void setId( const QString & ); /* Returns the unique id. */ QString id() const; /** Sets the type of address. See enum for definiton of types. @param type type, can be a bitwise or of multiple types. */ void setType( int type ); /** Returns the type of address. Can be a bitwise or of multiple types. */ int type() const; /** Returns a translated string of all types the address has. */ QString typeLabel() const; /** Sets the post office box. */ void setPostOfficeBox( const QString & ); /** Returns the post office box. */ QString postOfficeBox() const; /** Returns the translated label for post office box field. */ static QString postOfficeBoxLabel(); /** Sets the extended address information. */ void setExtended( const QString & ); /** Returns the extended address information. */ QString extended() const; /** Returns the translated label for extended field. */ static QString extendedLabel(); /** Sets the street (including number). */ void setStreet( const QString & ); /** Returns the street. */ QString street() const; /** Returns the translated label for street field. */ static QString streetLabel(); /** Sets the locality, e.g. city. */ void setLocality( const QString & ); /** Returns the locality. */ QString locality() const; diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index 155ce24..7e1e414 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp @@ -213,193 +213,218 @@ void Addressee::computeCsum(const QString &dev) //if ( !mData->name.isEmpty() ) l.append(mData->name); //if ( !mData->formattedName.isEmpty() ) l.append(mData->formattedName ); if ( !mData->familyName.isEmpty() ) l.append( mData->familyName ); if ( !mData->givenName.isEmpty() ) l.append(mData->givenName ); if ( !mData->additionalName.isEmpty() ) l.append( mData->additionalName ); if ( !mData->prefix.isEmpty() ) l.append( mData->prefix ); if ( !mData->suffix.isEmpty() ) l.append( mData->suffix ); if ( !mData->nickName.isEmpty() ) l.append( mData->nickName ); if ( mData->birthday.isValid() ) l.append( mData->birthday.toString() ); if ( !mData->mailer.isEmpty() ) l.append( mData->mailer ); if ( mData->timeZone.isValid() ) l.append( mData->timeZone.asString() ); if ( mData->geo.isValid() ) l.append( mData->geo.asString() ); if ( !mData->title .isEmpty() ) l.append( mData->title ); if ( !mData->role.isEmpty() ) l.append( mData->role ); if ( !mData->organization.isEmpty() ) l.append( mData->organization ); if ( !mData->note.isEmpty() ) l.append( mData->note ); if ( !mData->productId.isEmpty() ) l.append(mData->productId ); if ( !mData->sortString.isEmpty() ) l.append( mData->sortString ); if ( mData->secrecy.isValid() ) l.append( mData->secrecy.asString()); if ( !mData->logo.undefined() ) { if ( !mData->logo.isIntern() ) l.append( mData->logo.url() ); else l.append( QString::number(mData->logo.data().width()* mData->logo.data().height())); } else { l.append( "nologo"); } if ( !mData->photo.undefined() ) { if ( !mData->photo.isIntern() ) l.append( mData->photo.url() ); else l.append( QString::number(mData->photo.data().width()* mData->photo.data().height())); } else { l.append( "nophoto"); } #if 0 if ( !mData->sound.undefined() ) { if ( !mData->sound.isIntern() ) l.append( mData->sound.url() ); else l.append( QString(mData->sound.data().with()* mData->sound.data().height())); } else { l.append( "nosound"); } #endif //if ( !mData->agent.isEmpty() ) l.append( ); if ( mData->url.isValid() ) if ( ! mData->url.path().isEmpty()) l.append( mData->url.path() ); KABC::PhoneNumber::List phoneNumbers; KABC::PhoneNumber::List::Iterator phoneIter; QStringList t; for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); ++phoneIter ) t.append( ( *phoneIter ).number()+QString::number( ( *phoneIter ).type() ) ); t.sort(); uint iii; for ( iii = 0; iii < t.count(); ++iii) l.append( t[iii] ); t = mData->emails; t.sort(); for ( iii = 0; iii < t.count(); ++iii) l.append( t[iii] ); t = mData->categories; t.sort(); for ( iii = 0; iii < t.count(); ++iii) l.append( t[iii] ); t = mData->custom; t.sort(); for ( iii = 0; iii < t.count(); ++iii) if ( t[iii].left( 25 ) != "KADDRESSBOOK-X-ExternalID" ) { int find = t[iii].find (':')+1; //qDebug("lennnn %d %d ", find, t[iii].length()); if ( find < t[iii].length()) l.append( t[iii] ); } KABC::Address::List::Iterator addressIter; for ( addressIter = mData->addresses.begin(); addressIter != mData->addresses.end(); ++addressIter ) { t = (*addressIter).asList(); t.sort(); for ( iii = 0; iii < t.count(); ++iii) l.append( t[iii] ); } uint cs = getCsum4List(l); #if 0 for ( iii = 0; iii < l.count(); ++iii) qDebug("%d***%s***",iii,l[iii].latin1()); qDebug("CSUM computed %d %s %s", cs,QString::number (cs ).latin1(), uid().latin1() ); #endif setCsum( dev, QString::number (cs )); } +bool Addressee::matchAddress( QRegExp* re ) const +{ + KABC::Address::List::Iterator addressIter; + for ( addressIter = mData->addresses.begin(); addressIter != mData->addresses.end(); + ++addressIter ) { + if ( (*addressIter).matchAddress( re ) ) + return true; + } + return false; +} +bool Addressee::matchPhoneNumber( QRegExp* re ) const +{ + KABC::PhoneNumber::List::Iterator phoneIter; + + for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); ++phoneIter ) { +#if QT_VERSION >= 0x030000 + if (re->search( (*phoneIter).number() ) == 0) +#else + if (re->match( (*phoneIter).number() ) == 0) +#endif + return true; + } + return false; + +} void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) { // merge all standard non-outlook fields. //if isSubSet (e.g. mobile phone sync) merge all fields detach(); if ( isSubSet ) { if ( mData->name.isEmpty() ) mData->name = ad.mData->name; if ( mData->formattedName.isEmpty() ) mData->formattedName = ad.mData->formattedName; if ( mData->familyName.isEmpty() ) mData->familyName = ad.mData->familyName; if ( mData->givenName.isEmpty() ) mData->givenName = ad.mData->givenName ; if ( mData->additionalName ) mData->additionalName = ad.mData->additionalName; if ( mData->prefix.isEmpty() ) mData->prefix = ad.mData->prefix; if ( mData->suffix.isEmpty() ) mData->suffix = ad.mData->suffix; if ( mData->title .isEmpty() ) mData->title = ad.mData->title ; if ( mData->role.isEmpty() ) mData->role = ad.mData->role ; if ( mData->nickName.isEmpty() ) mData->nickName = ad.mData->nickName; if ( mData->organization.isEmpty() ) mData->organization = ad.mData->organization ; if ( mData->note.isEmpty() ) mData->note = ad.mData->note ; if ( !mData->secrecy.isValid() ) mData->secrecy = ad.mData->secrecy; if ( ( !mData->url.isValid() && ad.mData->url.isValid() ) ) mData->url = ad.mData->url ; if ( !mData->birthday.isValid() ) if ( ad.mData->birthday.isValid()) mData->birthday = ad.mData->birthday; } if ( mData->mailer.isEmpty() ) mData->mailer = ad.mData->mailer; if ( !mData->timeZone.isValid() ) mData->timeZone = ad.mData->timeZone; if ( !mData->geo.isValid() ) mData->geo = ad.mData->geo; if ( mData->productId.isEmpty() ) mData->productId = ad.mData->productId; if ( mData->sortString.isEmpty() ) mData->sortString = ad.mData->sortString; QStringList t; QStringList tAD; uint iii; // ********** phone numbers if ( isSubSet ) { PhoneNumber::List phoneAD = ad.phoneNumbers(); PhoneNumber::List::Iterator phoneItAD; for ( phoneItAD = phoneAD.begin(); phoneItAD != phoneAD.end(); ++phoneItAD ) { bool found = false; PhoneNumber::List::Iterator it; for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { if ( ( *phoneItAD ).contains( (*it) ) ) { found = true; (*it).setType( ( *phoneItAD ).type() ); (*it).setNumber( ( *phoneItAD ).number() ); break; } } // if ( isSubSet && ! found ) if ( ! found ) // LR try this one... mData->phoneNumbers.append( *phoneItAD ); } } else { PhoneNumber::List phoneAD = ad.phoneNumbers(); PhoneNumber::List::Iterator phoneItAD; for ( phoneItAD = phoneAD.begin(); phoneItAD != phoneAD.end(); ++phoneItAD ) { bool found = false; PhoneNumber::List::Iterator it; for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { if ( ( *phoneItAD ).contains( (*it) ) ) { found = true; (*it).setType( ( *phoneItAD ).type() ); (*it).setNumber( ( *phoneItAD ).number() ); break; } } if ( ! found ) { // append numbers which do not have work or home type if ( ! ( ( *phoneItAD ).type() & (PhoneNumber::Work | PhoneNumber::Home) ) ) mData->phoneNumbers.append( *phoneItAD ); } } } if ( isSubSet ) { // ************* emails; t = mData->emails; tAD = ad.mData->emails; for ( iii = 0; iii < tAD.count(); ++iii) if ( !t.contains(tAD[iii] ) ) mData->emails.append( tAD[iii] ); } // ************* categories; if ( isSubSet ) { t = mData->categories; tAD = ad.mData->categories; for ( iii = 0; iii < tAD.count(); ++iii) if ( !t.contains(tAD[iii] ) ) mData->categories.append( tAD[iii] ); } QStringList::ConstIterator it; for( it = ad.mData->custom.begin(); it != ad.mData->custom.end(); ++it ) { QString qualifiedName = (*it).left( (*it).find( ":" )); bool found = false; QStringList::ConstIterator itL; diff --git a/kabc/addressee.h b/kabc/addressee.h index a2fbcf5..d1c07cb 100644 --- a/kabc/addressee.h +++ b/kabc/addressee.h @@ -1,129 +1,130 @@ /*** Warning! This file has been generated by the script makeaddressee ***/ /* This file is part of libkabc. Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Enhanced Version of the file for platform independent KDE tools. Copyright (c) 2004 Ulf Schenk $Id$ */ #ifndef KABC_ADDRESSEE_H #define KABC_ADDRESSEE_H #include <qdatetime.h> #include <qstring.h> +#include <qregexp.h> #include <qstringlist.h> #include <qvaluelist.h> #include <ksharedptr.h> #include <kurl.h> #include "address.h" #include "agent.h" #include "geo.h" #include "key.h" #include "phonenumber.h" #include "picture.h" #include "secrecy.h" #include "sound.h" #include "timezone.h" namespace KABC { class Resource; /** @short address book entry This class represents an entry in the address book. The data of this class is implicitly shared. You can pass this class by value. If you need the name of a field for presenting it to the user you should use the functions ending in Label(). They return a translated string which can be used as label for the corresponding field. About the name fields: givenName() is the first name and familyName() the last name. In some countries the family name comes first, that's the reason for the naming. formattedName() is the full name with the correct formatting. It is used as an override, when the correct formatting can't be generated from the other name fields automatically. realName() returns a fully formatted name(). It uses formattedName, if set, otherwise it constucts the name from the name fields. As fallback, if nothing else is set it uses name(). name() is the NAME type of RFC2426. It can be used as internal name for the data enty, but shouldn't be used for displaying the data to the user. */ class Addressee { friend QDataStream &operator<<( QDataStream &, const Addressee & ); friend QDataStream &operator>>( QDataStream &, Addressee & ); public: typedef QValueList<Addressee> List; /** Construct an empty address book entry. */ Addressee(); ~Addressee(); Addressee( const Addressee & ); Addressee &operator=( const Addressee & ); bool operator==( const Addressee & ) const; bool operator!=( const Addressee & ) const; // sync stuff void setTempSyncStat(int id); int tempSyncStat() const; void setIDStr( const QString & ); const QString IDStr() const; void setID( const QString &, const QString & ); const QString getID( const QString & ) const; void setCsum( const QString &, const QString & ); const QString getCsum( const QString & ) const ; void removeID(const QString &); void computeCsum(const QString &dev); ulong getCsum4List( const QStringList & attList); /** Return, if the address book entry is empty. */ bool isEmpty() const; void setExternalUID( const QString &id ); const QString externalUID() const; void setOriginalExternalUID( const QString &id ); QString originalExternalUID() const; void mergeContact( const Addressee& ad, bool isSubSet ); void simplifyEmails(); void simplifyAddresses(); void simplifyPhoneNumbers(); void simplifyPhoneNumberTypes(); bool removeVoice(); bool containsAdr(const Addressee& addr ); /** Set unique identifier. */ @@ -557,192 +558,195 @@ class Addressee */ Sound sound() const; /** Return translated label for sound field. */ static QString soundLabel(); /** Set agent. */ void setAgent( const Agent &agent ); /** Return agent. */ Agent agent() const; /** Return translated label for agent field. */ static QString agentLabel(); /** Set name fields by parsing the given string and trying to associate the parts of the string with according fields. This function should probably be a bit more clever. */ void setNameFromString( const QString & ); /** Return the name of the addressee. This is calculated from all the name fields. */ QString realName() const; /** Return the name that consists of all name parts. */ QString assembledName() const; /** Return email address including real name. @param email Email address to be used to construct the full email string. If this is QString::null the preferred email address is used. */ QString fullEmail( const QString &email=QString::null ) const; /** Insert an email address. If the email address already exists in this addressee it is not duplicated. @param email Email address @param preferred Set to true, if this is the preferred email address of the addressee. */ void insertEmail( const QString &email, bool preferred=false ); /** Remove email address. If the email address doesn't exist, nothing happens. */ void removeEmail( const QString &email ); /** Return preferred email address. This is the first email address or the last one added with @ref insertEmail() with a set preferred parameter. */ QString preferredEmail() const; /** Return list of all email addresses. */ QStringList emails() const; /** Set the emails to @param. The first email address gets the preferred one! @param list The list of email addresses. */ void setEmails( const QStringList& list); /** Insert a phone number. If a phone number with the same id already exists in this addressee it is not duplicated. */ void insertPhoneNumber( const PhoneNumber &phoneNumber ); /** Remove phone number. If no phone number with the given id exists for this addresse nothing happens. */ void removePhoneNumber( const PhoneNumber &phoneNumber ); /** Return phone number, which matches the given type. */ PhoneNumber phoneNumber( int type ) const; + bool matchPhoneNumber( QRegExp* searchExp ) const; + bool matchAddress( QRegExp* searchExp ) const; + /** Return list of all phone numbers. */ PhoneNumber::List phoneNumbers() const; /** Return list of phone numbers with a special type. */ PhoneNumber::List phoneNumbers( int type ) const; /** Return phone number with the given id. */ PhoneNumber findPhoneNumber( const QString &id ) const; /** Insert a key. If a key with the same id already exists in this addressee it is not duplicated. */ void insertKey( const Key &key ); /** Remove a key. If no key with the given id exists for this addresse nothing happens. */ void removeKey( const Key &key ); /** Return key, which matches the given type. If @p type == Key::Custom you can specify a string that should match. If you leave the string empty, the first key with a custom value is returned. */ Key key( int type, QString customTypeString = QString::null ) const; /** Return list of all keys. */ Key::List keys() const; /** Set the list of keys @param keys The keys to be set. */ void setKeys( const Key::List& keys); /** Return list of keys with a special type. If @p type == Key::Custom you can specify a string that should match. If you leave the string empty, all custom keys will be returned. */ Key::List keys( int type, QString customTypeString = QString::null ) const; /** Return key with the given id. */ Key findKey( const QString &id ) const; /** Insert an address. If an address with the same id already exists in this addressee it is not duplicated. */ void insertAddress( const Address &address ); /** Remove address. If no address with the given id exists for this addresse nothing happens. */ void removeAddress( const Address &address ); /** Return address, which matches the given type. */ Address address( int type ) const; /** Return list of all addresses. */ Address::List addresses() const; /** Return list of addresses with a special type. */ Address::List addresses( int type ) const; /** Return address with the given id. */ Address findAddress( const QString &id ) const; /** Insert category. If the category already exists it is not duplicated. */ void insertCategory( const QString & ); |