kword

KWMailMergeDataSource.h
1/* This file is part of the KDE project
2 Original file (mailmerge.h): Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
3 Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20
21#ifndef _SERIALLETTER_INTERFACE_H_
22#define _SERIALLETTER_INTERFACE_H_
23#include <tqcstring.h>
24#include <tqdom.h>
25#include <tdeinstance.h>
26#include <tqmap.h>
27#include <tqobject.h>
28#include <dcopobject.h>
29#include <koffice_export.h>
30typedef TQMap<TQString,TQString> DbRecord;
31#define KWSLUnspecified 0
32#define KWSLEdit 1
33#define KWSLCreate 2
34#define KWSLOpen 3
35#define KWSLMergePreview 4
36#define KWSLMergeDocument 5
37
38#define KWSLCreate_text "create"
39#define KWSLOpen_text "open"
40/******************************************************************
41 *
42 * Class: KWMailMergeDataSource
43 *
44 ******************************************************************/
45
46class KWORD_EXPORT KWMailMergeDataSource: public TQObject, public DCOPObject
47{
48 TQ_OBJECT
49//
50 K_DCOP
51 public:
52 KWMailMergeDataSource(TDEInstance* inst,TQObject *parent);
53 virtual ~KWMailMergeDataSource(){;}
54 virtual class TQString getValue( const class TQString &name, int record = -1 ) const=0;
55
56 const TQMap< TQString, TQString > &getRecordEntries() const;
57
58 TDEInstance *KWInstance(){return m_instance;}
59 virtual bool showConfigDialog(class TQWidget*,int) =0;
60
61 virtual void save(TQDomDocument&, TQDomElement&)=0;
62 virtual void load( class TQDomElement& elem )=0;
63
64 virtual void refresh(bool force)=0;
65 TQByteArray info;
66 protected:
67 DbRecord sampleRecord;
68 private:
69 TDEInstance *m_instance;
70k_dcop:
71 virtual int getNumRecords() const =0;
72};
73
74
75
76
77#endif