X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fplugins%2Fxdxf%2Fxdxfplugin.h;h=76ac714646a5a57ceb355f52a94bda4ab98a0457;hb=4242fe38b152bd4d71916bfd21ddbaa20df512c9;hp=fcaf34a0c06d600694521f2f2a97e64b41ff49c4;hpb=a5c3ef7afaa6a96c19dae79d54e65edcd120cd83;p=mdictionary diff --git a/src/plugins/xdxf/xdxfplugin.h b/src/plugins/xdxf/xdxfplugin.h index fcaf34a..76ac714 100644 --- a/src/plugins/xdxf/xdxfplugin.h +++ b/src/plugins/xdxf/xdxfplugin.h @@ -83,12 +83,6 @@ public: //! returns a description of a word given by a QString QString search(QString key); - //! returns a unique hash for a dictionary - uint hash() const; - - //! sets unique value (unique for every dictionary, not plugin) - void setHash(uint); - //! returns current plugin settings Settings* settings(); @@ -121,6 +115,7 @@ public Q_SLOTS: //! stop current operation void stop(); + //! loads translations for each plugin only once void retranslate(); @@ -133,27 +128,43 @@ Q_SIGNALS: private: -/*! returns true or false depending on whether the dictionary is cached - or not, not implemented yet - */ - bool isCached(); - -//! sets the path to dictionary file and adds it to settings - // void setPath(QString); + /*! returns true or false depending on whether the dictionary is cached + or not, not implemented yet + */ + bool isCached(); + /*! searches for a list of words similar to a word in a database file + \param word key compared with keys in a database + \param limit limits the number of translations in returned list, + 0 means unlimited + \returns list of translations + */ QList searchWordListCache(QString word, int limit=0); + /*! searches for a list of words similar to a word in a xdxf file + \param word key compared with keys in a xdxf file + \param limit limits the number of translations in returned list, + 0 means unlimited + \returns list of translations + */ QList searchWordListFile(QString word, int limit=0); + /*! searches for a translation of a word which is exactly like a key + in xdxf file */ QString searchFile(QString key); + /*! searches for a translation of a word which is exactly like a key + in database file */ QString searchCache(QString key); //! scans dictionary file to get information about it bool getDictionaryInfo(); + //! counts the keys in xdxf file int countWords(); + /*! transforms xdxf files to database files (caching operation) + \returns true on success, false on failure */ bool makeCache(QString dir); //! language from which we translate @@ -164,14 +175,18 @@ private: QString _name; //! information about dictionary QString _infoNote; - //! path to dictionary file - // QString path; + + QString _dictionaryInfo; + + //! unique number of a dictionary assigned to it by backbone uint _hash; + //! icon displayed during translations and when the dictionary is chosen QIcon _icon; QSqlDatabase db; QString db_name; //! number of words in dictionary long _wordsCount; + //! indicates if search is stopped volatile bool stopped; Settings *_settings; XdxfDictDialog* _dictDialog;