Merge branch 'master' of ssh://drop.maemo.org/git/mdictionary
[mdictionary] / src / plugins / google / TranslationGoogle.h
diff --git a/src/plugins/google/TranslationGoogle.h b/src/plugins/google/TranslationGoogle.h
new file mode 100644 (file)
index 0000000..963ac90
--- /dev/null
@@ -0,0 +1,77 @@
+/*******************************************************************************
+
+    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 TranslationGoogle.h
+    \author Jakub Jaszczynski <j.j.jaszczynski@gmail.com>
+*/
+
+#ifndef TRANSLATIONGOOGLE_H
+#define TRANSLATIONGOOGLE_H
+
+#include "../../common/translation.h"
+#include "GooglePlugin.h"
+
+class GooglePlugin;
+
+class TranslationGoogle : public Translation
+{
+public:
+    TranslationGoogle();
+    TranslationGoogle(QString _key,QString _trans,QString _dictionaryInfo,
+                      GooglePlugin *googlePlugin);
+    ~TranslationGoogle();
+
+    //! \return word to be translated
+    QString key() const;
+
+    /*! \returns dictionary information (plugin name, languages, <logo> etc)\
+        to be displayed in translation table header*/
+    QString dictionaryInfo() const;
+
+    //! \return parsed raw format into html
+    QString toHtml() const;
+
+    /*! 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
+    void setDictionaryInfo(QString);
+
+    //! \return whether given translation is taken from bookmarks
+    bool isBookmark() const {
+        return _bookmark;
+   }
+
+    //! returns coresponding dict object
+    uint dict() const {return _dictHash;}
+
+private:
+    QString _key;
+    QString _dictionaryInfo;
+    QString _trans;
+    GooglePlugin *googlePlugin;
+    int _dictHash;
+    bool error;
+
+};
+
+#endif // TRANSLATIONGOOGLE_H