filters

rtfimport_dom.h

00001 /*
00002    This file is part of the KDE project
00003    Copyright (C) 2001 Ewald Snel <ewald@rambo.its.tudelft.nl>
00004    Copyright (C) 2001 Tomasz Grobelny <grotk@poczta.onet.pl>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License as published by the Free Software Foundation; either
00009    version 2 of the License, or (at your option) any later version.
00010 */
00011 
00012 #ifndef __RTFIMPORT_DOM_H__
00013 #define __RTFIMPORT_DOM_H__
00014 
00015 #include <qstring.h>
00016 
00017 class QColor;
00018 class QDateTime;
00019 class QTextCodec;
00020 
00024 QString CheckAndEscapeXmlText(const QString& strText);
00025 
00026 class DomNode
00027 {
00028 public:
00029     DomNode();
00034     DomNode( const char *doctype );
00039     void clear( int level=0 );
00044     void addNode( const char *name );
00049     void addTextNode( const char *text, QTextCodec* codec );
00053     void addBorder( int id, const QColor &color, int style, double width );
00058     void addColor( const QColor &color );
00062     void addRect( int left, int top, int right, int bottom );
00069     void addKey( const QDateTime& dt, const QString& filename, const QString& name = QString::null );
00073     void addFrameSet( const char *name, int frameType, int frameInfo );
00077     void addFrame( int left, int top, int right, int bottom,
00078            int autoCreateNewFrame, int newFrameBehaviour,
00079            int sheetSide );
00083     void setAttribute( const QString& attribute, const QString& value );
00087     void setAttribute( const char *name, int value );
00091     void setAttribute( const char *name, double value );
00096     void closeNode( const char *name );
00101     void closeTag( bool nl );
00106     void appendNode( const DomNode &child );
00110     void append( const QCString& cstr);
00111     void append( const QString& _str);
00112     void append( const char ch);
00116     bool isEmpty() const;
00120     QString toString() const;
00121 
00122 private:
00123     QString str;
00124     int documentLevel;
00125     bool hasChildren;
00126     bool hasAttributes;
00127 };
00128 
00129 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys