00001 /*---------------------------------------------------------------------\ 00002 | | 00003 | __ __ ____ _____ ____ | 00004 | \ \ / /_ _/ ___|_ _|___ \ | 00005 | \ V / _` \___ \ | | __) | | 00006 | | | (_| |___) || | / __/ | 00007 | |_|\__,_|____/ |_| |_____| | 00008 | | 00009 | core system | 00010 | (C) SuSE GmbH | 00011 \----------------------------------------------------------------------/ 00012 00013 File: YShortcutManager.h 00014 00015 Author: Stefan Hundhammer <sh@suse.de> 00016 00017 /-*/ 00018 00019 00020 #ifndef YShortcutManager_h 00021 #define YShortcutManager_h 00022 00023 #include "YDialog.h" 00024 #include "YShortcut.h" 00025 00026 00031 class YShortcutManager 00032 { 00033 public: 00037 YShortcutManager( YDialog *dialog ); 00038 00042 virtual ~YShortcutManager(); 00043 00044 00051 void checkShortcuts( bool autoResolve = true ); 00052 00053 00058 int conflictCount(); 00059 00060 00095 void resolveAllConflicts(); 00096 00097 00101 YDialog *dialog() { return _dialog; } 00102 00103 00104 protected: 00105 00109 void clearShortcutList(); 00110 00116 void findShortcutWidgets(); 00117 00122 void resolveConflict( YShortcut * shortcut ); 00123 00127 YDialog *_dialog; 00128 00132 YShortcutList _shortcutList; 00133 00137 int _wanted[ sizeof( char ) << 8 ]; 00138 00139 00143 bool _used[ sizeof( char ) << 8 ]; 00144 00145 00149 int _conflictCount; 00150 00151 00152 private: 00153 00154 bool _did_check; 00155 }; 00156 00157 00158 #endif // YShortcutManager_h