init
[qstardict] / plugins / multitran / multitran.h
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
21 #ifndef MULTITRAN_H
22 #define MULTITRAN_H
23
24 #include "../dictplugin.h"
25
26 #include <string>
27 #include <QVector>
28 #include <QHash>
29
30 class Multitran: public QObject, public QStarDict::DictPlugin
31 {
32     Q_OBJECT
33     Q_INTERFACES(QStarDict::DictPlugin)
34
35     public:
36         Multitran(QObject *parent = 0);
37         ~Multitran();
38
39         QString name() const
40         { return "multitran"; }
41         QString version() const
42         { return "0.1"; }
43         QString description() const
44         { return "The Multitran plugin"; }
45         QStringList authors() const
46         { return QStringList()
47             << tr("Stanislav Ievlev <inger@altlinux.org>")
48             << tr("Nick Shaforostoff <shaforostoff@kde.ru>"); }
49         Features features() const
50         { return Features(/*SearchSimilar | SettingsDialog*/); }
51
52         QStringList availableDicts() const;
53         QStringList loadedDicts() const {return QStringList("Multitran");}//{ return m_loadedDicts.keys(); }
54         void setLoadedDicts(const QStringList &loadedDicts);
55         DictInfo dictInfo(const QString &dict);
56
57         bool isTranslatable(const QString &dict, const QString &word);
58         Translation translate(const QString &dict, const QString &word);
59         virtual QStringList findSimilarWords(const QString &dict, const QString &word);
60
61         int execSettingsDialog(QWidget *parent);
62
63         //friend class SettingsDialog;
64
65     private:
66         QStringList m_dictDirs;
67         QHash<QString, int> m_loadedDicts;
68 };
69
70 #endif // MULTITRAN_H
71
72 // vim: tabstop=4 softtabstop=4 shiftwidth=4 expandtab cindent
73