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_P_H
\r
25 #define QXTAPPLICATION_P_H
\r
29 #include <QMultiHash>
\r
30 #include "qxtpimpl.h"
\r
31 #include "qxtapplication.h"
\r
32 #include "qxtnativeeventfilter.h"
\r
34 typedef QPair<uint, uint> Identifier;
\r
35 typedef QList<Identifier> Identifiers;
\r
36 typedef QPair<QWidget*, const char*> Receiver;
\r
37 typedef QList<Receiver> Receivers;
\r
39 class QxtApplicationPrivate : public QxtPrivate<QxtApplication>
\r
42 QXT_DECLARE_PUBLIC(QxtApplication);
\r
44 uint nativeKeycode(Qt::Key key) const;
\r
45 uint nativeModifiers(Qt::KeyboardModifiers modifiers) const;
\r
47 bool registerHotKey(uint modifiers, uint keycode, QWidget* receiver);
\r
48 bool unregisterHotKey(uint modifiers, uint keycode, QWidget* receiver);
\r
49 void activateHotKey(uint modifiers, uint keycode) const;
\r
51 QMultiHash<Identifier, Receiver> hotkeys;
\r
52 QList<QxtNativeEventFilter*> nativeFilters;
\r
55 inline uint qHash(const QPair<uint, uint>& value)
\r
57 return qHash(value.first) ^ qHash(value.second);
\r
60 #endif // QXTAPPLICATION_P_H
\r