multitran.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. Q_PLUGIN_METADATA(IID "org.qstardict.DictPlugin/1.0" FILE "multitran.json")
  31. public:
  32. Multitran(QObject *parent = 0);
  33. ~Multitran();
  34. QString name() const
  35. { return "multitran"; }
  36. QString version() const
  37. { return "0.1"; }
  38. QString description() const
  39. { return "The Multitran plugin"; }
  40. QStringList authors() const
  41. { return QStringList()
  42. << tr("Stanislav Ievlev <inger@altlinux.org>")
  43. << tr("Nick Shaforostoff <shaforostoff@kde.ru>"); }
  44. Features features() const
  45. { return Features(/*SearchSimilar | SettingsDialog*/); }
  46. QStringList availableDicts() const;
  47. QStringList loadedDicts() const {return QStringList("Multitran");}//{ return m_loadedDicts.keys(); }
  48. void setLoadedDicts(const QStringList &loadedDicts);
  49. DictInfo dictInfo(const QString &dict);
  50. bool isTranslatable(const QString &dict, const QString &word);
  51. Translation translate(const QString &dict, const QString &word);
  52. virtual QStringList findSimilarWords(const QString &dict, const QString &word);
  53. int execSettingsDialog(QWidget *parent);
  54. //friend class SettingsDialog;
  55. private:
  56. QStringList m_dictDirs;
  57. QHash<QString, int> m_loadedDicts;
  58. };
  59. #endif // MULTITRAN_H
  60. // vim: tabstop=4 softtabstop=4 shiftwidth=4 expandtab cindent