dictengine.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. #ifndef DICTENGINE_H
  21. #define DICTENGINE_H
  22. #include <Plasma/DataEngine>
  23. #include <QString>
  24. #include <QList>
  25. namespace QStarDict {class DictPlugin;}
  26. /**
  27. * This class evaluates the basic expressions given in the interface.
  28. */
  29. class QStarDictEngine : public Plasma::DataEngine
  30. {
  31. Q_OBJECT
  32. public:
  33. QStarDictEngine(QObject* parent, const QVariantList& args );
  34. ~QStarDictEngine();
  35. protected:
  36. bool sourceRequestEvent(const QString &word);
  37. private:
  38. /**
  39. * also loads plugin if it's not loaded
  40. */
  41. QStarDict::DictPlugin* dictPlugin(const QString &name);
  42. private slots:
  43. void unloadPlugins();
  44. private:
  45. class Private;
  46. Private * const d;
  47. };
  48. K_EXPORT_PLASMA_DATAENGINE(qstardict, QStarDictEngine)
  49. #endif