filters

rtfimport_tokenizer.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_TOKENIZER_H__
00013 #define __RTFIMPORT_TOKENIZER_H__
00014 
00015 #include <qcstring.h>
00016 #include <qfile.h>
00017 
00018 
00020 class RTFTokenizer
00021 {
00022 public:
00023     enum TokenType { OpenGroup, CloseGroup, ControlWord, PlainText, BinaryData };
00024 
00025     RTFTokenizer();
00026 
00031     void open( QFile *in );
00035     void next();
00036 
00037     // token data
00038 
00040     char *text;
00041     TokenType type;
00043     int value;
00045     bool hasParam;
00046 
00047 public:
00049     QByteArray binaryData;
00050 
00051     // tokenizer (private) data
00052 private:
00053     int nextChar();
00054 
00055     QFile *infile;
00056     QByteArray fileBuffer;
00057     QCString tokenText;
00058     uchar *fileBufferPtr;
00059     uchar *fileBufferEnd;
00060 };
00061 
00062 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys