delay a few things on startup, such as setting the visibility mode, which ensures...
[personal-kdebase.git] / runtime / kdedglobalaccel / kglobalaccel_win.h
blobc22e8342c62c37c4f5d5a49daaf05bcfa3596642
1 /* This file is part of the KDE libraries
2 Copyright (C) 2001,2002 Ellis Whitehead <ellis@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #ifndef _KGLOBALACCEL_WIN_H
21 #define _KGLOBALACCEL_WIN_H
23 #include <QWidget>
25 class GlobalShortcutsRegistry;
26 /**
27 * @internal
29 * The KGlobalAccel private class handles grabbing of global keys,
30 * and notification of when these keys are pressed.
32 class KGlobalAccelImpl : public QWidget
34 Q_OBJECT
36 public:
37 KGlobalAccelImpl(GlobalShortcutsRegistry* owner);
39 public:
40 /**
41 * This function registers or unregisters a certain key for global capture,
42 * depending on \b grab.
44 * Before destruction, every grabbed key will be released, so this
45 * object does not need to do any tracking.
47 * \param key the Qt keycode to grab or release.
48 * \param grab true to grab they key, false to release the key.
50 * \return true if successful, otherwise false.
52 bool grabKey(int key, bool grab);
54 /// Enable/disable all shortcuts. There will not be any grabbed shortcuts at this point.
55 void setEnabled(bool);
57 private:
58 bool winEvent(MSG * message, long * result);
60 GlobalShortcutsRegistry* m_owner;
61 bool m_enabled;
64 #endif // _KGLOBALACCEL_WIN_H