1 /*****************************************************************************
2 * stardict.h - QStarDict, a StarDict clone written using Qt *
3 * Copyright (C) 2008 Alexander Rodin *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License along *
16 * with this program; if not, write to the Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
18 *****************************************************************************/
24 #include "../dictplugin.h"
31 class StarDict: public QObject, public QStarDict::DictPlugin
34 Q_INTERFACES(QStarDict::DictPlugin)
37 StarDict(QObject *parent = 0);
41 { return "stardict"; }
42 QString version() const
44 QString description() const
45 { return "The StarDict plugin"; }
46 QStringList authors() const
47 { return QStringList()
48 << "Hu Zheng <huzheng_001@163.com>"
49 << "Opera Wang <wangvisual@sohu.com>"
50 << "Alexander Rodin <rodin.alexander@gmail.com>"; }
51 Features features() const
52 { return Features(SearchSimilar | SettingsDialog); }
54 QStringList availableDicts() const;
55 QStringList loadedDicts() const
56 { return m_loadedDicts.keys(); }
57 void setLoadedDicts(const QStringList &loadedDicts);
58 DictInfo dictInfo(const QString &dict);
60 bool isTranslatable(const QString &dict, const QString &word);
61 Translation translate(const QString &dict, const QString &word);
62 virtual QStringList findSimilarWords(const QString &dict, const QString &word);
64 int execSettingsDialog(QWidget *parent);
66 friend class SettingsDialog;
69 QString parseData(const char *data, int dictIndex = -1,
70 bool htmlSpaces = false, bool reformatLists = false, bool expandAbbreviations = false);
73 QStringList m_dictDirs;
74 QHash<QString, int> m_loadedDicts;
76 bool m_expandAbbreviations;
81 // vim: tabstop=4 softtabstop=4 shiftwidth=4 expandtab cindent