small change
[mdictionary] / trunk / src / includes / translation.h
index a157c19..3940f60 100644 (file)
 
 *******************************************************************************/
 
-//Created by Bartosz Szatkowski
+/*! /file translation.h
+\brief Interface for translation instances \see Translation
+
+\author Bartosz Szatkowski <bulislaw@linux.com>
+*/
 
 #ifndef TRANSLATION_H
 #define TRANSLATION_H
 
 #include <QString>
 #include <QMetaType>
+class CommonDictInterface;
 
 
-//! Keeping raw form of translation to be parsed only when needed
+/*! Translation is kind of GoF proxy, it stores key:translation pair and
+  provide it in lazy way -> key is available always, but translation is fetched
+  as late as possible*/
 class Translation {
   public:
+    Translation  () { _bookmark = 0; }
     //! \return word to be translated
     virtual QString key() const = 0;
  
@@ -45,6 +53,22 @@ class Translation {
     //! \return parsed raw format into html
     virtual QString toHtml() const = 0;
 
+    //! \retrun whether given translation is taken from bookmarks
+    virtual bool isBookmark() const {
+        return _bookmark;
+   }
+
+   //! \param b if true then translation is from bookmarks
+   void setBookmark(bool b) {
+       _bookmark = b;
+   }
+
+    //! returns coresponding dict object
+   virtual uint dict() const {return 0;}
+
+   protected:
+       bool _bookmark;
+
 };
 
 Q_DECLARE_METATYPE(Translation*);