37
37
#include "models/wordcandidate.h"
38
38
#include "models/text.h"
40
#include "logic/layouthelper.h"
40
//#include "logic/layouthelper.h"
41
41
#include "logic/layoutupdater.h"
42
42
#include "logic/eventhandler.h"
47
47
void connectAll(Logic::EventHandler *event_handler,
48
Logic::LayoutUpdater *updater,
49
48
AbstractTextEditor *editor)
51
50
connectEventHandlerToTextEditor(event_handler, editor);
52
connectLayoutUpdaterToTextEditor(updater, editor);
55
53
void connectEventHandlerToTextEditor(Logic::EventHandler *event_handler,
61
59
QObject::connect(event_handler, SIGNAL(keyReleased(Key)),
62
60
editor, SLOT(onKeyReleased(Key)));
64
QObject::connect(event_handler, SIGNAL(keyEntered(Key)),
65
editor, SLOT(onKeyEntered(Key)));
67
QObject::connect(event_handler, SIGNAL(keyExited(Key)),
68
editor, SLOT(onKeyExited(Key)));
71
void connectLayoutUpdaterToTextEditor(Logic::LayoutUpdater *updater,
72
AbstractTextEditor *editor)
74
QObject::connect(updater, SIGNAL(wordCandidateSelected(QString)),
75
editor, SLOT(replaceAndCommitPreedit(QString)));
77
QObject::connect(updater, SIGNAL(addToUserDictionary()),
78
editor, SLOT(showUserCandidate()));
80
QObject::connect(updater, SIGNAL(userCandidateSelected(QString)),
81
editor, SLOT(addToUserDictionary(QString)));
83
QObject::connect(editor, SIGNAL(preeditEnabledChanged(bool)),
84
updater, SLOT(setWordRibbonVisible(bool)));
86
QObject::connect(editor, SIGNAL(wordCandidatesChanged(WordCandidateList)),
87
updater, SLOT(onWordCandidatesChanged(WordCandidateList)));
89
QObject::connect(editor, SIGNAL(autoCapsActivated()),
90
updater, SIGNAL(autoCapsActivated()));
93
62
}} // namespace Setup, MaliitKeyboard