multitran.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*****************************************************************************
  2. * This file is a part of QStarDict, a StarDict clone written using Qt *
  3. * multitran.cpp - Plugin for multitran-data (multitran.sf.net) *
  4. * Copyright (C) 2008 Nick Shaforostoff *
  5. * *
  6. * This program is free software; you can redistribute it and/or modify *
  7. * it under the terms of the GNU General Public License as published by *
  8. * the Free Software Foundation; either version 2 of the License, or *
  9. * (at your option) any later version. *
  10. * *
  11. * This program is distributed in the hope that it will be useful, *
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  14. * GNU General Public License for more details. *
  15. * *
  16. * You should have received a copy of the GNU General Public License along *
  17. * with this program; if not, write to the Free Software Foundation, Inc., *
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
  19. *****************************************************************************/
  20. #ifndef MULTITRAN_H
  21. #define MULTITRAN_H
  22. #include "../dictplugin.h"
  23. #include <string>
  24. #include <QVector>
  25. #include <QHash>
  26. class Multitran: public QObject, public QStarDict::DictPlugin
  27. {
  28. Q_OBJECT
  29. Q_INTERFACES(QStarDict::DictPlugin)
  30. #if QT_VERSION >= 0x050000
  31. Q_PLUGIN_METADATA(IID "org.qstardict.DictPlugin/1.0" FILE "multitran.json")
  32. #endif
  33. public:
  34. Multitran(QObject *parent = 0);
  35. ~Multitran();
  36. QString name() const
  37. { return "multitran"; }
  38. QString version() const
  39. { return "0.1"; }
  40. QString description() const
  41. { return "The Multitran plugin"; }
  42. QStringList authors() const
  43. { return QStringList()
  44. << tr("Stanislav Ievlev <inger@altlinux.org>")
  45. << tr("Nick Shaforostoff <shaforostoff@kde.ru>"); }
  46. Features features() const
  47. { return Features(/*SearchSimilar | SettingsDialog*/); }
  48. QStringList availableDicts() const;
  49. QStringList loadedDicts() const {return QStringList("Multitran");}//{ return m_loadedDicts.keys(); }
  50. void setLoadedDicts(const QStringList &loadedDicts);
  51. DictInfo dictInfo(const QString &dict);
  52. bool isTranslatable(const QString &dict, const QString &word);
  53. Translation translate(const QString &dict, const QString &word);
  54. virtual QStringList findSimilarWords(const QString &dict, const QString &word);
  55. int execSettingsDialog(QWidget *parent);
  56. //friend class SettingsDialog;
  57. private:
  58. QStringList m_dictDirs;
  59. QHash<QString, int> m_loadedDicts;
  60. };
  61. #endif // MULTITRAN_H
  62. // vim: tabstop=4 softtabstop=4 shiftwidth=4 expandtab cindent