libkdepim Library API Documentation

distributionlist.h

00001 #ifndef DISTRIBUTIONLIST_H
00002 #define DISTRIBUTIONLIST_H
00003 
00004 #include <kabc/addressee.h>
00005 
00006 namespace KABC {
00007 class AddressBook;
00008 }
00009 
00010 namespace KPIM {
00011 
00022 class DistributionList : public KABC::Addressee
00023 {
00024   public:
00032     struct Entry
00033     {
00034       typedef QValueList<Entry> List;
00035 
00036       Entry() {}
00037       Entry( const Addressee &_addressee, const QString &_email ) :
00038           addressee( _addressee ), email( _email ) {}
00039 
00040       Addressee addressee;
00041       QString email;
00042     };
00043 
00044     typedef QValueList<DistributionList> List;
00045 
00052     DistributionList();
00053     DistributionList( const KABC::Addressee& addr );
00054 
00058     ~DistributionList() {}
00059 
00061     void setName( const QString &name );
00062 
00063     QString name() const { return formattedName(); }
00064 
00069     void insertEntry( const Addressee &, const QString &email=QString::null );
00070 
00075     void removeEntry( const Addressee &, const QString &email=QString::null );
00076 
00078     void insertEntry( const QString& uid, const QString& email=QString::null );
00080     void removeEntry( const QString& uid, const QString& email=QString::null );
00081 
00082 
00088     QStringList emails( KABC::AddressBook* book ) const;
00089 
00095     Entry::List entries( KABC::AddressBook* book ) const;
00096 
00097     // should be a method of Addressee
00098     static bool isDistributionList( const KABC::Addressee& addr );
00099 
00100     // should be a method of AddressBook
00101     static DistributionList findByName( KABC::AddressBook* book,
00102                                         const QString& name,
00103                                         bool caseSensitive = true );
00104     // should be a method of AddressBook
00105     // A bit slow (but no more than findByName).
00106     // From KAddressbook, use Core::distributionLists() instead.
00107     static QValueList<DistributionList> allDistributionLists( KABC::AddressBook* book );
00108 
00109 
00110   private:
00111     // can't have any data here, use Addressee's methods instead
00112 };
00113 
00114 };
00115 
00116 #endif /* DISTRIBUTIONLIST_H */
00117 
KDE Logo
This file is part of the documentation for libkdepim Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Oct 4 14:40:45 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003