1 /*****************************************************************************
2 * application.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 *****************************************************************************/
23 #include <QApplication>
25 #ifdef QSTARDICT_WITH_TRANSLATIONS
27 #endif // QSTARDICT_WITH_TRANSLATIONS
38 #ifdef QSTARDICT_WITH_DBUS
40 #endif // QSTARDICT_WITH_DBUS
43 * Main application class.
45 class Application: public QApplication
51 * Construct new QStarDict application.
53 Application(int &argc, char **argv);
61 * Enter the main event loop and wait until exit().
66 * Returns a pointer to the application's QStarDict::Application instance.
68 static Application *instance()
69 { return qobject_cast<Application*>(QCoreApplication::instance()); }
72 * Returns a pointer to the DictCore instance.
75 { return m_dictCore; }
77 * Returns a pointer to the application's main window.
79 MainWindow *mainWindow()
80 { return m_mainWindow; }
83 * Returns a pointer to the application's popup window.
85 PopupWindow *popupWindow()
86 { return m_popupWindow; }
89 * Returns a pointer to the application's speacker.
95 * Returns a pointer to the tray icon.
99 { return m_trayIcon; }
101 #ifdef QSTARDICT_WITH_DBUS
103 * Returns a pointer to the DBusAdaptor instance.
105 DBusAdaptor *dbusAdaptor()
106 { return m_dbusAdaptor; }
107 #endif // QSTARDICT_WITH_DBUS
109 #ifdef QSTARDICT_WITH_TRANSLATIONS
110 QTranslator *m_translator;
111 QTranslator *m_qtTranslator;
112 #endif // QSTARDICT_WITH_TRANSLATIONS
113 DictCore *m_dictCore;
114 MainWindow *m_mainWindow;
115 PopupWindow *m_popupWindow;
118 TrayIcon *m_trayIcon;
120 #ifdef QSTARDICT_WITH_DBUS
121 DBusAdaptor *m_dbusAdaptor;
122 #endif // QSTARDICT_WITH_DBUS
124 QString commandLineText();
129 #endif // APPLICATION_H
131 // vim: tabstop=4 softtabstop=4 shiftwidth=4 expandtab cindent