1 /*******************************************************************************
3 This file is part of mDictionary.
5 mDictionary is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 mDictionary is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with mDictionary. If not, see <http://www.gnu.org/licenses/>.
18 Copyright 2010 Comarch S.A.
20 *******************************************************************************/
21 /*! \file TranslationXdxf.h
23 #ifndef TRANSLATIONSTARDICT_H
24 #define TRANSLATIONSTARDICT_H
29 #include <QTranslator>
30 #include <QCoreApplication>
34 #include "StarDictReaderFactory.h"
35 #include "../../include/translation.h"
36 #include "StarDictPlugin.h"
37 #include "../../include/Notify.h"
38 #include "TranslationStarDict.h"
40 class TranslationStarDict : public Translation
43 TranslationStarDict();
44 TranslationStarDict(QString _key,
45 QString _dictionaryInfo,
46 StarDictPlugin *starDictPlugin);
47 TranslationStarDict(const TranslationStarDict &base);
49 //! \return word to be translated
52 //! \return parsed raw format into xml
53 QString toXml() const;
55 /*! sets the word for which we want to find a translation
56 \param word for which we want to find a translation */
59 //! sets information about dictionary
60 void setDictionaryInfo(QString);
62 //! \return whether given translation is taken from bookmarks
63 int isBookmark() const {
67 //! returns corresponding dict object
68 uint dict() const {return _dictHash;}
70 /*! Add another hit in *.id(x) file
71 \param offset offset from begining of file to searched keyword
72 \param len lenght of searched keyword
74 void add(qint64 offset, qint32 len);
78 bool operator==(const TranslationStarDict &key) {
79 if (this->key() == key.key())
86 QString _dictionaryInfo;
87 StarDictPlugin *starDictPlugin;
89 QVector<qint64> offsets;
90 QVector<qint32> lengths;
94 #endif // TRANSLATIONSTARDICT_H