virtual DictDialog* dictDialog() = 0;
- //! return new, clean copy of plugin with setting set as in Settings*
+ //! returns new, clean copy of plugin with setting set as in Settings*
virtual CommonDictInterface* getNew(const Settings*) const = 0;
//! returns whether plugin can start searching
//! \returns unique value (unique for every dictionary not plugin
virtual uint hash() const = 0;
- //! set unique value (unique for every dictionary not plugin)
+ //! sets unique value (unique for every dictionary not plugin)
virtual void setHash(uint) = 0;
//! returns current plugin settings
*/
virtual QList<Translation*> searchWordList(QString word, int limit=0) = 0;
- //! stop current operation
+ //! stops current operation
virtual void stop() = 0;
Q_SIGNALS:
public:
Settings(){}
- /*! \retrun value fo given key
+ /*! \returns value fo given key
\param key
*/
QString value(const QString key) const {
void stop();
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);
+
+ //! language from which we translate
QString _langFrom;
+ //! language to which we translate
QString _langTo;
+ //! name of a dictionary
QString _name;
+ //! type of a dictionary
QString _type;
+ //! information about dictionary
QString _infoNote;
QDialog *_loadDialog;
QDialog *_settingsDialog;
+ //! path to dictionary file
QString path;
uint _hash;
+
volatile bool stopped;
Settings *_settings;
XdxfDictDialog* _dictDialog;
}
-
-void XdxfTest::getNew() {
-/* XdxfPlugin xdxfPlugin(this);
- Settings settings;
- settings.setValue("path","dict2");
- XdxfPlugin * = xdxfPlugin.getNew(settings);
-*/
-}
-
void XdxfTest::stop() {
/*test for English-Polish dictionary */
CommonDictInterface *xdxfPlugin = new XdxfPlugin(this);
QCOMPARE(te5.size(),8);
}
+void XdxfTest::getNew() {
+ XdxfPlugin xdxfPlugin(this);
+ Settings *settings=new Settings;
+ settings->setValue("path","dict.xdxf");
+ CommonDictInterface *xdxfPlugin2 = xdxfPlugin.getNew(settings);
+ QList<Translation*> te6=xdxfPlugin2->searchWordList("*",8);
+ QCOMPARE(te6.size(),8);
+}
+
void XdxfTest::langFrom() {
/*test for English-Polish dictionary */
XdxfPlugin xdxfPlugin(this);
private slots:
+
void search();
void searchWordList();
void langFrom();