Added BookmarkTranslation
authorBartosz Szatkowski <bulislaw@linux.com>
Mon, 16 Aug 2010 10:36:25 +0000 (12:36 +0200)
committerBartosz Szatkowski <bulislaw@linux.com>
Mon, 16 Aug 2010 10:36:25 +0000 (12:36 +0200)
Translation implementation for searching in bookmarks

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

diff --git a/trunk/src/base/backbone/BookmarkTranslations.h b/trunk/src/base/backbone/BookmarkTranslations.h
new file mode 100644 (file)
index 0000000..0226f6a
--- /dev/null
@@ -0,0 +1,82 @@
+/*******************************************************************************
+
+    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 BookmarkTranslation.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 BOOKMARKTRANSLATIONS_H
+#define BOOKMARKTRANSLATIONS_H
+
+#include "../../includes/settings.h"
+#include "../../includes/translation.h"
+
+class Bookmarks;
+
+
+class BookmarkTranslation : 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
diff --git a/trunk/src/base/backbone/HistoryTranslation.h b/trunk/src/base/backbone/HistoryTranslation.h
deleted file mode 100644 (file)
index c1add44..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
-
-    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
index 3fe70ac..02bd90d 100644 (file)
@@ -51,7 +51,8 @@ HEADERS  += gui/MainWindow.h \
     ../includes/History.h \
     gui/HistoryListDialog.h \
     ../includes/GUIInterface.h \
-    backbone/Bookmarks.h
+    backbone/Bookmarks.h \
+    backbone/BookmarkTranslations.h
 
 FORMS    += gui/MainWindow.ui