VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/include/QIHotKeyEdit.h@ 4225

Last change on this file since 4225 was 4071, checked in by vboxsync, 18 years ago

Biggest check-in ever. New source code headers for all (C) innotek files.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.4 KB
Line 
1/** @file
2 *
3 * VBox frontends: Qt GUI ("VirtualBox"):
4 * innotek Qt extensions: QIHotKeyEdit class declaration
5 */
6
7/*
8 * Copyright (C) 2006-2007 innotek GmbH
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.virtualbox.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License as published by the Free Software Foundation,
14 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
15 * distribution. VirtualBox OSE is distributed in the hope that it will
16 * be useful, but WITHOUT ANY WARRANTY of any kind.
17 */
18
19#ifndef __QIHotKeyEdit_h__
20#define __QIHotKeyEdit_h__
21
22#include <qlabel.h>
23#if defined(Q_WS_X11)
24#include <qmap.h>
25#endif
26#if defined(Q_WS_MAC)
27#include <Carbon/Carbon.h>
28#endif
29
30
31class QIHotKeyEdit : public QLabel
32{
33 Q_OBJECT
34
35public:
36
37 QIHotKeyEdit( QWidget * parent, const char * name = 0 );
38 virtual ~QIHotKeyEdit();
39
40 void setKey( int keyval );
41 int key() const { return keyval; }
42
43 QString symbolicName() const { return symbname; }
44
45 QSize sizeHint() const;
46 QSize minimumSizeHint() const;
47
48#if defined(Q_WS_X11)
49 static void languageChange(void);
50#endif
51 static QString keyName (int key);
52 static bool isValidKey (int k);
53
54public slots:
55
56 void clear();
57
58protected:
59
60#if defined(Q_WS_WIN32)
61 bool winEvent( MSG *msg );
62#elif defined(Q_WS_X11)
63 bool x11Event( XEvent *event );
64#elif defined(Q_WS_MAC)
65 static pascal OSStatus darwinEventHandlerProc( EventHandlerCallRef inHandlerCallRef,
66 EventRef inEvent, void *inUserData );
67 bool darwinKeyboardEvent( EventRef inEvent );
68#endif
69
70 void focusInEvent( QFocusEvent * );
71 void focusOutEvent( QFocusEvent * );
72
73 void drawContents( QPainter * p );
74
75private:
76
77 void updateText();
78
79 int keyval;
80 QString symbname;
81
82 QColorGroup true_acg;
83
84#if defined(Q_WS_X11)
85 static QMap<QString, QString> keyNames;
86#endif
87
88#if defined(Q_WS_MAC)
89 /** Event handler reference. NULL if the handler isn't installed. */
90 EventHandlerRef m_darwinEventHandlerRef;
91 /** The current modifier key mask. Used to figure out which modifier
92 * key was pressed when we get a kEventRawKeyModifiersChanged event. */
93 UInt32 m_darwinKeyModifiers;
94#endif
95
96 static const char *NoneSymbName;
97};
98
99#endif // __QIHotKeyEdit_h__
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette