"Fossies" - the Fresh Open Source Software Archive

Member "kydpdict-0.9.5/src/engine_dict.h" (14 Aug 2005, 1892 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_dict.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_DICT_H
   11 #define ENGINE_DICT_H
   12 
   13 #include <qobject.h>
   14 #include <qfile.h>
   15 #include <zlib.h>
   16 
   17 class QStringList;
   18 
   19 class kydpConfig;
   20 
   21 #include "ydpdictionary.h"
   22 #include "ydpconverter.h"
   23 
   24 class EngineDICT : public ydpDictionary {
   25     Q_OBJECT
   26 public:
   27     EngineDICT(kydpConfig *config, QListBox *listBox, ydpConverter *converter);
   28     ~EngineDICT();
   29 
   30     int OpenDictionary(void);
   31     int CheckDictionary(void);
   32     void CloseDictionary(void);
   33 
   34 private:
   35     int ReadDefinition (int index);
   36     void FillWordList(void);
   37     QString rtf2html (QString definition);
   38     void UpdateFName(void);
   39 
   40     int Base64Decode(const char *input);
   41 
   42     // dictionary file variables
   43     QFile fData;            /* index file descriptor */
   44     QFile fIndex;
   45     gzFile zData;
   46 
   47     unsigned int *offsets;
   48     unsigned int *lengths;
   49     struct LL_dictionaryCache {
   50         unsigned int *offsets;
   51         unsigned int *lengths;
   52     } dictCache_LL[4];
   53 
   54 };
   55 
   56 /* converter class */
   57 
   58 class ConvertDICT : public ydpConverter {
   59 public:
   60     ConvertDICT(void);
   61     ~ConvertDICT();
   62     char toLower(const char c);
   63     char *toLocal(const char *input);
   64     int charIndex(const char c);
   65     QString toUnicode(const char *input);
   66     QCString fromUnicode(QString input);
   67     QString convertChunk(const char *inp, int size = 0, bool unicodeFont = false);
   68 
   69 private:
   70     QTextCodec *codec;
   71 };
   72 
   73 #endif