diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2011-09-20 11:36:24 (GMT) |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2011-09-21 07:38:08 (GMT) |
commit | 7cd29ef169b94b0182b4207b37715f7427e4e4d6 (patch) | |
tree | 92ed7ab7f8293fbd084bffdbd82e46c6098ade64 /src/gui/inputmethod/qcoefepinputcontext_p.h | |
parent | 94a18b734a67ee59bc3ac48012c48d06d1362e8b (diff) | |
download | Qt-7cd29ef169b94b0182b4207b37715f7427e4e4d6.zip Qt-7cd29ef169b94b0182b4207b37715f7427e4e4d6.tar.gz Qt-7cd29ef169b94b0182b4207b37715f7427e4e4d6.tar.bz2 |
Symbian: Added copy-paste functionality to FEP input context
The support for copy-paste functionality in FEP was initially submitted
as merge request #1151, though that only provided support for
basic Qt edit widgets. I modified the code so that QML edit elements
are also supported, as well as any other editor that provides the
required "copy", "cut", and "paste" slots, and "canPaste" property.
A number of other minor fixes were also done to the original merge
request, as well as the removal of S60 version plugin elements.
Task-number: QTBUG-20921
Reviewed-by: Sami Merila
Diffstat (limited to 'src/gui/inputmethod/qcoefepinputcontext_p.h')
-rw-r--r-- | src/gui/inputmethod/qcoefepinputcontext_p.h | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h index 8c30838..8ef9726 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_p.h +++ b/src/gui/inputmethod/qcoefepinputcontext_p.h @@ -63,13 +63,36 @@ #include <fepbase.h> #include <aknedsts.h> +#include <eikccpu.h> QT_BEGIN_NAMESPACE +class QCoeFepInputMaskHandler +{ +public: + QCoeFepInputMaskHandler(const QString &mask); + ~QCoeFepInputMaskHandler(); + bool canPasteClipboard(const QString &text); +private: + bool isValidInput(QChar key, QChar mask) const; +private: + struct MaskInputData { + enum Casemode { NoCaseMode, Upper, Lower }; + QChar maskChar; + bool separator; + Casemode caseMode; + }; + int m_maxLength; + QChar m_blank; + MaskInputData *m_maskData; +}; + class Q_AUTOTEST_EXPORT QCoeFepInputContext : public QInputContext, public MCoeFepAwareTextEditor, public MCoeFepAwareTextEditor_Extension1, - public MObjectProvider + public MObjectProvider, + public MEikCcpuEditor + { Q_OBJECT @@ -135,6 +158,25 @@ private: void DoCommitFepInlineEditL(); MCoeFepAwareTextEditor_Extension1* Extension1(TBool& aSetToTrue); void ReportAknEdStateEvent(MAknEdStateObserver::EAknEdwinStateEvent aEventType); + void enableSymbianCcpuSupport(); + void changeCBA(bool showCopyAndOrPaste); + void copyOrCutTextToClipboard(const char *operation); + + //From MEikCcpuEditor interface +public: + TBool CcpuIsFocused() const; + TBool CcpuCanCut() const; + void CcpuCutL(); + TBool CcpuCanCopy() const; + void CcpuCopyL(); + TBool CcpuCanPaste() const; + void CcpuPasteL(); + TBool CcpuCanUndo() const; + void CcpuUndoL(); + +private slots: + void copy(); + void paste(); // From MCoeFepAwareTextEditor_Extension1 public: @@ -167,6 +209,12 @@ private: Qt::WindowStates m_splitViewPreviousWindowStates; QRectF m_transformation; + CAknCcpuSupport *m_ccpu; + QAction *m_copyAction; + QAction *m_pasteAction; + QPointer<QWidget> m_lastFocusedEditor; + QPointer<QObject> m_lastFocusedObject; + friend class tst_QInputContext; }; |