dict.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 DICT_H
  21. #define DICT_H
  22. #include <Plasma/Applet>
  23. #include <Plasma/DataEngine>
  24. class QTimer;
  25. class CheckableStringListModel;
  26. class QTextBrowser;
  27. class QGraphicsProxyWidget;
  28. class QGraphicsLinearLayout;
  29. namespace Plasma
  30. {
  31. class IconWidget;
  32. class LineEdit;
  33. }
  34. class QStarDictApplet: public Plasma::Applet
  35. {
  36. Q_OBJECT
  37. public:
  38. QStarDictApplet(QObject *parent, const QVariantList &args);
  39. ~QStarDictApplet();
  40. void init();
  41. void setPath(const QString&);
  42. public slots:
  43. void dataUpdated(const QString &name, const Plasma::DataEngine::Data &data);
  44. void autoDefine(const QString &word);
  45. void linkDefine(const QString &word);
  46. protected slots:
  47. void define();
  48. void configAccepted();
  49. protected:
  50. void createConfigurationInterface(KConfigDialog *parent);
  51. private:
  52. QString m_source;
  53. QTimer* m_timer;
  54. //QGraphicsPixmapItem *m_graphicsIcon;
  55. QGraphicsLinearLayout *m_layout;
  56. QGraphicsLinearLayout *m_horLayout;
  57. Plasma::LineEdit *m_wordEdit;
  58. //Plasma::Flash *m_flash;
  59. QStringList m_defList;
  60. QStringList::iterator m_i;
  61. QTextBrowser* m_defBrowser;
  62. QGraphicsProxyWidget *m_defBrowserProxy;
  63. Plasma::IconWidget *m_icon;
  64. // QList< QPair<QString, bool> > m_dicts;
  65. QPointer<CheckableStringListModel> m_dictsModel;
  66. QStringList m_dicts;
  67. QHash<QString,bool> m_activeDicts;
  68. };
  69. K_EXPORT_PLASMA_APPLET(qstardict, QStarDictApplet)
  70. #endif