libkdepim
distributionlist.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef DISTRIBUTIONLIST_H
00022 #define DISTRIBUTIONLIST_H
00023
00024 #include <kabc/addressee.h>
00025
00026 namespace KABC {
00027 class AddressBook;
00028 }
00029
00030 namespace KPIM {
00031
00043 class DistributionList : public KABC::Addressee
00044 {
00045 public:
00053 struct Entry
00054 {
00055 typedef QValueList<Entry> List;
00056
00057 Entry() {}
00058 Entry( const Addressee &_addressee, const QString &_email ) :
00059 addressee( _addressee ), email( _email ) {}
00060
00061 Addressee addressee;
00062 QString email;
00063 };
00064
00065 typedef QValueList<DistributionList> List;
00066
00070 DistributionList();
00075 DistributionList( const KABC::Addressee& addr );
00076
00080 ~DistributionList() {}
00081
00083 void setName( const QString &name );
00084
00086 QString name() const { return formattedName(); }
00087
00092 void insertEntry( const Addressee &, const QString &email=QString::null );
00093
00098 void removeEntry( const Addressee &, const QString &email=QString::null );
00099
00101 void insertEntry( const QString& uid, const QString& email=QString::null );
00103 void removeEntry( const QString& uid, const QString& email=QString::null );
00104
00105
00111 QStringList emails( KABC::AddressBook* book ) const;
00112
00118 Entry::List entries( KABC::AddressBook* book ) const;
00119
00120
00121 static bool isDistributionList( const KABC::Addressee& addr );
00122
00123
00124 static DistributionList findByName( KABC::AddressBook* book,
00125 const QString& name,
00126 bool caseSensitive = true );
00127
00128
00129
00130 static QValueList<DistributionList> allDistributionLists( KABC::AddressBook* book );
00131
00132
00133 private:
00134
00135 };
00136
00137 }
00138
00139 #endif
00140
|