filters

wmlparser.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2002 Ariya Hidayat <ariyahidayat@yahoo.de>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef __WMLPARSER_H
00021 #define __WMLPARSER_H
00022 
00023 #include <qvaluelist.h>
00024 #include <qstring.h>
00025 
00026 class WMLFormat
00027 {
00028   public:
00029     int pos, len;
00030     bool bold, italic, underline;
00031     enum { Normal, Big, Small } fontsize;
00032     QString link, href;
00033     WMLFormat();
00034     WMLFormat( const WMLFormat& );
00035     WMLFormat& operator= ( const WMLFormat& );
00036     void assign( const WMLFormat& );
00037 };
00038 
00039 class WMLLayout
00040 {
00041   public:
00042     enum { Left, Center, Right } align;
00043     WMLLayout();
00044     WMLLayout( const WMLLayout& );
00045     WMLLayout& operator=( const WMLLayout& );
00046     void assign( const WMLLayout& );
00047 };
00048 
00049 typedef QValueList<WMLFormat> WMLFormatList;
00050 
00051 class WMLParser
00052 {
00053   public:
00054     WMLParser(){};
00055     virtual ~WMLParser(){};
00056     virtual void parse( const char* filename );
00057 
00058     virtual bool doOpenDocument();
00059     virtual bool doCloseDocument();
00060     virtual bool doOpenCard( QString id, QString title );
00061     virtual bool doCloseCard();
00062     virtual bool doParagraph( QString, WMLFormatList, WMLLayout );
00063     virtual bool doBeginTable();
00064     virtual bool doTableCell( unsigned row, unsigned col );
00065     virtual bool doEndTable();
00066 };
00067 
00068 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys