"Fossies" - the Fresh Open Source Software Archive

Member "kydpdict-0.9.5/src/engine_pwn.h" (23 Jul 2005, 2193 Bytes) of package /linux/privat/old/kydpdict-0.9.5.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "engine_pwn.h" see the Fossies "Dox" file reference documentation.

    1 /***************************************************************************
    2  *                                                                         *
    3  *   This program is free software; you can redistribute it and/or modify  *
    4  *   it under the terms of the GNU General Public License as published by  *
    5  *   the Free Software Foundation; either version 2 of the License, or     *
    6  *   (at your option) any later version.                                   *
    7  *                                                                         *
    8  ***************************************************************************/
    9 
   10 #ifndef ENGINE_PWN_H
   11 #define ENGINE_PWN_H
   12 
   13 #include <qobject.h>
   14 #include <qfile.h>
   15 
   16 class QStringList;
   17 
   18 class kydpConfig;
   19 
   20 #include "ydpdictionary.h"
   21 #include "ydpconverter.h"
   22 
   23 class EnginePWN : public ydpDictionary {
   24     Q_OBJECT
   25 public:
   26     EnginePWN(kydpConfig *config, QListBox *listBox, ydpConverter *converter);
   27     ~EnginePWN();
   28 
   29     int OpenDictionary(void);
   30     int CheckDictionary(void);
   31     void CloseDictionary(void);
   32 
   33 private:
   34     int ReadDefinition (int index);
   35     void FillWordList(void);
   36     QString rtf2html (QString definition);
   37     void disableTag (int tag_code, int level);
   38     QString insertHyperText(QString raw_input, int level);
   39     void UpdateFName(void);
   40 
   41     //
   42     void DoToolTips(const QString regex, QString *tmp, const QString color, const int n);
   43     QString MatchToolTips(const QString input);
   44     QString GetTip(int index);
   45 
   46     // dictionary file variables
   47     QFile fIndex;           /* index file descriptor */
   48 
   49     struct LL_dictionaryCache {
   50         unsigned int *offsets;  /* offsets in data file to word def's */
   51         unsigned int words_base;
   52     } dictCache_LL[4];
   53 
   54     // dictionary loader stuff
   55     unsigned int index_base, words_base, end_last_word, maxlength;
   56     unsigned int *offsets;
   57     char *wordbuffer;
   58 };
   59 
   60 /* converter class */
   61 
   62 class ConvertPWN : public ydpConverter {
   63 public:
   64     ConvertPWN(void);
   65     ~ConvertPWN();
   66     char toLower(const char c);
   67     char *toLocal(const char *input);
   68     int charIndex(const char c);
   69     QString toUnicode(const char *input);
   70     QCString fromUnicode(QString input);
   71     QString convertChunk(const char *inp, int size = 0, bool unicodeFont = false);
   72 
   73 private:
   74     QTextCodec *codec;
   75 };
   76 
   77 #endif