summaryrefslogtreecommitdiffstats
path: root/kiten/dict.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:39:55 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:39:55 +0000
commit0a6e0958c03e41c87b15557b6f407874f20c2f8d (patch)
tree2cdd58c4013b1be09cfcbb4ddae2b05712b9aeee /kiten/dict.h
parent83f9dfafc157ff7823804b3ff457b43d021a5b4b (diff)
downloadtdeedu-0a6e0958c03e41c87b15557b6f407874f20c2f8d.tar.gz
tdeedu-0a6e0958c03e41c87b15557b6f407874f20c2f8d.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1157642 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kiten/dict.h')
-rw-r--r--kiten/dict.h100
1 files changed, 50 insertions, 50 deletions
diff --git a/kiten/dict.h b/kiten/dict.h
index 80fa8113..f510d0c1 100644
--- a/kiten/dict.h
+++ b/kiten/dict.h
@@ -22,11 +22,11 @@
#ifndef DICT_H
#define DICT_H
-#include <qfile.h>
-#include <qmemarray.h>
-#include <qptrlist.h>
-#include <qregexp.h>
-#include <qstringlist.h>
+#include <tqfile.h>
+#include <tqmemarray.h>
+#include <tqptrlist.h>
+#include <tqregexp.h>
+#include <tqstringlist.h>
#include <sys/types.h>
#ifdef __osf__
@@ -42,14 +42,14 @@ namespace Dict
enum TextType { Text_Kanji, Text_Kana, Text_Latin };
// returns the TextType of the first part of the text
-KDE_EXPORT TextType textType(const QString &text);
+KDE_EXPORT TextType textType(const TQString &text);
// File needs to be able to give out Arrays based on its mmap'd data.
// But, we don't want the users of the arrays to have to remember to
// resetRawData() after using them, since that's bound to fail sooner or later.
//
// This class handles it for us.
-template<class T> class Array : public QMemArray<T>
+template<class T> class Array : public TQMemArray<T>
{
public:
Array(T *, int);
@@ -61,7 +61,7 @@ private:
};
template<class T> Array<T>::Array(T *d, int s)
- : QMemArray<T>()
+ : TQMemArray<T>()
, data(d)
, dataSize(s)
{
@@ -78,10 +78,10 @@ template<class T> Array<T>::~Array()
class File
{
public:
- File(QString path, QString name);
+ File(TQString path, TQString name);
~File();
- QString name(void);
+ TQString name(void);
Array<const unsigned char> dict(void);
Array<const uint32_t> index(void);
@@ -93,14 +93,14 @@ public:
bool isValid(void);
unsigned char lookup(unsigned i, int offset);
- QCString lookup(unsigned i);
+ TQCString lookup(unsigned i);
private:
- QString myName;
+ TQString myName;
- QFile dictFile;
+ TQFile dictFile;
const unsigned char * dictPtr;
- QFile indexFile;
+ TQFile indexFile;
const uint32_t * indexPtr;
bool valid;
@@ -110,22 +110,22 @@ class KDE_EXPORT Entry
{
public:
// EDict ctor
- Entry(const QString &, const QString &, const QStringList &);
+ Entry(const TQString &, const TQString &, const TQStringList &);
// Kanjidict ctor
- Entry(const QString &, QStringList &, QStringList &, unsigned int grade, unsigned int freq, unsigned int strokes, unsigned int miscount);
+ Entry(const TQString &, TQStringList &, TQStringList &, unsigned int grade, unsigned int freq, unsigned int strokes, unsigned int miscount);
// default (for containers)
- Entry(const QString & = QString::null);
+ Entry(const TQString & = TQString::null);
// for a heading
- Entry(const QString &, bool header);
+ Entry(const TQString &, bool header);
- QString dictName();
- QString header();
- QStringList meanings();
- QStringList readings();
- QString firstReading();
+ TQString dictName();
+ TQString header();
+ TQStringList meanings();
+ TQStringList readings();
+ TQString firstReading();
bool kanaOnly();
- QString kanji();
+ TQString kanji();
bool extendedKanjiInfo();
unsigned int grade();
@@ -134,13 +134,13 @@ public:
unsigned int freq();
protected:
- QString DictName;
- QString Header;
- QStringList Meanings;
+ TQString DictName;
+ TQString Header;
+ TQStringList Meanings;
- QString Kanji;
+ TQString Kanji;
bool KanaOnly;
- QStringList Readings;
+ TQStringList Readings;
bool ExtendedKanjiInfo;
unsigned int Grade;
@@ -151,11 +151,11 @@ protected:
struct SearchResult
{
- QValueList<Entry> list;
- QStringList results;
+ TQValueList<Entry> list;
+ TQStringList results;
int count, outOf;
bool common;
- QString text;
+ TQString text;
};
enum SearchType { Search_Beginning, Search_FullWord, Search_Anywhere };
@@ -169,35 +169,35 @@ public:
Index();
virtual ~Index();
- void setDictList(const QStringList &files, const QStringList &names);
- void setKanjiDictList(const QStringList &files, const QStringList &names);
+ void setDictList(const TQStringList &files, const TQStringList &names);
+ void setKanjiDictList(const TQStringList &files, const TQStringList &names);
- SearchResult search(QRegExp, const QString &, bool common);
- SearchResult searchKanji(QRegExp, const QString &, bool common);
- SearchResult searchPrevious(QRegExp, const QString &, SearchResult, bool common);
+ SearchResult search(TQRegExp, const TQString &, bool common);
+ SearchResult searchKanji(TQRegExp, const TQString &, bool common);
+ SearchResult searchPrevious(TQRegExp, const TQString &, SearchResult, bool common);
// convenience function to create suitable regexps
- static QRegExp createRegExp(SearchType type, const QString &text, DictionaryType dictionaryType, bool caseSensitive = false);
+ static TQRegExp createRegExp(SearchType type, const TQString &text, DictionaryType dictionaryType, bool caseSensitive = false);
private:
- QPtrList<File> dictFiles;
- QPtrList<File> kanjiDictFiles;
+ TQPtrList<File> dictFiles;
+ TQPtrList<File> kanjiDictFiles;
- void loadDictList(QPtrList<File> &fileList, const QStringList &dictList, const QStringList &dictNameList);
+ void loadDictList(TQPtrList<File> &fileList, const TQStringList &dictList, const TQStringList &dictNameList);
- QStringList doSearch(File &, const QString &);
- SearchResult scanResults(QRegExp regexp, QStringList results, bool common);
- SearchResult scanKanjiResults(QRegExp regexp, QStringList results, bool common);
- int stringCompare(File &, int index, QCString);
+ TQStringList doSearch(File &, const TQString &);
+ SearchResult scanResults(TQRegExp regexp, TQStringList results, bool common);
+ SearchResult scanKanjiResults(TQRegExp regexp, TQStringList results, bool common);
+ int stringCompare(File &, int index, TQCString);
};
// lotsa helper functions
-KDE_EXPORT QString prettyKanjiReading(QStringList);
-KDE_EXPORT QString prettyMeaning(QStringList);
-KDE_EXPORT Entry parse(const QString &);
-KDE_EXPORT Entry kanjiParse(const QString &);
+KDE_EXPORT TQString prettyKanjiReading(TQStringList);
+KDE_EXPORT TQString prettyMeaning(TQStringList);
+KDE_EXPORT Entry parse(const TQString &);
+KDE_EXPORT Entry kanjiParse(const TQString &);
KDE_EXPORT Dict::Entry firstEntry(Dict::SearchResult);
-KDE_EXPORT QString firstEntryText(Dict::SearchResult);
+KDE_EXPORT TQString firstEntryText(Dict::SearchResult);
int eucStringCompare(const char *str1, const char *str2);
bool isEUC(unsigned char c);