removeAccents refactorized out to the AccentsNormalizer class
[mdictionary] / trunk / src / plugins / xdxf / src / xdxfplugin.h
index 0757b6a..f3cabe6 100644 (file)
 
 *******************************************************************************/
 
+
+/*! \file xdxfplugin.h
+*/
 #ifndef XDXFPLUGIN_H
 #define XDXFPLUGIN_H
 
-#include "../../../includes/CommonDictInterface.h"
+
 #include <QObject>
 #include <QDialog>
 #include <QRegExp>
 #include <QSqlQuery>
 #include <QSqlDatabase>
 #include <QSqlError>
+#include <QFile>
+#include <QXmlStreamReader>
+#include <QtPlugin>
+
+#include "../../../includes/CommonDictInterface.h"
+#include "../../../includes/settings.h"
 #include "XdxfDictDialog.h"
+#include "XdxfCachingDialog.h"
+#include "TranslationXdxf.h"
 
 class TranslationXdxf;
 
@@ -40,6 +51,7 @@ class XdxfPlugin : public CommonDictInterface
     Q_INTERFACES(CommonDictInterface)
 public:
     XdxfPlugin(QObject *parent=0);
+    ~XdxfPlugin();
 
     //! returns source language code iso 639-2
     QString langFrom() const;
@@ -57,11 +69,10 @@ public:
     QString infoNote() const;
 
     /*! returns DictDialog object that creates dialogs
-        for adding new dictionary and change plugin settings
+        for adding new dictionary and change plugin tings
       */
     DictDialog* dictDialog();
 
-
     //! returns new, clean copy of plugin with setting set as in Settings*
     CommonDictInterface* getNew(const Settings*) const;
 
@@ -103,12 +114,11 @@ public Q_SLOTS:
     void stop();
 
 Q_SIGNALS:
-    //! emited with percent count of caching progress
-    void update(float);
+    //! emited with percent count of caching progress, and time elapsed from
+    //! last signal emit
+    void updateCachingProgress(int, int);
 
 
-protected:
-    QString removeAccents(QString);
 
 private:
 /*! returns true or false depending on whether the dictionary is cached
@@ -123,6 +133,9 @@ private:
     QList<Translation*> searchWordListFile(QString word, int limit=0);
     QString searchFile(QString key);
     QString searchCache(QString key);
+    //! scan dictionary file to get information about it
+    void getDictionaryInfo();
+
     int countWords();
     bool makeCache(QString dir);
 
@@ -136,8 +149,6 @@ private:
     QString _type;
     //! information about dictionary
     QString _infoNote;
-    QDialog *_loadDialog;
-    QDialog *_settingsDialog;
     //! path to dictionary file
     QString path;
     uint _hash;
@@ -148,12 +159,14 @@ private:
     //! number of words in dicrionary
     long _wordsCount;
 
-    //! scan dictionary file to get information about it
-    void getDictionaryInfo();
 
     volatile bool stopped;
     Settings *_settings;
     XdxfDictDialog* _dictDialog;
+    XdxfCachingDialog* cachingDialog;
+//    extern void initAccents();
+ //   extern QString removeAccents(QString string);
+
 };
 
 #endif // XDXFPLUGIN_H