//! 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();
//! stop current operation
void stop();
+ //! loads translations for each plugin only once
void retranslate();
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<Translation*> 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<Translation*> 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
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;