equal
deleted
inserted
replaced
23 */ |
23 */ |
24 |
24 |
25 #ifndef HEDGEWARS_SMARTLINEEDIT_H |
25 #ifndef HEDGEWARS_SMARTLINEEDIT_H |
26 #define HEDGEWARS_SMARTLINEEDIT_H |
26 #define HEDGEWARS_SMARTLINEEDIT_H |
27 |
27 |
|
28 #include <QMap> |
|
29 #include <QString> |
28 #include <QStringList> |
30 #include <QStringList> |
29 |
31 |
30 #include <QEvent> |
32 #include <QEvent> |
|
33 #include <QKeyEvent> |
|
34 |
31 #include <QRegExp> |
35 #include <QRegExp> |
32 |
36 |
33 #include "HistoryLineEdit.h" |
37 #include "HistoryLineEdit.h" |
34 |
38 |
35 /** |
39 /** |
55 * @brief Class constructor. |
59 * @brief Class constructor. |
56 * @param parent parent QWidget. |
60 * @param parent parent QWidget. |
57 * @param maxHistorySize maximum amount of history entries kept. |
61 * @param maxHistorySize maximum amount of history entries kept. |
58 */ |
62 */ |
59 SmartLineEdit(QWidget * parent = 0, int maxHistorySize = 64); |
63 SmartLineEdit(QWidget * parent = 0, int maxHistorySize = 64); |
|
64 |
|
65 /** |
|
66 * @brief Class destructor. |
|
67 */ |
|
68 ~SmartLineEdit(); |
60 |
69 |
61 /** |
70 /** |
62 * @brief Adds commands to the auto-completion feature. |
71 * @brief Adds commands to the auto-completion feature. |
63 * @param commands list of commands to be added. |
72 * @param commands list of commands to be added. |
64 */ |
73 */ |
114 private: |
123 private: |
115 QRegExp m_whitespace; ///< regexp that matches a whitespace |
124 QRegExp m_whitespace; ///< regexp that matches a whitespace |
116 |
125 |
117 QStringList * m_cmds; ///< list of recognized commands |
126 QStringList * m_cmds; ///< list of recognized commands |
118 QStringList * m_nicks; ///< list of recognized nicknames |
127 QStringList * m_nicks; ///< list of recognized nicknames |
|
128 /// list of recognized commands, sorted case-insensitive |
|
129 QMap<QString, QString> * m_sorted_nicks; |
119 |
130 |
120 // these variables contain information about the last replacement |
131 // these variables contain information about the last replacement |
121 // they get reset whenever cursor is moved or text is changed |
132 // they get reset whenever cursor is moved or text is changed |
122 |
133 |
123 QString m_beforeMatch; ///< the string that was just matched |
134 QString m_beforeMatch; ///< the string that was just matched |