distributionlist.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_DISTRIBUTIONLIST_H
#define KABC_DISTRIBUTIONLIST_H
#include <kdirwatch.h>
#include "addressbook.h"
namespace KABC {
class DistributionListManager;
class KABC_EXPORT DistributionList
{
public:
struct Entry
{
typedef QValueList<Entry> List;
Entry() {}
Entry( const Addressee &_addressee, const QString &_email ) :
addressee( _addressee ), email( _email ) {}
Addressee addressee;
QString email;
};
DistributionList( DistributionListManager *manager, const QString &name );
~DistributionList();
void setName( const QString & );
QString name() const;
void insertEntry( const Addressee &, const QString &email=QString::null );
void removeEntry( const Addressee &, const QString &email=QString::null );
QStringList emails() const;
Entry::List entries() const;
private:
DistributionListManager *mManager;
QString mName;
Entry::List mEntries;
};
class KABC_EXPORT DistributionListManager
{
public:
DistributionListManager( AddressBook * );
~DistributionListManager();
DistributionList *list( const QString &name ); // KDE4: add bool caseSensitive = true
void insert( DistributionList * );
void remove( DistributionList * );
QStringList listNames();
bool load();
bool save();
private:
class DistributionListManagerPrivate;
DistributionListManagerPrivate *d;
QPtrList<DistributionList> mLists;
};
class KABC_EXPORT DistributionListWatcher : public QObject
{
Q_OBJECT
public:
static DistributionListWatcher *self();
signals:
void changed();
protected:
DistributionListWatcher();
~DistributionListWatcher();
private:
static DistributionListWatcher* mSelf;
KDirWatch *mDirWatch;
};
}
#endif
KABC::DistributionList::Entry
Distribution List Entry.
Definition: distributionlist.h:49
KABC::DistributionListWatcher
Watchdog for distribution lists.
Definition: distributionlist.h:189
KABC::DistributionList
Distribution list of email addresses.
Definition: distributionlist.h:39
KABC::DistributionListManager
Manager of distribution lists.
Definition: distributionlist.h:122
KABC::Addressee
address book entry
Definition: addressee.src.h:74
KABC::AddressBook
Address Book.
Definition: addressbook.h:43

KDE Home | KDE Accessibility Home | Description of Access Keys