21 #ifndef __TDEACCELMANAGER_PRIVATE_H__ 22 #define __TDEACCELMANAGER_PRIVATE_H__ 26 #include <tqmemarray.h> 27 #include <tqvaluelist.h> 49 void calculateWeights(
int initialWeight);
51 const TQString &pure()
const {
return m_pureText; }
52 TQString accelerated()
const;
54 int accel()
const {
return m_accel; }
55 void setAccel(
int accel) { m_accel = accel; }
57 int originalAccel()
const {
return m_orig_accel; }
58 TQString originalText()
const {
return m_origText; }
60 TQChar accelerator()
const;
62 int maxWeight(
int &index,
const TQString &used);
64 bool operator == (
const TDEAccelString &c)
const {
return m_pureText == c.m_pureText && m_accel == c.m_accel && m_orig_accel == c.m_orig_accel; }
69 int stripAccelerator(TQString &input);
73 TQString m_pureText, m_origText;
74 int m_accel, m_orig_accel;
75 TQMemArray<int> m_weight;
80 typedef TQValueList<TDEAccelString> TDEAccelStringList;
99 FIRST_CHARACTER_EXTRA_WEIGHT = 50,
101 WORD_BEGINNING_EXTRA_WEIGHT = 50,
103 DIALOG_BUTTON_EXTRA_WEIGHT = 300,
105 WANTED_ACCEL_EXTRA_WEIGHT = 150,
107 ACTION_ELEMENT_WEIGHT = 50,
109 GROUP_BOX_WEIGHT = -2000,
111 MENU_TITLE_WEIGHT = 250,
117 static void findAccelerators(TDEAccelStringList &result, TQString &used);
140 static void manage(TQPopupMenu *popup);
155 void calculateAccelerators();
157 void findMenuEntries(TDEAccelStringList &list);
158 void setMenuEntries(
const TDEAccelStringList &list);
160 TQPopupMenu *m_popup;
161 TDEAccelStringList m_entries;
167 class QWidgetStackAccelManager :
public TQObject
173 static void manage(TQWidgetStack *popup);
178 QWidgetStackAccelManager(TQWidgetStack *popup);
183 void aboutToShow(TQWidget *);
184 bool eventFilter ( TQObject * watched, TQEvent * e );
188 void calculateAccelerators();
190 TQWidgetStack *m_stack;
191 TDEAccelStringList m_entries;
A string class handling accelerators.
This class encapsulates the algorithm finding the 'best' distribution of accelerators in a hierarchy ...