aboutsummaryrefslogtreecommitdiff
path: root/gui/predictivedialog.h
diff options
context:
space:
mode:
Diffstat (limited to 'gui/predictivedialog.h')
-rw-r--r--gui/predictivedialog.h85
1 files changed, 47 insertions, 38 deletions
diff --git a/gui/predictivedialog.h b/gui/predictivedialog.h
index 32d769d6ca..37c80a2a14 100644
--- a/gui/predictivedialog.h
+++ b/gui/predictivedialog.h
@@ -33,56 +33,65 @@ class EditTextWidget;
class ButtonWidget;
class PicButtonWidget;
-enum ButtonId {
- kBtn1Act = 0,
- kBtn2Act = 1,
- kBtn3Act = 2,
- kBtn4Act = 3,
- kBtn5Act = 4,
- kBtn6Act = 5,
- kBtn7Act = 6,
- kBtn8Act = 7,
- kBtn9Act = 8,
- kNextAct = 9,
- kAddAct = 10,
- kDelAct = 11,
- kCancelAct = 12,
- kOkAct = 13,
- kModeAct = 14,
- kBtn0Act = 15,
- kNoAct = -1
-};
-
-enum {
- kRepeatDelay = 500
-};
-
-enum {
- kMaxLineLen = 80,
- kMaxWordLen = 24,
- kMaxWord = 50
-};
-
class PredictiveDialog : public GUI::Dialog {
public:
PredictiveDialog();
~PredictiveDialog();
+ virtual void reflowLayout();
+
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
virtual void handleKeyUp(Common::KeyState state);
virtual void handleKeyDown(Common::KeyState state);
virtual void handleTickle();
const char *getResult() const { return _predictiveResult; }
+
private:
+ enum ButtonId {
+ kButton1Act = 0,
+ kButton2Act = 1,
+ kButton3Act = 2,
+ kButton4Act = 3,
+ kButton5Act = 4,
+ kButton6Act = 5,
+ kButton7Act = 6,
+ kButton8Act = 7,
+ kButton9Act = 8,
+ kNextAct = 9,
+ kAddAct = 10,
+ kDelAct = 11,
+ kCancelAct = 12,
+ kOkAct = 13,
+ kModeAct = 14,
+ kButton0Act = 15,
+ kNoAct = -1
+ };
+
+ enum {
+ kButtonCount = kButton0Act + 1
+ };
+
+ enum {
+ kRepeatDelay = 500
+ };
+
+ enum {
+ kMaxLineLen = 80,
+ kMaxWordLen = 24,
+ kMaxWord = 50
+ };
+
struct Dict {
+ Dict() : dictLine(nullptr), dictText(nullptr), dictActLine(nullptr),
+ dictLineCount(0), dictTextSize(0) {}
char **dictLine;
char *dictText;
char *dictActLine; // using only for united dict...
int32 dictLineCount;
int32 dictTextSize;
Common::String nameDict;
- Common::String fnameDict;
+ Common::String defaultFilename;
};
uint8 countWordsInString(const char *const str);
@@ -94,7 +103,7 @@ private:
bool searchWord(const char *const where, const Common::String &whatCode);
int binarySearch(const char *const *const dictLine, const Common::String &code, const int dictLineCount);
bool matchWord();
- void processBtnActive(ButtonId active);
+ void processButton(ButtonId active);
void pressEditText();
void saveUserDictToFile();
@@ -108,7 +117,7 @@ private:
Dict _userDict;
int _mode;
- ButtonId _lastbutton;
+ ButtonId _lastButton;
bool _userDictHasChanged;
@@ -121,8 +130,8 @@ private:
Common::String _prefix;
uint32 _curTime, _lastTime;
- ButtonId _lastPressBtn;
- ButtonId _currBtn;
+ ButtonId _lastPressedButton;
+ ButtonId _curPressedButton;
char _temp[kMaxWordLen + 1];
int _repeatcount[kMaxWordLen];
@@ -132,11 +141,11 @@ private:
Common::String _search;
- bool _navigationwithkeys;
+ bool _navigationWithKeys;
bool _needRefresh;
private:
- EditTextWidget *_edittext;
- ButtonWidget **_btns;
+ EditTextWidget *_editText;
+ ButtonWidget *_button[kButtonCount];
};
} // namespace GUI