libyui
YShortcutManager.h
1 /*
2  Copyright (C) 2000-2012 Novell, Inc
3  This library is free software; you can redistribute it and/or modify
4  it under the terms of the GNU Lesser General Public License as
5  published by the Free Software Foundation; either version 2.1 of the
6  License, or (at your option) version 3.0 of the License. This library
7  is distributed in the hope that it will be useful, but WITHOUT ANY
8  WARRANTY; without even the implied warranty of MERCHANTABILITY or
9  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10  License for more details. You should have received a copy of the GNU
11  Lesser General Public License along with this library; if not, write
12  to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13  Floor, Boston, MA 02110-1301 USA
14 */
15 
16 
17 /*-/
18 
19  File: YShortcutManager.h
20 
21  Author: Stefan Hundhammer <shundhammer@suse.de>
22 
23 /-*/
24 
25 
26 #ifndef YShortcutManager_h
27 #define YShortcutManager_h
28 
29 #include "YWidget.h"
30 #include "YShortcut.h"
31 
32 class YDialog;
33 
39 {
40 public:
45 
49  virtual ~YShortcutManager();
50 
57  void checkShortcuts( bool autoResolve = true );
58 
63  int conflictCount() { return _conflictCount; }
64 
99  void resolveAllConflicts();
100 
104  YDialog *dialog() { return _dialog; }
105 
106 protected:
107 
111  void clearShortcutList();
112 
118  void findShortcutWidgets( YWidgetListConstIterator begin,
119  YWidgetListConstIterator end );
120 
125  void resolveConflict( YShortcut * shortcut );
126 
132  int pickConflictToResolve( const YShortcutList & conflictList );
133 
138  int findShortestMenuItem( const YShortcutList & conflictList );
139 
144  int findShortestWizardButton( const YShortcutList & conflictList );
145 
152  unsigned findShortestWidget( const YShortcutList & conflictList );
153 
158 
162  YShortcutList _shortcutList;
163 
167  int _wanted[ sizeof( char ) << 8 ];
168 
169 
173  bool _used[ sizeof( char ) << 8 ];
174 
175 
180 
181 
182 private:
183 
184  bool _didCheck;
185 };
186 
187 
188 #endif // YShortcutManager_h
bool _used[sizeof(char)<< 8]
Definition: YShortcutManager.h:173
int _conflictCount
Definition: YShortcutManager.h:179
virtual ~YShortcutManager()
Definition: YShortcutManager.cc:57
void clearShortcutList()
Definition: YShortcutManager.cc:401
Definition: YShortcutManager.h:38
YDialog * dialog()
Definition: YShortcutManager.h:104
void resolveAllConflicts()
Definition: YShortcutManager.cc:164
Definition: YShortcut.h:45
int pickConflictToResolve(const YShortcutList &conflictList)
Definition: YShortcutManager.cc:298
YShortcutList _shortcutList
Definition: YShortcutManager.h:162
int findShortestWizardButton(const YShortcutList &conflictList)
Definition: YShortcutManager.cc:343
int conflictCount()
Definition: YShortcutManager.h:63
void checkShortcuts(bool autoResolve=true)
Definition: YShortcutManager.cc:64
int findShortestMenuItem(const YShortcutList &conflictList)
Definition: YShortcutManager.cc:319
unsigned findShortestWidget(const YShortcutList &conflictList)
Definition: YShortcutManager.cc:367
int _wanted[sizeof(char)<< 8]
Definition: YShortcutManager.h:167
YDialog * _dialog
Definition: YShortcutManager.h:157
Definition: YDialog.h:47
void findShortcutWidgets(YWidgetListConstIterator begin, YWidgetListConstIterator end)
Definition: YShortcutManager.cc:431
YShortcutManager(YDialog *dialog)
Definition: YShortcutManager.cc:48
void resolveConflict(YShortcut *shortcut)
Definition: YShortcutManager.cc:221