1/*
2 Copyright (C) 2001 Ellis Whitehead <ellis@kde.org>
3
4 Win32 port:
5 Copyright (C) 2004 Jarosław Staniek <staniek@kde.org>
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
16
17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA.
21*/
22
23#ifndef _KKEYSERVER_H
24#define _KKEYSERVER_H
25
26#include <kdeui_export.h>
27
28#if defined Q_WS_X11 /*or defined Q_WS_WIN*/
29#include "kkeyserver_x11.h"
30#elif defined Q_WS_MACX
31#include "kkeyserver_mac.h"
32#elif defined Q_WS_WIN
33#include "kkeyserver_win.h"
34#endif
35
36/**
37 * A collection of functions for the conversion of key presses and
38 * their modifiers from the window system specific format
39 * to the generic format and vice-versa.
40 */
41namespace KKeyServer {
42 /**
43 * Converts the mask of ORed KKey::ModFlag modifiers to a
44 * user-readable string.
45 * @param mod the mask of ORed KKey::ModFlag modifiers
46 * @return the user-readable string
47 */
48 KDEUI_EXPORT QString modToStringUser( uint mod );
49
50 /**
51 * Converts the modifier given as user-readable string
52 * to KKey::ModFlag modifier, or 0.
53 * @internal
54 */
55 KDEUI_EXPORT uint stringUserToMod( const QString& mod );
56
57 /**
58 * Test if the shift modifier should be recorded for a given key.
59 *
60 * For example, if shift+5 produces '%' Qt wants ctrl+shift+5 recorded as ctrl+% and
61 * in that case this function would return false.
62 *
63 * @since 4.7.1
64 */
65 KDEUI_EXPORT bool isShiftAsModifierAllowed( int keyQt );
66
67} // namespace KKeyServer
68
69#endif // !_KKEYSERVER_H
70