• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

libkdepim

distributionlist.h

Go to the documentation of this file.
00001 /*
00002   This file is part of libkdepim.
00003 
00004   Copyright (c) 2004-2005 David Faure <faure@kde.org>
00005 
00006   This library is free software; you can redistribute it and/or
00007   modify it under the terms of the GNU Library General Public
00008   License as published by the Free Software Foundation; either
00009   version 2 of the License, or (at your option) any later version.
00010 
00011   This library is distributed in the hope that it will be useful,
00012   but WITHOUT ANY WARRANTY; without even the implied warranty of
00013   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014   Library General Public License for more details.
00015 
00016   You should have received a copy of the GNU Library General Public License
00017   along with this library; see the file COPYING.LIB.  If not, write to
00018   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019   Boston, MA 02110-1301, USA.
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     // KDE4: should be a method of Addressee
00123     static bool isDistributionList( const KABC::Addressee &addr );
00124 
00125     // KDE4: should be a method of AddressBook
00126     static DistributionList findByName( KABC::AddressBook *book,
00127                                         const QString &name,
00128                                         bool caseSensitive = true );
00129 
00130     // KDE4: should be a method of AddressBook
00131     // A bit slow (but no more than findByName).
00132     // From KAddressbook, use Core::distributionLists() instead.
00133     static QList<DistributionList> allDistributionLists( KABC::AddressBook *book );
00134 
00135   private:
00136     // can't have any data here, use Addressee's methods instead
00137 };
00138 
00139 }
00140 
00141 #endif /* DISTRIBUTIONLIST_H */
00142 

libkdepim

Skip menu "libkdepim"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal