kword

KWMailMergeKABC.h

00001 /*
00002    This file is part of the KDE project
00003    Copyright (C) 2003 Tobias Koenig <tokoe@kde.org>
00004    Copyright (C) 2004 Tobias Koenig <tokoe@kde.org>
00005                       Dirk Schmidt <fs@dirk.schmidt.net>
00006  
00007    This library is free software; you can redistribute it and/or
00008    modify it under the terms of the GNU Library General Public
00009    License as published by the Free Software Foundation; either
00010    version 2 of the License, or (at your option) any later version.
00011  
00012    This library is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015    Library General Public License for more details.
00016  
00017    You should have received a copy of the GNU Library General Public License
00018    along with this library; see the file COPYING.LIB.  If not, write to
00019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020  * Boston, MA 02110-1301, USA.
00021 */
00022 
00023 #ifndef _KWMAILMERGE_KABC_H_
00024 #define _KWMAILMERGE_KABC_H_
00025 
00026 #include <qdom.h>
00027 #include <qguardedptr.h>
00028 
00029 #include <kabc/addressbook.h>
00030 
00031 #include "KWMailMergeDataSource.h"
00032 
00033 class KWMailMergeKABC: public KWMailMergeDataSource
00034 {
00035     Q_OBJECT
00036 
00037 public:
00038     KWMailMergeKABC( KInstance *inst, QObject *parent );
00039     ~KWMailMergeKABC();
00040 
00044     virtual void save( QDomDocument&, QDomElement& );
00045 
00049     virtual void load( QDomElement& );
00050 
00058     virtual class QString getValue( const class QString &name, int record = -1 ) const;
00059 
00063     virtual int getNumRecords() const;
00064 
00070     virtual void refresh( bool force );
00071 
00075     virtual bool showConfigDialog( QWidget*, int action);
00076 
00077 protected:
00078     friend class KWMailMergeKABCConfig;
00079 
00089     void addEntry( const QString &uid );
00090 
00099     void addList( const QString &id );
00100 
00104     void clear();
00105 
00111     virtual QStringList lists() const;
00112 
00119     virtual QStringList singleRecords() const;
00120 
00121 private:
00125     KABC::AddressBook* _addressBook;
00126 
00130     mutable KABC::AddressBook::ConstIterator _iterator;
00131 
00135     mutable QStringList::ConstIterator _UIDIterator;
00136 
00145     QStringList _exclusiveUIDs;
00146 
00151     QStringList _individualUIDs;
00152 
00157     QStringList _listUIDs;
00158 
00163     QStringList _lists;
00164 
00165 
00175     void parseList( const QString& listName );
00176 
00180     void makeUIDsExclusive();
00181 
00182 };
00183 
00184 #endif
00185 
KDE Home | KDE Accessibility Home | Description of Access Keys