libyui
 
Loading...
Searching...
No Matches
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
32class YDialog;
33
39{
40public:
45
49 virtual ~YShortcutManager();
50
57 void checkShortcuts( bool autoResolve = true );
58
63 int conflictCount() { return _conflictCount; }
64
105 void resolveAllConflicts();
106
110 YDialog *dialog() { return _dialog; }
111
112protected:
113
117 void clearShortcutList();
118
124 void findShortcutWidgets( YWidgetListConstIterator begin,
125 YWidgetListConstIterator end );
126
131 void resolveConflict( YShortcut * shortcut );
132
138 int pickConflictToResolve( const YShortcutList & conflictList );
139
144 int findShortestMenuItem( const YShortcutList & conflictList );
145
150 int findShortestWizardButton( const YShortcutList & conflictList );
151
158 unsigned findShortestWidget( const YShortcutList & conflictList );
159
164
168 YShortcutList _shortcutList;
169
173 int _wanted[ sizeof( char ) << 8 ];
174
175
179 bool _used[ sizeof( char ) << 8 ];
180
181
186
187
188private:
189
190 bool _didCheck;
191};
192
193
194#endif // YShortcutManager_h
Definition YDialog.h:48
YShortcutList _shortcutList
Definition YShortcutManager.h:168
int pickConflictToResolve(const YShortcutList &conflictList)
Definition YShortcutManager.cc:298
YDialog * _dialog
Definition YShortcutManager.h:163
int _conflictCount
Definition YShortcutManager.h:185
bool _used[sizeof(char)<< 8]
Definition YShortcutManager.h:179
int _wanted[sizeof(char)<< 8]
Definition YShortcutManager.h:173
YShortcutManager(YDialog *dialog)
Definition YShortcutManager.cc:48
void checkShortcuts(bool autoResolve=true)
Definition YShortcutManager.cc:64
virtual ~YShortcutManager()
Definition YShortcutManager.cc:57
void clearShortcutList()
Definition YShortcutManager.cc:401
YDialog * dialog()
Definition YShortcutManager.h:110
void resolveConflict(YShortcut *shortcut)
Definition YShortcutManager.cc:221
unsigned findShortestWidget(const YShortcutList &conflictList)
Definition YShortcutManager.cc:367
int findShortestWizardButton(const YShortcutList &conflictList)
Definition YShortcutManager.cc:343
void resolveAllConflicts()
Definition YShortcutManager.cc:164
int findShortestMenuItem(const YShortcutList &conflictList)
Definition YShortcutManager.cc:319
int conflictCount()
Definition YShortcutManager.h:63
void findShortcutWidgets(YWidgetListConstIterator begin, YWidgetListConstIterator end)
Definition YShortcutManager.cc:431
Definition YShortcut.h:46