libkdepim
distributionlist.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KDEPIM_DISTRIBUTIONLIST_H
00023 #define KDEPIM_DISTRIBUTIONLIST_H
00024
00025 #include "kdepim_export.h"
00026 #include <kabc/addressee.h>
00027
00028 namespace KABC {
00029 class AddressBook;
00030 }
00031
00032 namespace KPIM {
00033
00045 class KDEPIM_EXPORT DistributionList : public KABC::Addressee
00046 {
00047 public:
00055 struct Entry
00056 {
00057 typedef QList<Entry> List;
00058
00059 Entry() {}
00060 Entry( const Addressee &_addressee, const QString &_email ) :
00061 addressee( _addressee ), email( _email ) {}
00062
00063 Addressee addressee;
00064 QString email;
00065 };
00066
00067 typedef QList<DistributionList> List;
00068
00072 DistributionList();
00077 DistributionList( const KABC::Addressee &addr );
00078
00082 ~DistributionList() {}
00083
00085 void setName( const QString &name );
00086
00088 QString name() const { return formattedName(); }
00089
00094 void insertEntry( const Addressee &, const QString &email=QString() );
00095
00100 void removeEntry( const Addressee &, const QString &email=QString() );
00101
00103 void insertEntry( const QString &uid, const QString &email=QString() );
00104
00106 void removeEntry( const QString &uid, const QString &email=QString() );
00107
00113 QStringList emails( KABC::AddressBook *book ) const;
00114
00120 Entry::List entries( KABC::AddressBook *book ) const;
00121
00122
00123 static bool isDistributionList( const KABC::Addressee &addr );
00124
00125
00126 static DistributionList findByName( KABC::AddressBook *book,
00127 const QString &name,
00128 bool caseSensitive = true );
00129
00130
00131
00132
00133 static QList<DistributionList> allDistributionLists( KABC::AddressBook *book );
00134
00135 private:
00136
00137 };
00138
00139 }
00140
00141 #endif
00142