filters

wmlparser.h
1/* This file is part of the KDE project
2 Copyright (C) 2002 Ariya Hidayat <ariyahidayat@yahoo.de>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef __WMLPARSER_H
21#define __WMLPARSER_H
22
23#include <tqvaluelist.h>
24#include <tqstring.h>
25
26class WMLFormat
27{
28 public:
29 int pos, len;
30 bool bold, italic, underline;
31 enum { Normal, Big, Small } fontsize;
32 TQString link, href;
33 WMLFormat();
34 WMLFormat( const WMLFormat& );
35 WMLFormat& operator= ( const WMLFormat& );
36 void assign( const WMLFormat& );
37};
38
39class WMLLayout
40{
41 public:
42 enum { Left, Center, Right } align;
43 WMLLayout();
44 WMLLayout( const WMLLayout& );
45 WMLLayout& operator=( const WMLLayout& );
46 void assign( const WMLLayout& );
47};
48
49typedef TQValueList<WMLFormat> WMLFormatList;
50
51class WMLParser
52{
53 public:
54 WMLParser(){};
55 virtual ~WMLParser(){};
56 virtual void parse( const char* filename );
57
58 virtual bool doOpenDocument();
59 virtual bool doCloseDocument();
60 virtual bool doOpenCard( TQString id, TQString title );
61 virtual bool doCloseCard();
62 virtual bool doParagraph( TQString, WMLFormatList, WMLLayout );
63 virtual bool doBeginTable();
64 virtual bool doTableCell( unsigned row, unsigned col );
65 virtual bool doEndTable();
66};
67
68#endif