fat: Greatly simplify and clean up dosfs_get_file_map().
[haiku.git] / src / preferences / keymap / KeymapWindow.h
blob366ba0756f57ed484fa249a679e0e5a32fc8b1c9
1 /*
2 * Copyright 2004-2014 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Alexandre Deckner, alex@zappotek.com
7 * Axel Dörfler, axeld@pinc-software.de
8 * Jérôme Duval
9 * John Scipione, jscipione@gmai.com
10 * Sandor Vroemisse
12 #ifndef KEYMAP_WINDOW_H
13 #define KEYMAP_WINDOW_H
16 #include <FilePanel.h>
17 #include <ListView.h>
18 #include <String.h>
19 #include <Window.h>
21 #include "Keymap.h"
24 class BMenu;
25 class BMenuBar;
26 class BMenuField;
27 class BTextControl;
28 class KeyboardLayoutView;
29 class KeymapListItem;
32 class KeymapWindow : public BWindow {
33 public:
34 KeymapWindow();
35 virtual ~KeymapWindow();
37 virtual bool QuitRequested();
38 virtual void MessageReceived(BMessage* message);
40 protected:
41 BMenuBar* _CreateMenu();
42 BView* _CreateMapLists();
43 void _AddKeyboardLayouts(BMenu* menu);
44 void _AddKeyboardLayoutMenu(BMenu* menu,
45 BDirectory directory);
46 status_t _SetKeyboardLayout(const char* path);
47 void _MarkKeyboardLayoutItem(const char* path,
48 BMenu* menu);
50 void _UpdateSwitchShortcutButton();
51 void _UpdateButtons();
52 void _SwitchShortcutKeys();
54 void _UseKeymap();
55 void _DefaultKeymap();
56 void _RevertKeymap();
58 BMenuField* _CreateDeadKeyMenuField();
59 void _UpdateDeadKeyMenu();
61 void _FillSystemMaps();
62 void _FillUserMaps();
63 void _SetListViewSize(BListView* listView);
65 status_t _GetCurrentKeymap(entry_ref& ref);
66 BString _GetActiveKeymapName();
67 bool _SelectCurrentMap(BListView* list);
68 void _SelectCurrentMap();
70 status_t _GetSettings(BFile& file, int mode) const;
71 status_t _LoadSettings(BRect& frame,
72 BString& keyboardLayout);
73 status_t _SaveSettings();
74 BPath _GetMarkedKeyboardLayoutPath(BMenu* menu);
76 private:
77 BListView* fSystemListView;
78 BListView* fUserListView;
79 BButton* fDefaultsButton;
80 BButton* fRevertButton;
81 BMenu* fLayoutMenu;
82 BMenu* fFontMenu;
83 KeyboardLayoutView* fKeyboardLayoutView;
84 BTextControl* fTextControl;
85 BButton* fSwitchShortcutsButton;
86 BMenu* fAcuteMenu;
87 BMenu* fCircumflexMenu;
88 BMenu* fDiaeresisMenu;
89 BMenu* fGraveMenu;
90 BMenu* fTildeMenu;
92 Keymap fCurrentMap;
93 Keymap fPreviousMap;
94 Keymap fAppliedMap;
95 BString fCurrentMapName;
97 BFilePanel* fOpenPanel;
98 BFilePanel* fSavePanel;
101 #endif // KEYMAP_WINDOW_H