filters

TagProcessing.h
1/*
2 This file is part of the KDE project
3 Copyright (C) 2001, 2002, 2004 Nicolas GOUTTE <goutte@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/*
22 This file is based on the old file:
23 /home/kde/koffice/filters/kword/ascii/asciiexport.cpp
24
25 The old file was copyrighted by
26 Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
27 Copyright (c) 2000 ID-PRO Deutschland GmbH. All rights reserved.
28 Contact: Wolf-Michael Bolle <Bolle@ID-PRO.de>
29
30 The old file was licensed under the terms of the GNU Library General Public
31 License version 2.
32*/
33
34#ifndef EXPORTTAGPROCESSING_H
35#define EXPORTTAGPROCESSING_H
36
37#include <tqdom.h>
38#include <tqvaluelist.h>
39
40#include <tdemacros.h>
41#include <kdebug.h>
42
43class KWEFKWordLeader;
44
54
55class TagProcessing
56{
57 public:
58 TagProcessing ()
59 {}
60
61 TagProcessing (const TQString& n,
62 void (*p)(TQDomNode, void *, KWEFKWordLeader*),
63 void *d) : name (n), processor (p), data (d)
64 {}
65
71 TagProcessing (const TQString& _name) : name(_name), processor(0), data(0)
72 {}
73
74 TQString name;
75 void (*processor)(TQDomNode, void *, KWEFKWordLeader*);
76 void *data;
77};
78
79void ProcessSubtags ( const TQDomNode &parentNode,
80 TQValueList<TagProcessing> &tagProcessingList,
81 KWEFKWordLeader *leader);
82
83void AllowNoSubtags ( const TQDomNode& myNode, KWEFKWordLeader *leader );
84
85
95
97{
98public:
99
100 enum AttrType
101 { AttrNull = 0, AttrInt, AttrDouble, AttrBool, AttrTQString };
102
106 AttrProcessing () : type( AttrNull ), data(0) {}
107
112 AttrProcessing ( const TQString& n, const TQString& t, void *d ) TDE_DEPRECATED;
113
119 AttrProcessing ( const TQString& _name )
120 : name( _name ), type( AttrNull ), data( 0 ) {}
121
127 AttrProcessing ( const TQString& _name, int& i )
128 : name( _name ), type( AttrInt ), data( &i ) {}
129
135 AttrProcessing ( const TQString& _name, double& d )
136 : name( _name ), type( AttrDouble ), data( &d ) {}
137
144 AttrProcessing ( const TQString& _name, bool& flag )
145 : name( _name ), type( AttrBool ), data( &flag ) {}
146
152 AttrProcessing ( const TQString& _name, TQString& str )
153 : name( _name ), type( AttrTQString ), data( &str ) {}
154
155
156public:
157 TQString name;
158 AttrType type;
159 void *data;
160};
161
162void ProcessAttributes ( const TQDomNode &myNode,
163 TQValueList<AttrProcessing> &attrProcessingList );
164
165void AllowNoAttributes ( const TQDomNode& myNode );
166
167#endif
AttrProcessing(const TQString &_name, int &i)
Integer constructor.
AttrProcessing(const TQString &_name, TQString &str)
String constructor.
AttrProcessing()
Default constructor.
AttrProcessing(const TQString &_name, double &d)
Double constructor.
AttrProcessing(const TQString &_name)
No-op constructor.
AttrProcessing(const TQString &_name, bool &flag)
Boolean constructor.
TagProcessing(const TQString &_name)
No-op constructor.