Make lxqt globals a public header
[lxde/liblxqt.git] / lxqtapplication.h
1 /* BEGIN_COMMON_COPYRIGHT_HEADER
2 * (c)LGPL2+
3 *
4 * LXQt - a lightweight, Qt based, desktop toolset
5 * http://razor-qt.org
6 *
7 * Copyright: 2012-2013 Razor team
8 * Authors:
9 * Petr Vanek <petr@scribus.info>
10 *
11 * This program or library is free software; you can redistribute it
12 * and/or modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2.1 of the License, or (at your option) any later version.
15 *
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
20
21 * You should have received a copy of the GNU Lesser General
22 * Public License along with this library; if not, write to the
23 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 * Boston, MA 02110-1301 USA
25 *
26 * END_COMMON_COPYRIGHT_HEADER */
27
28 #ifndef LXQTAPPLICATION_H
29 #define LXQTAPPLICATION_H
30
31 #include <QApplication>
32 #include <QProxyStyle>
33 #include "lxqtglobals.h"
34
35 namespace LXQt
36 {
37
38 /*! \brief LXQt wrapper around QApplication.
39 * It loads various LXQt related stuff by default (window icon, icon theme...)
40 *
41 * \note This wrapper is intended to be used only inside LXQt project. Using it
42 * in external application will automatically require linking to various
43 * LXQt libraries.
44 *
45 */
46 class LXQT_API Application : public QApplication
47 {
48 Q_OBJECT
49
50 public:
51 /*! Construct a LXQt application object.
52 * \param argc standard argc as in QApplication
53 * \param argv standard argv as in QApplication
54 */
55 Application(int &argc, char **argv);
56 /*! Construct a LXQt application object.
57 * \param argc standard argc as in QApplication
58 * \param argv standard argv as in QApplication
59 * \param handleQuitSignals flag if signals SIGINT, SIGTERM, SIGHUP should be handled internaly (\sa quit() application)
60 */
61 Application(int &argc, char **argv, bool handleQuitSignals);
62 virtual ~Application() {}
63 /*! Install UNIX signal handler for signals defined in \param signalList
64 * Upon receiving of any of this signals the \sa unixSignal signal is emitted
65 */
66 void listenToUnixSignals(QList<int> const & signolList);
67
68 private slots:
69 void updateTheme();
70
71 signals:
72 void themeChanged();
73 /*! Signal is emitted upon receival of registered unix signal
74 * \param signo the received unix signal number
75 */
76 void unixSignal(int signo);
77 };
78
79 #if defined(lxqtApp)
80 #undef lxqtApp
81 #endif
82 #define lxqtApp (static_cast<LXQt::Application *>(qApp))
83
84 } // namespace LXQt
85 #endif // LXQTAPPLICATION_H