init
[qstardict] / kdeplasma / dataengine / dictengine.h
1 /*
2  *   Copyright (C) 2008 Nick Shaforostoff <shaforostoff@kde.ru>
3  *
4  *   based on work by:
5  *   Copyright (C) 2007 Thomas Georgiou <TAGeorgiou@gmail.com> and Jeff Cooper <weirdsox11@gmail.com>
6  *
7  *   This program is free software; you can redistribute it and/or
8  *   modify it under the terms of the GNU General Public License as
9  *   published by the Free Software Foundation; either version 2 of 
10  *   the License, or (at your option) any later version.
11  *
12  *   This program is distributed in the hope that it will be useful,
13  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *   GNU General Public License for more details.
16  *
17  *   You should have received a copy of the GNU General Public License
18  *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
19  */
20
21
22 #ifndef DICTENGINE_H
23 #define DICTENGINE_H
24 #include <Plasma/DataEngine>
25 #include <QString>
26 #include <QList>
27 namespace QStarDict {class DictPlugin;}
28
29 /**
30  * This class evaluates the basic expressions given in the interface.
31  */
32
33
34 class QStarDictEngine : public Plasma::DataEngine
35 {
36     Q_OBJECT
37
38     public:
39         QStarDictEngine(QObject* parent, const QVariantList& args );
40         ~QStarDictEngine();
41
42     protected:
43         bool sourceRequestEvent(const QString &word);
44     private:
45         /**
46          * also loads plugin if it's not loaded
47          */
48         QStarDict::DictPlugin* dictPlugin(const QString &name);
49
50     private slots:
51         void unloadPlugins();
52     private:
53         class Private;
54         Private * const d;
55 };
56
57 K_EXPORT_PLASMA_DATAENGINE(qstardict, QStarDictEngine)
58
59 #endif