addressee.src.h
/*
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., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KABC_ADDRESSEE_H
#define KABC_ADDRESSEE_H
#include <qdatetime.h>
#include <qstring.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;
class Field;
class SortMode;
class KABC_EXPORT Addressee
{
friend KABC_EXPORT QDataStream &operator<<( QDataStream &, const Addressee & );
friend KABC_EXPORT QDataStream &operator>>( QDataStream &, Addressee & );
public:
typedef QValueList<Addressee> List;
typedef QMap<QString, Addressee> Map;
Addressee();
~Addressee();
Addressee( const Addressee & );
Addressee &operator=( const Addressee & );
bool operator==( const Addressee & ) const;
bool operator!=( const Addressee & ) const;
bool isEmpty() const;
void setUid( const QString &uid );
QString uid() const;
static QString uidLabel();
--DECLARATIONS--
void setNameFromString( const QString & );
QString realName() const;
QString assembledName() const;
QString fullEmail( const QString &email=QString::null ) const;
void insertEmail( const QString &email, bool preferred=false );
void removeEmail( const QString &email );
QString preferredEmail() const;
QStringList emails() const;
void setEmails( const QStringList& list);
void insertPhoneNumber( const PhoneNumber &phoneNumber );
void removePhoneNumber( const PhoneNumber &phoneNumber );
PhoneNumber phoneNumber( int type ) const;
PhoneNumber::List phoneNumbers() const;
PhoneNumber::List phoneNumbers( int type ) const;
PhoneNumber findPhoneNumber( const QString &id ) const;
void insertKey( const Key &key );
void removeKey( const Key &key );
Key key( int type, QString customTypeString = QString::null ) const;
Key::List keys() const;
void setKeys( const Key::List& keys);
Key::List keys( int type, QString customTypeString = QString::null ) const;
Key findKey( const QString &id ) const;
void insertAddress( const Address &address );
void removeAddress( const Address &address );
Address address( int type ) const;
Address::List addresses() const;
Address::List addresses( int type ) const;
Address findAddress( const QString &id ) const;
void insertCategory( const QString & );
void removeCategory( const QString & );
bool hasCategory( const QString & ) const;
void setCategories( const QStringList & );
QStringList categories() const;
void insertCustom( const QString &app, const QString &name,
const QString &value );
void removeCustom( const QString &app, const QString &name );
QString custom( const QString &app, const QString &name ) const;
void setCustoms( const QStringList & );
QStringList customs() const;
static void parseEmailAddress( const QString &rawEmail, QString &fullName,
QString &email );
void dump() const;
QString asString() const;
void setResource( Resource *resource );
Resource *resource() const;
void setChanged( bool value );
bool changed() const;
static void setSortMode( KABC::SortMode *mode );
bool operator< ( const Addressee &addr );
private:
void detach();
struct AddresseeData;
mutable KSharedPtr<AddresseeData> mData;
private:
static AddresseeData* shared_null;
static AddresseeData* makeSharedNull();
static KABC::SortMode *mSortMode;
};
KABC_EXPORT QDataStream &operator<<( QDataStream &, const Addressee & );
KABC_EXPORT QDataStream &operator>>( QDataStream &, Addressee & );
}
#endif
KSharedPtr< AddresseeData >
KABC::Address
Postal address information.
Definition: address.h:55
KABC::PhoneNumber
Phonenumber information.
Definition: phonenumber.h:38
KABC::Address::List
QValueList< Address > List
List of addresses.
Definition: address.h:64
KABC::SortMode
Sort method for sorting an addressee list.
Definition: sortmode.h:36
KABC::Key
A class to store an encryption key.
Definition: key.h:33
KABC::Addressee
address book entry
Definition: addressee.src.h:74
operator<<
kdbgstream & operator<<(const QValueList< T > &list)

KDE Home | KDE Accessibility Home | Description of Access Keys