filters

rtfimport_dom.h
1/*
2 This file is part of the KDE project
3 Copyright (C) 2001 Ewald Snel <ewald@rambo.its.tudelft.nl>
4 Copyright (C) 2001 Tomasz Grobelny <grotk@poczta.onet.pl>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10*/
11
12#ifndef __RTFIMPORT_DOM_H__
13#define __RTFIMPORT_DOM_H__
14
15#include <tqstring.h>
16
17class TQColor;
18class TQDateTime;
19class TQTextCodec;
20
24TQString CheckAndEscapeXmlText(const TQString& strText);
25
26class DomNode
27{
28public:
29 DomNode();
34 DomNode( const char *doctype );
39 void clear( int level=0 );
44 void addNode( const char *name );
49 void addTextNode( const char *text, TQTextCodec* codec );
53 void addBorder( int id, const TQColor &color, int style, double width );
58 void addColor( const TQColor &color );
62 void addRect( int left, int top, int right, int bottom );
69 void addKey( const TQDateTime& dt, const TQString& filename, const TQString& name = TQString() );
73 void addFrameSet( const char *name, int frameType, int frameInfo );
77 void addFrame( int left, int top, int right, int bottom,
78 int autoCreateNewFrame, int newFrameBehaviour,
79 int sheetSide );
83 void setAttribute( const TQString& attribute, const TQString& value );
87 void setAttribute( const char *name, int value );
91 void setAttribute( const char *name, double value );
96 void closeNode( const char *name );
101 void closeTag( bool nl );
106 void appendNode( const DomNode &child );
110 void append( const TQCString& cstr);
111 void append( const TQString& _str);
112 void append( const char ch);
116 bool isEmpty() const;
120 TQString toString() const;
121
122private:
123 TQString str;
124 int documentLevel;
125 bool hasChildren;
126 bool hasAttributes;
127};
128
129#endif