filters

TagProcessing.h

00001 /*
00002    This file is part of the KDE project
00003    Copyright (C) 2001, 2002, 2004 Nicolas GOUTTE <goutte@kde.org>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 /*
00022    This file is based on the old file:
00023     /home/kde/koffice/filters/kword/ascii/asciiexport.cc
00024 
00025    The old file was copyrighted by
00026     Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
00027     Copyright (c) 2000 ID-PRO Deutschland GmbH. All rights reserved.
00028                        Contact: Wolf-Michael Bolle <Bolle@ID-PRO.de>
00029 
00030    The old file was licensed under the terms of the GNU Library General Public
00031    License version 2.
00032 */
00033 
00034 #ifndef EXPORTTAGPROCESSING_H
00035 #define EXPORTTAGPROCESSING_H
00036 
00037 #include <qdom.h>
00038 #include <qvaluelist.h>
00039 
00040 #include <kdemacros.h>
00041 #include <kdebug.h>
00042 
00043 class KWEFKWordLeader;
00044 
00055 class TagProcessing
00056 {
00057     public:
00058         TagProcessing ()
00059         {}
00060 
00061         TagProcessing (const QString& n,
00062                        void (*p)(QDomNode, void *, KWEFKWordLeader*),
00063                        void *d) : name (n), processor (p), data (d)
00064         {}
00065 
00071         TagProcessing (const QString& _name) : name(_name), processor(0), data(0)
00072         {}
00073 
00074         QString  name;
00075         void     (*processor)(QDomNode, void *, KWEFKWordLeader*);
00076         void    *data;
00077 };
00078 
00079 void ProcessSubtags     ( const QDomNode             &parentNode,
00080                           QValueList<TagProcessing>  &tagProcessingList,
00081                           KWEFKWordLeader            *leader);
00082 
00083 void AllowNoSubtags ( const QDomNode& myNode, KWEFKWordLeader *leader );
00084 
00085 
00096 class AttrProcessing
00097 {
00098 public:
00099 
00100     enum AttrType
00101         { AttrNull = 0, AttrInt, AttrDouble, AttrBool, AttrQString };
00102 
00106     AttrProcessing () : type( AttrNull ), data(0) {}
00107 
00112     AttrProcessing ( const QString& n, const QString& t, void *d ) KDE_DEPRECATED;
00113 
00119     AttrProcessing ( const QString& _name )
00120         : name( _name ), type( AttrNull ), data( 0 ) {}
00121 
00127     AttrProcessing ( const QString& _name, int& i )
00128         : name( _name ), type( AttrInt ), data( &i ) {}
00129 
00135     AttrProcessing ( const QString& _name, double& d )
00136         : name( _name ), type( AttrDouble ), data( &d ) {}
00137 
00144     AttrProcessing ( const QString& _name, bool& flag )
00145         : name( _name ), type( AttrBool ), data( &flag ) {}
00146 
00152     AttrProcessing ( const QString& _name, QString& str )
00153         : name( _name ), type( AttrQString ), data( &str ) {}
00154 
00155 
00156 public:
00157     QString   name;
00158     AttrType  type;
00159     void     *data;
00160 };
00161 
00162 void ProcessAttributes ( const QDomNode              &myNode,
00163                          QValueList<AttrProcessing>  &attrProcessingList );
00164 
00165 void AllowNoAttributes ( const QDomNode& myNode );
00166 
00167 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys