|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0"" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: peninput handwriting recognition class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_PENINPUTHWRBOXRECOGNIZER_H |
|
20 #define C_PENINPUTHWRBOXRECOGNIZER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <eikon.hrh> // TAknEditorNumericKeymap |
|
24 |
|
25 class CPtiEngine; |
|
26 |
|
27 /** |
|
28 * CPeninputHwrBoxRecognizer |
|
29 * |
|
30 * @lib peninputhwrboxjp.lib |
|
31 * @since S60 v3.2 |
|
32 */ |
|
33 class CPeninputHwrBoxRecognizer: public CBase |
|
34 { |
|
35 |
|
36 public: |
|
37 |
|
38 /** |
|
39 * Symbian constructor. |
|
40 * |
|
41 * @since S60 v3.2 |
|
42 * @return Pointer to created CPeninputHwrBoxRecognizer object |
|
43 */ |
|
44 static CPeninputHwrBoxRecognizer* NewL(CPtiEngine* aPtiEngine); |
|
45 |
|
46 /** |
|
47 * destructor |
|
48 * |
|
49 * @since S60 v3.2 |
|
50 * @return None |
|
51 */ |
|
52 virtual ~CPeninputHwrBoxRecognizer(); |
|
53 |
|
54 /** |
|
55 * Do recoginize by engine |
|
56 * |
|
57 * @since S60 v3.2 |
|
58 * @param aTraceData The trace data. |
|
59 * @param aCandidates The candidates recognized. |
|
60 * @param aRangeStartPos The range index of candidates. |
|
61 * @return None |
|
62 */ |
|
63 void DoRecognize(const RArray<TPoint>& aTraceData, RPointerArray<HBufC>& aCandidates, RArray<TInt>& aRangeStartPos); |
|
64 |
|
65 /** |
|
66 * Notify hwr engine to set primary range and auxiliary ranges |
|
67 * |
|
68 * @since S60 v3.2 |
|
69 * @param aPermittedRanges The permitted ranges and the first range is primary range. |
|
70 * @return None |
|
71 */ |
|
72 void SetRanges(const RArray<TInt>& aPermittedRanges); |
|
73 |
|
74 /** |
|
75 * Set case |
|
76 * |
|
77 * @since S60 v3.2 |
|
78 * @param aCase The case |
|
79 * @return None |
|
80 */ |
|
81 void SetCase(TInt aCase); |
|
82 |
|
83 /** |
|
84 * Set number mode |
|
85 * |
|
86 * @since S60 v3.2 |
|
87 * @param aNumberMode Given number mode |
|
88 * @return None |
|
89 */ |
|
90 void SetNumberMode(const TAknEditorNumericKeymap& aNumberMode); |
|
91 |
|
92 /** |
|
93 * Get stroke end mark from hwr engine |
|
94 * |
|
95 * @since S60 v3.2 |
|
96 * @return Stroke end mark |
|
97 */ |
|
98 TPoint StrokeEndMark() const ; |
|
99 |
|
100 /** |
|
101 * Set primary candidate num that hwr engine should return each time |
|
102 * |
|
103 * @since S60 v3.2 |
|
104 * @param aNum The primary candidate num to be set |
|
105 * @return KErrNone if operation successfully,otherwise system wide error codes |
|
106 */ |
|
107 TInt SetPrimaryCandidateNum(TInt aNum); |
|
108 |
|
109 /** |
|
110 * Set total candidate number that can be shown |
|
111 * |
|
112 * @since S60 v3.2 |
|
113 * @param aNum The total candidate number that should be shown |
|
114 * @return KErrNone if operation successfully,otherwise system wide error codes |
|
115 */ |
|
116 TInt SetCandidateNum(TInt aNum); |
|
117 |
|
118 /** |
|
119 * Set language |
|
120 * |
|
121 * @since S60 v3.2 |
|
122 * @param aLanguage The language |
|
123 * @return None |
|
124 */ |
|
125 void SetLanguageL(TInt aLanguage); |
|
126 |
|
127 /** |
|
128 * Set writing area size |
|
129 * |
|
130 * @since S60 v3.2 |
|
131 * @param aSize Size of input area |
|
132 * @return None |
|
133 */ |
|
134 void SetInputAreaSize( TSize aSize ); |
|
135 |
|
136 private: |
|
137 |
|
138 /** |
|
139 * C++ constructor |
|
140 * |
|
141 * @since S60 v3.2 |
|
142 * @return None |
|
143 */ |
|
144 CPeninputHwrBoxRecognizer(); |
|
145 |
|
146 /** |
|
147 * Second phase constructor |
|
148 * |
|
149 * @since S60 v3.2 |
|
150 * @return None |
|
151 */ |
|
152 void ConstructL(CPtiEngine* aPtiEngine); |
|
153 |
|
154 /** |
|
155 * Notify hwr engine to set correct range by language |
|
156 * |
|
157 * @since S60 v3.2 |
|
158 * @param aRange Current range need to be set |
|
159 * @param aRecognitionRange Recognition range need to be set for hwr engine |
|
160 * @return None |
|
161 */ |
|
162 void SetRecognitionRange(const TInt aRange, TRecognitionRange& aRecognitionRange) const; |
|
163 |
|
164 private: //data |
|
165 |
|
166 /** |
|
167 * Engine |
|
168 * Not Own |
|
169 */ |
|
170 CPtiEngine* iPtiEngine; |
|
171 |
|
172 /** |
|
173 * Hwr recognizer (Not own) |
|
174 */ |
|
175 MPtiHwrRecognizer* iRecognizer; |
|
176 |
|
177 /** |
|
178 * Total candidate number that can be shown |
|
179 */ |
|
180 TInt iTotalCandidateNum; |
|
181 |
|
182 /** |
|
183 * Current case |
|
184 */ |
|
185 TInt iCase; |
|
186 |
|
187 /** |
|
188 * Current language |
|
189 */ |
|
190 TInt iLanguage; |
|
191 |
|
192 /** |
|
193 * Range count |
|
194 */ |
|
195 TInt iRangeCount; |
|
196 |
|
197 /** |
|
198 * Premary range |
|
199 */ |
|
200 TInt iPremaryRange; |
|
201 }; |
|
202 |
|
203 #endif // C_PENINPUTHWRBOXRECOGNIZER_H |
|
204 |
|
205 //End Of File |