We now have a current svn snapshot of libqxt in our contrib dir, and
[quassel.git] / src / contrib / libqxt-2007-10-24 / src / gui / qxtapplication.h
diff --git a/src/contrib/libqxt-2007-10-24/src/gui/qxtapplication.h b/src/contrib/libqxt-2007-10-24/src/gui/qxtapplication.h
new file mode 100644 (file)
index 0000000..f77481d
--- /dev/null
@@ -0,0 +1,73 @@
+/****************************************************************************\r
+**\r
+** Copyright (C) Qxt Foundation. Some rights reserved.\r
+**\r
+** This file is part of the QxtGui module of the Qt eXTension library\r
+**\r
+** This library is free software; you can redistribute it and/or modify it\r
+** under the terms of th Common Public License, version 1.0, as published by\r
+** IBM.\r
+**\r
+** This file is provided "AS IS", without WARRANTIES OR CONDITIONS OF ANY\r
+** KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY\r
+** WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR\r
+** FITNESS FOR A PARTICULAR PURPOSE.\r
+**\r
+** You should have received a copy of the CPL along with this file.\r
+** See the LICENSE file and the cpl1.0.txt file included with the source\r
+** distribution for more information. If you did not receive a copy of the\r
+** license, contact the Qxt Foundation.\r
+**\r
+** <http://libqxt.sourceforge.net>  <foundation@libqxt.org>\r
+**\r
+****************************************************************************/\r
+#ifndef QXTAPPLICATION_H\r
+#define QXTAPPLICATION_H\r
+\r
+#include <QApplication>\r
+#include "qxtglobal.h"\r
+#include "qxtpimpl.h"\r
+\r
+class QxtApplicationPrivate;\r
+class QxtNativeEventFilter;\r
+\r
+#define qxtApp (QxtApplication::instance())\r
+\r
+class QXT_GUI_EXPORT QxtApplication : public QApplication\r
+{\r
+    Q_OBJECT\r
+    QXT_DECLARE_PRIVATE(QxtApplication);\r
+\r
+public:\r
+    QxtApplication(int& argc, char** argv);\r
+    QxtApplication(int& argc, char** argv, bool GUIenabled);\r
+    QxtApplication(int& argc, char** argv, Type type);\r
+#if defined(Q_WS_X11)\r
+    QxtApplication(Display* display, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0);\r
+    QxtApplication(Display* display, int& argc, char** argv, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0);\r
+#endif // Q_WS_X11\r
+    virtual ~QxtApplication();\r
+\r
+    void installNativeEventFilter(QxtNativeEventFilter* filter);\r
+    void removeNativeEventFilter(QxtNativeEventFilter* filter);\r
+\r
+#ifndef QXT_DOXYGEN_RUN\r
+#if defined(Q_WS_X11)\r
+    virtual bool x11EventFilter(XEvent* event);\r
+#elif defined(Q_WS_WIN)\r
+    virtual bool winEventFilter(MSG* msg, long* result);\r
+#elif defined(Q_WS_MAC)\r
+    virtual bool macEventFilter(EventHandlerCallRef caller, EventRef event);\r
+#endif // Q_WS_*\r
+#endif // QXT_DOXYGEN_RUN\r
+\r
+    bool addHotKey(Qt::KeyboardModifiers modifiers, Qt::Key key, QWidget* receiver, const char* member);\r
+    bool removeHotKey(Qt::KeyboardModifiers modifiers, Qt::Key key, QWidget* receiver, const char* member);\r
+\r
+    inline static QxtApplication* instance()\r
+    {\r
+        return static_cast<QxtApplication*>(QApplication::instance());\r
+    }\r
+};\r
+\r
+#endif // QXTAPPLICATION_H\r