fix small bug(wildcard), and change some comments
[mdictionary] / src / plugins / stardict / TranslationStarDict.h
index 6a18cf8..95309ff 100644 (file)
     Copyright 2010 Comarch S.A.
 
 *******************************************************************************/
-/*! \file TranslationXdxf.h
-*/
+/*!
+    \file TranslationStarDict.h
+    \author Mateusz Półrola <mateusz.polrola@comarch.pl>
+ */
+
 #ifndef TRANSLATIONSTARDICT_H
 #define TRANSLATIONSTARDICT_H
 
 #include <QString>
+#include <QHash>
+#include <QDebug>
+#include <QTranslator>
+#include <QCoreApplication>
+#include <QThread>
+#include <QSet>
+
+#include "StarDictReaderFactory.h"
 #include "../../include/translation.h"
 #include "StarDictPlugin.h"
+#include "../../include/Notify.h"
+#include "TranslationStarDict.h"
 
 class TranslationStarDict : public Translation
 {
@@ -34,6 +47,7 @@ public:
     TranslationStarDict(QString _key,
                     QString _dictionaryInfo,
                     StarDictPlugin *starDictPlugin);
+    TranslationStarDict(const TranslationStarDict &base);
 
     //! \return word to be translated
     QString key() const;
@@ -41,8 +55,10 @@ public:
     //! \return parsed raw format into xml
     QString toXml() const;
 
-    /*! sets the word for which we want to find a translation
-        \param word for which we want to find a translation */
+    /*!
+        sets the word for which we want to find a translation
+        \param word for which we want to find a translation
+    */
     void setKey(QString);
 
     //! sets information about dictionary
@@ -56,12 +72,28 @@ public:
     //! returns corresponding dict object
     uint dict() const {return _dictHash;}
 
+    /*!
+        Add another hit in *.id(x) file
+        \param offset offset from begining of file to searched keyword
+        \param len lenght of searched keyword
+    */
+    void add(qint64 offset, qint32 len);
+
+    bool operator==(const TranslationStarDict &key) {
+        if (this->key() == key.key())
+            return true;
+        return false;
+    }
+
 private:
     QString _key;
     QString _dictionaryInfo;
     StarDictPlugin *starDictPlugin;
     int _dictHash;
+    QVector<qint64> offsets;
+    QVector<qint32> lengths;
 };
 
+
 #endif // TRANSLATIONSTARDICT_H