Fix FreeBSD build.
[haiku.git] / src / preferences / keymap / ModifierKeysWindow.h
blobaa7766343546b799585bce654546a503642c7d13
1 /*
2 * Copyright 2011-2014 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * John Scipione, jscipione@gmail.com
7 */
8 #ifndef MODIFIER_KEYS_WINDOW_H
9 #define MODIFIER_KEYS_WINDOW_H
12 #include <View.h>
13 #include <Window.h>
16 class BMenuField;
17 class BPopUpMenu;
20 class ConflictView : public BView {
21 public:
22 ConflictView(const char* name);
23 ~ConflictView();
25 virtual void Draw(BRect updateRect);
27 BBitmap* Icon();
28 void SetStopIcon(bool show);
29 void SetWarnIcon(bool show);
31 private:
32 void _FillIcons();
34 BBitmap* fIcon;
35 BBitmap* fStopIcon;
36 BBitmap* fWarnIcon;
40 class ModifierKeysWindow : public BWindow {
41 public:
42 ModifierKeysWindow();
43 virtual ~ModifierKeysWindow();
45 virtual void MessageReceived(BMessage* message);
47 private:
48 BMenuField* _CreateShiftMenuField();
49 BMenuField* _CreateControlMenuField();
50 BMenuField* _CreateOptionMenuField();
51 BMenuField* _CreateCommandMenuField();
53 void _MarkMenuItems();
54 const char* _KeyToString(int32 key);
55 uint32 _KeyToKeyCode(int32 key,
56 bool right = false);
57 int32 _LastKey();
58 void _ValidateDuplicateKeys();
59 uint32 _DuplicateKeys();
60 void _HideShowIcons();
62 BPopUpMenu* fShiftMenu;
63 BPopUpMenu* fControlMenu;
64 BPopUpMenu* fOptionMenu;
65 BPopUpMenu* fCommandMenu;
67 ConflictView* fShiftConflictView;
68 ConflictView* fControlConflictView;
69 ConflictView* fOptionConflictView;
70 ConflictView* fCommandConflictView;
72 BButton* fRevertButton;
73 BButton* fCancelButton;
74 BButton* fOkButton;
76 key_map* fCurrentMap;
77 key_map* fSavedMap;
79 char* fCurrentBuffer;
80 char* fSavedBuffer;
84 #endif // MODIFIER_KEYS_WINDOW_H