source: trunk/src/gui/inputmethod/qcoefepinputcontext_p.h@ 668

Last change on this file since 668 was 651, checked in by Dmitry A. Kuminov, 15 years ago

trunk: Merged in qt 4.6.2 sources.

  • Property svn:eol-style set to native
File size: 5.9 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4** All rights reserved.
5** Contact: Nokia Corporation ([email protected])
6**
7** This file is part of the QtGui module of the Qt Toolkit.
8**
9** $QT_BEGIN_LICENSE:LGPL$
10** Commercial Usage
11** Licensees holding valid Qt Commercial licenses may use this file in
12** accordance with the Qt Commercial License Agreement provided with the
13** Software or, alternatively, in accordance with the terms contained in
14** a written agreement between you and Nokia.
15**
16** GNU Lesser General Public License Usage
17** Alternatively, this file may be used under the terms of the GNU Lesser
18** General Public License version 2.1 as published by the Free Software
19** Foundation and appearing in the file LICENSE.LGPL included in the
20** packaging of this file. Please review the following information to
21** ensure the GNU Lesser General Public License version 2.1 requirements
22** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
23**
24** In addition, as a special exception, Nokia gives you certain additional
25** rights. These rights are described in the Nokia Qt LGPL Exception
26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
27**
28** GNU General Public License Usage
29** Alternatively, this file may be used under the terms of the GNU
30** General Public License version 3.0 as published by the Free Software
31** Foundation and appearing in the file LICENSE.GPL included in the
32** packaging of this file. Please review the following information to
33** ensure the GNU General Public License version 3.0 requirements will be
34** met: http://www.gnu.org/copyleft/gpl.html.
35**
36** If you have questions regarding the use of this file, please contact
37** Nokia at [email protected].
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42#ifndef QCOEFEPINPUTCONTEXT_P_H
43#define QCOEFEPINPUTCONTEXT_P_H
44
45//
46// W A R N I N G
47// -------------
48//
49// This file is not part of the Qt API. It exists purely as an
50// implementation detail. This header file may change from version to
51// version without notice, or even be removed.
52//
53// We mean it.
54//
55
56#ifndef QT_NO_IM
57
58#include "qinputcontext.h"
59#include <qhash.h>
60#include <qtimer.h>
61#include <private/qcore_symbian_p.h>
62#include <private/qt_s60_p.h>
63
64#include <fepbase.h>
65#include <aknedsts.h>
66
67QT_BEGIN_NAMESPACE
68
69class QCoeFepInputContext : public QInputContext,
70 public MCoeFepAwareTextEditor,
71 public MCoeFepAwareTextEditor_Extension1,
72 public MObjectProvider
73{
74 Q_OBJECT
75
76public:
77 QCoeFepInputContext(QObject *parent = 0);
78 ~QCoeFepInputContext();
79
80 QString identifierName() { return QLatin1String("coefep"); }
81 QString language();
82
83 void reset();
84 void update();
85
86 bool filterEvent(const QEvent *event);
87 void mouseHandler( int x, QMouseEvent *event);
88 bool isComposing() const { return !m_preeditString.isEmpty(); }
89
90 void setFocusWidget(QWidget * w);
91 void widgetDestroyed(QWidget *w);
92
93 TCoeInputCapabilities inputCapabilities();
94
95protected:
96 void timerEvent(QTimerEvent *timerEvent);
97
98private:
99 void commitCurrentString(bool triggeredBySymbian);
100 void updateHints(bool mustUpdateInputCapabilities);
101 void applyHints(Qt::InputMethodHints hints);
102 void applyFormat(QList<QInputMethodEvent::Attribute> *attributes);
103 void queueInputCapabilitiesChanged();
104 bool needsInputPanel();
105 void commitTemporaryPreeditString();
106
107private Q_SLOTS:
108 void ensureInputCapabilitiesChanged();
109
110 // From MCoeFepAwareTextEditor
111public:
112 void StartFepInlineEditL(const TDesC& aInitialInlineText, TInt aPositionOfInsertionPointInInlineText,
113 TBool aCursorVisibility, const MFormCustomDraw* aCustomDraw,
114 MFepInlineTextFormatRetriever& aInlineTextFormatRetriever,
115 MFepPointerEventHandlerDuringInlineEdit& aPointerEventHandlerDuringInlineEdit);
116 void UpdateFepInlineTextL(const TDesC& aNewInlineText, TInt aPositionOfInsertionPointInInlineText);
117 void SetInlineEditingCursorVisibilityL(TBool aCursorVisibility);
118 void CancelFepInlineEdit();
119 TInt DocumentLengthForFep() const;
120 TInt DocumentMaximumLengthForFep() const;
121 void SetCursorSelectionForFepL(const TCursorSelection& aCursorSelection);
122 void GetCursorSelectionForFep(TCursorSelection& aCursorSelection) const;
123 void GetEditorContentForFep(TDes& aEditorContent, TInt aDocumentPosition, TInt aLengthToRetrieve) const;
124 void GetFormatForFep(TCharFormat& aFormat, TInt aDocumentPosition) const;
125 void GetScreenCoordinatesForFepL(TPoint& aLeftSideOfBaseLine, TInt& aHeight, TInt& aAscent,
126 TInt aDocumentPosition) const;
127private:
128 void DoCommitFepInlineEditL();
129 MCoeFepAwareTextEditor_Extension1* Extension1(TBool& aSetToTrue);
130 void ReportAknEdStateEvent(MAknEdStateObserver::EAknEdwinStateEvent aEventType);
131
132 // From MCoeFepAwareTextEditor_Extension1
133public:
134 void SetStateTransferingOwnershipL(MCoeFepAwareTextEditor_Extension1::CState* aState, TUid aTypeSafetyUid);
135 MCoeFepAwareTextEditor_Extension1::CState* State(TUid aTypeSafetyUid);
136
137 // From MObjectProvider
138public:
139 TTypeUid::Ptr MopSupplyObject(TTypeUid id);
140 MObjectProvider *MopNext();
141
142private:
143 QSymbianControl *m_parent;
144 CAknEdwinState *m_fepState;
145 QString m_preeditString;
146 Qt::InputMethodHints m_lastImHints;
147 TUint m_textCapabilities;
148 bool m_inDestruction;
149 bool m_pendingInputCapabilitiesChanged;
150 int m_cursorVisibility;
151 int m_inlinePosition;
152 MFepInlineTextFormatRetriever *m_formatRetriever;
153 MFepPointerEventHandlerDuringInlineEdit *m_pointerHandler;
154 int m_longPress;
155 int m_cursorPos;
156 QBasicTimer m_tempPreeditStringTimeout;
157 bool m_hasTempPreeditString;
158};
159
160QT_END_NAMESPACE
161
162#endif // QT_NO_IM
163
164#endif // QCOEFEPINPUTCONTEXT_P_H
Note: See TracBrowser for help on using the repository browser.