kabc Library API Documentation

addressee.src.h

00001 /*
00002     This file is part of libkabc.
00003     Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public License
00016     along with this library; see the file COPYING.LIB.  If not, write to
00017     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018     Boston, MA 02111-1307, USA.
00019 */
00020 
00021 #ifndef KABC_ADDRESSEE_H
00022 #define KABC_ADDRESSEE_H
00023 
00024 #include <qdatetime.h>
00025 #include <qstring.h>
00026 #include <qstringlist.h>
00027 #include <qvaluelist.h>
00028 
00029 #include <ksharedptr.h>
00030 #include <kurl.h>
00031 
00032 #include "address.h"
00033 #include "agent.h"
00034 #include "geo.h"
00035 #include "key.h"
00036 #include "phonenumber.h"
00037 #include "picture.h"
00038 #include "secrecy.h"
00039 #include "sound.h"
00040 #include "timezone.h"
00041 
00042 namespace KABC {
00043 
00044 class Resource;
00045 
00072 class Addressee
00073 {
00074     friend QDataStream &operator<<( QDataStream &, const Addressee & );
00075     friend QDataStream &operator>>( QDataStream &, Addressee & );
00076 
00077   public:
00078     typedef QValueList<Addressee> List;
00079 
00083     Addressee();
00084     ~Addressee();
00085 
00086     Addressee( const Addressee & );
00087     Addressee &operator=( const Addressee & );
00088 
00089     bool operator==( const Addressee & ) const;
00090     bool operator!=( const Addressee & ) const;
00091 
00095     bool isEmpty() const;
00096 
00097     --DECLARATIONS--
00103     void setNameFromString( const QString & );
00104 
00109     QString realName() const;
00110 
00114     QString assembledName() const;
00115     
00122     QString fullEmail( const QString &email=QString::null ) const;
00123     
00132     void insertEmail( const QString &email, bool preferred=false );
00133 
00137     void removeEmail( const QString &email );
00138 
00143     QString preferredEmail() const;
00144 
00148     QStringList emails() const;
00149     
00154     void insertPhoneNumber( const PhoneNumber &phoneNumber );
00155 
00160     void removePhoneNumber( const PhoneNumber &phoneNumber );
00161 
00165     PhoneNumber phoneNumber( int type ) const;
00166 
00170     PhoneNumber::List phoneNumbers() const;
00171 
00175     PhoneNumber::List phoneNumbers( int type ) const;
00176 
00180     PhoneNumber findPhoneNumber( const QString &id ) const;
00181 
00186     void insertKey( const Key &key );
00187 
00192     void removeKey( const Key &key );
00193 
00200     Key key( int type, QString customTypeString = QString::null ) const;
00201 
00205     Key::List keys() const;
00206 
00213     Key::List keys( int type, QString customTypeString = QString::null  ) const;
00214 
00218     Key findKey( const QString &id ) const;
00219     
00224     void insertAddress( const Address &address );
00225 
00230     void removeAddress( const Address &address );
00231 
00235     Address address( int type ) const;
00236 
00240     Address::List addresses() const;
00241 
00245     Address::List addresses( int type ) const;
00246     
00250     Address findAddress( const QString &id ) const;
00251 
00255     void insertCategory( const QString & );
00256 
00260     void removeCategory( const QString & );
00261 
00265     bool hasCategory( const QString & ) const;
00266 
00270     void setCategories( const QStringList & );
00271 
00275     QStringList categories() const;
00276 
00282     void insertCustom( const QString &app, const QString &name,
00283                        const QString &value );
00284 
00288     void removeCustom( const QString &app, const QString &name );
00289 
00293     QString custom( const QString &app, const QString &name ) const;
00294 
00298     void setCustoms( const QStringList & );
00299 
00303     QStringList customs() const;
00304 
00308     static void parseEmailAddress( const QString &rawEmail, QString &fullName,
00309                                    QString &email );
00310 
00314     void dump() const;
00315 
00319     QString asString() const;
00320 
00324     void setResource( Resource *resource );
00325 
00329     Resource *resource() const;
00330   
00334     void setChanged( bool value );
00335 
00339       bool changed() const;
00340 
00341   private:
00342     Addressee copy();
00343     void detach();
00344 
00345     struct AddresseeData;
00346     KSharedPtr<AddresseeData> mData;
00347 };
00348 
00349 QDataStream &operator<<( QDataStream &, const Addressee & );
00350 QDataStream &operator>>( QDataStream &, Addressee & );
00351 
00352 }
00353 
00354 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:22:07 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001