KWMailMergeTDEABC.h
1/*
2 This file is part of the KDE project
3 Copyright (C) 2003 Tobias Koenig <tokoe@kde.org>
4 Copyright (C) 2004 Tobias Koenig <tokoe@kde.org>
5 Dirk Schmidt <fs@dirk.schmidt.net>
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
16
17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
21*/
22
23#ifndef _KWMAILMERGE_KABC_H_
24#define _KWMAILMERGE_KABC_H_
25
26#include <tqdom.h>
27#include <tqguardedptr.h>
28
29#include <tdeabc/addressbook.h>
30
31#include "KWMailMergeDataSource.h"
32
33class KWMailMergeTDEABC: public KWMailMergeDataSource
34{
35 TQ_OBJECT
36
37
38public:
39 KWMailMergeTDEABC( TDEInstance *inst, TQObject *parent );
40 ~KWMailMergeTDEABC();
41
45 virtual void save( TQDomDocument&, TQDomElement& );
46
50 virtual void load( TQDomElement& );
51
59 virtual class TQString getValue( const class TQString &name, int record = -1 ) const;
60
64 virtual int getNumRecords() const;
65
71 virtual void refresh( bool force );
72
76 virtual bool showConfigDialog( TQWidget*, int action);
77
78protected:
79 friend class KWMailMergeTDEABCConfig;
80
90 void addEntry( const TQString &uid );
91
100 void addList( const TQString &id );
101
105 void clear();
106
112 virtual TQStringList lists() const;
113
120 virtual TQStringList singleRecords() const;
121
122private:
126 TDEABC::AddressBook* _addressBook;
127
131 mutable TDEABC::AddressBook::ConstIterator _iterator;
132
136 mutable TQStringList::ConstIterator _UIDIterator;
137
146 TQStringList _exclusiveUIDs;
147
152 TQStringList _individualUIDs;
153
158 TQStringList _listUIDs;
159
164 TQStringList _lists;
165
166
176 void parseList( const TQString& listName );
177
181 void makeUIDsExclusive();
182
183};
184
185#endif
186