changed the return value of searchWordList function
[mdictionary] / trunk / src / plugins / xdxf / src / XdxfPlugin / xdxfplugin.h
1 #ifndef XDXFPLUGIN_H
2 #define XDXFPLUGIN_H
3
4 #include "../../../../includes/CommonDictInterface.h"
5 #include <QObject>
6 #include <QDialog>
7 #include <QRegExp>
8 #include "TranslationXdxf.h"
9
10 class XdxfPlugin : public CommonDictInterface
11 {
12     Q_OBJECT
13     Q_INTERFACES(CommonDictInterface)
14 public:
15     XdxfPlugin(QObject *parent=0);
16
17     //! returns source language code iso 639-2
18     QString langFrom() const;
19
20     //! returns destination language code iso 639-2
21     QString langTo() const;
22
23     //! returns dictionary name (like "old english" or so
24     QString name() const;
25
26     //! returns dictionary type (xdxf, google translate, etc)
27     QString type() const;
28
29     //! returns information about dictionary in html (name, authors, etc)
30     QString infoNote() const;
31
32     //! return dialog that creates new dictionary and fills necesary options
33     //! QDialog should returns Setting* object after being showed
34     QDialog* loadDialog();
35
36     //! return dialog with dictionary settings
37     QDialog* settingsDialog();
38
39     //! return new, clean copy of plugin with setting set as in Settings*
40     CommonDictInterface* getNew(const Settings*) const;
41
42     //! returns whether plugin can start searching
43     bool isAvailable() const;
44
45     //! returns a description of a word given by a QString
46     QString search(QString key);
47
48     //! returns a unique hash for a dictionary
49     uint hash() const;
50
51 public Q_SLOTS:
52     /*! performs search in dictionary
53       \param  word word to search in dictionary
54       \param limit limit on number of results
55
56       After finishing search it have to emit
57       \see CommonDictInterface:finalTranslation  finalTranslation
58     */
59     QList<Translation*> searchWordList(QString word, int limit);
60
61     //! stop current operation
62     void stop();
63
64 private:
65     bool isCached();
66     QString _langFrom;
67     QString _langTo;
68     QString _name;
69     QString _type;
70     QString _infoNote;
71     QDialog *_loadDialog;
72     QDialog *_settingsDialog;
73     QString path;
74     bool stopped;   /*volatile*/
75 };
76
77 #endif // XDXFPLUGIN_H
78
79