*******************************************************************************/
+
+/*! \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;
Q_INTERFACES(CommonDictInterface)
public:
XdxfPlugin(QObject *parent=0);
+ ~XdxfPlugin();
//! returns source language code iso 639-2
QString langFrom() const;
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;
void stop();
Q_SIGNALS:
- //! emited with percent count of caching progress
- void updateCachingProgress(int);
+ //! 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
QList<Translation*> searchWordListCache(QString word, int limit=0);
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);
QString _type;
//! information about dictionary
QString _infoNote;
- QDialog *_loadDialog;
- QDialog *_settingsDialog;
//! path to dictionary file
QString path;
uint _hash;
//! 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