1 /****************************************************************************
\r
3 ** Copyright (C) Qxt Foundation. Some rights reserved.
\r
5 ** This file is part of the QxtGui module of the Qt eXTension library
\r
7 ** This library is free software; you can redistribute it and/or modify it
\r
8 ** under the terms of th Common Public License, version 1.0, as published by
\r
11 ** This file is provided "AS IS", without WARRANTIES OR CONDITIONS OF ANY
\r
12 ** KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
\r
13 ** WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR
\r
14 ** FITNESS FOR A PARTICULAR PURPOSE.
\r
16 ** You should have received a copy of the CPL along with this file.
\r
17 ** See the LICENSE file and the cpl1.0.txt file included with the source
\r
18 ** distribution for more information. If you did not receive a copy of the
\r
19 ** license, contact the Qxt Foundation.
\r
21 ** <http://libqxt.sourceforge.net> <foundation@libqxt.org>
\r
23 ****************************************************************************/
\r
24 #ifndef QXTAPPLICATION_H
\r
25 #define QXTAPPLICATION_H
\r
27 #include <QApplication>
\r
28 #include "qxtglobal.h"
\r
29 #include "qxtpimpl.h"
\r
31 class QxtApplicationPrivate;
\r
32 class QxtNativeEventFilter;
\r
34 #define qxtApp (QxtApplication::instance())
\r
36 class QXT_GUI_EXPORT QxtApplication : public QApplication
\r
39 QXT_DECLARE_PRIVATE(QxtApplication);
\r
42 QxtApplication(int& argc, char** argv);
\r
43 QxtApplication(int& argc, char** argv, bool GUIenabled);
\r
44 QxtApplication(int& argc, char** argv, Type type);
\r
45 #if defined(Q_WS_X11)
\r
46 QxtApplication(Display* display, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0);
\r
47 QxtApplication(Display* display, int& argc, char** argv, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0);
\r
49 virtual ~QxtApplication();
\r
51 void installNativeEventFilter(QxtNativeEventFilter* filter);
\r
52 void removeNativeEventFilter(QxtNativeEventFilter* filter);
\r
54 #ifndef QXT_DOXYGEN_RUN
\r
55 #if defined(Q_WS_X11)
\r
56 virtual bool x11EventFilter(XEvent* event);
\r
57 #elif defined(Q_WS_WIN)
\r
58 virtual bool winEventFilter(MSG* msg, long* result);
\r
59 #elif defined(Q_WS_MAC)
\r
60 virtual bool macEventFilter(EventHandlerCallRef caller, EventRef event);
\r
62 #endif // QXT_DOXYGEN_RUN
\r
64 bool addHotKey(Qt::KeyboardModifiers modifiers, Qt::Key key, QWidget* receiver, const char* member);
\r
65 bool removeHotKey(Qt::KeyboardModifiers modifiers, Qt::Key key, QWidget* receiver, const char* member);
\r
67 inline static QxtApplication* instance()
\r
69 return static_cast<QxtApplication*>(QApplication::instance());
\r
73 #endif // QXTAPPLICATION_H
\r