1 /*****************************************************************************
2 * dbusadaptor.h - QStarDict, a StarDict clone written with using Qt *
3 * Copyright (C) 2007 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 *****************************************************************************/
23 #include <QDBusAbstractAdaptor>
31 * The DBusAdaptor class represents and QStarDict D-Bus interface.
33 class DBusAdaptor: public QDBusAbstractAdaptor
36 Q_CLASSINFO("D-Bus Interface", "org.qstardict.dbus")
38 * The main window visible property.
40 Q_PROPERTY(int mainWindowVisible READ mainWindowVisible WRITE setMainWindowVisible)
44 * Construct a DBusAdaptor.
46 DBusAdaptor(MainWindow *mainWindow);
49 * Return true if main window is visible, otherwise return
52 bool mainWindowVisible() const;
54 * Set visible state of main window.
56 void setMainWindowVisible(bool visible);
60 * Show main window with translation of text.
62 void showTranslation(const QString &text);
64 * Show popup window with translation of text.
66 void showPopup(const QString &text);
68 * Return a translation of text in plain text format.
70 QString translate(const QString &text);
72 * Return a translation of text in HTML format.
74 QString translateHtml(const QString &text);
77 MainWindow *m_mainWindow;
82 #endif // DBUSADAPTOR_H
84 // vim: tabstop=4 softtabstop=4 shiftwidth=4 expandtab cindent textwidth=120 formatoptions=tc