Plasma
dictengine.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef DICTENGINE_H
00020 #define DICTENGINE_H
00021 #include <Plasma/DataEngine>
00022 #include <QMap>
00023 #include <QString>
00024 #include <QList>
00025 class QTcpSocket;
00026
00032 class DictEngine: public Plasma::DataEngine
00033 {
00034 Q_OBJECT
00035
00036 public:
00037 DictEngine( QObject* parent, const QVariantList& args );
00038 ~DictEngine();
00039
00040 protected:
00041 bool sourceRequestEvent(const QString &word);
00042
00043 private slots:
00044 void getDefinition();
00045 void socketClosed();
00046 void getDicts();
00047
00048 private:
00049 void setDict(const QString &dict);
00050 void setServer(const QString &server);
00051
00052 QHash<QString, QString> dictNameToDictCode;
00053 QTcpSocket *tcpSocket;
00054 QString currentWord;
00055 QString dictName;
00056 QString serverName;
00057
00058 };
00059
00060 K_EXPORT_PLASMA_DATAENGINE(dict, DictEngine)
00061
00062 #endif