Added HistoryTranslation class
authorBartosz Szatkowski <bulislaw@linux.com>
Mon, 16 Aug 2010 10:30:04 +0000 (12:30 +0200)
committerBartosz Szatkowski <bulislaw@linux.com>
Mon, 16 Aug 2010 10:30:55 +0000 (12:30 +0200)
Translation specyfic implementation for bookmarks

trunk/src/base/backbone/HistoryTranslation.h [new file with mode: 0644]

diff --git a/trunk/src/base/backbone/HistoryTranslation.h b/trunk/src/base/backbone/HistoryTranslation.h
new file mode 100644 (file)
index 0000000..c1add44
--- /dev/null
@@ -0,0 +1,85 @@
+/*******************************************************************************
+
+    This file is part of mDictionary.
+
+    mDictionary is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    mDictionary is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with mDictionary.  If not, see <http://www.gnu.org/licenses/>.
+
+    Copyright 2010 Comarch S.A.
+
+*******************************************************************************/
+
+/*! /file HistoryTranslation.h
+\brief Bookmarks functionality needs its own translation  object - becouse
+    Translation object should use slighty different api of Bookmarks objects
+
+\author Bartosz Szatkowski <bulislaw@linux.com>
+*/
+#ifndef HISTORYTRANSLATION_H
+#define HISTORYTRANSLATION_H
+
+#ifndef BOOKMARKS_H
+#define BOOKMARKS_H
+
+#include "../../includes/settings.h"
+#include "../../includes/translation.h"
+
+class Bookmarks;
+
+
+class HistoryTranslation : public Translation
+{
+public:
+    TranslationXdxf();
+    TranslationXdxf(QString key, Bookmarks* bookmarks) {
+        _key = key;
+        _dictionaryInfo = "Bookmarks";
+        _bookmarks = bookmarks;
+    }
+
+    //! \return word to be translated
+    QString key() const {
+        return _key;
+    }
+
+    /*! \returns dictionary information (plugin name, languages, <logo> etc)\
+        to be displayed in translation table header*/
+    QString dictionaryInfo() const {
+        return _dictionaryInfo;
+    }
+
+    //! \return parsed raw format into html
+    QString toHtml() const {
+        return _bookmarks->search(_key);
+    }
+
+    /*! sets the word for which we want to find a translation
+        \param word for which we want to find a translation */
+    void setKey(QString key) {
+        _key = key;
+    };
+
+    //! sets information about dictionary
+    void setDictionaryInfo(QString dictionaryInfo) {
+        _dictionaryInfo = dictionaryInfo;
+    }
+
+
+private:
+    QString _key;
+    QString _dictionaryInfo;
+    Bookmarks* _bookmarks;
+
+};
+
+#endif // HISTORYTRANSLATION_H