sl@0
|
1 |
// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#ifndef __SPEECHRECOGNITIONCUSTOMCOMMANDCOMMON_H__
|
sl@0
|
17 |
#define __SPEECHRECOGNITIONCUSTOMCOMMANDCOMMON_H__
|
sl@0
|
18 |
|
sl@0
|
19 |
#include <e32std.h>
|
sl@0
|
20 |
// INCLUDE FILES
|
sl@0
|
21 |
#include <mmf/common/speechrecognitiondataclient.h>
|
sl@0
|
22 |
|
sl@0
|
23 |
// CONSTANTS
|
sl@0
|
24 |
static const TUid KUidInterfaceSpeechRecognition = {0x101F8CA6};
|
sl@0
|
25 |
|
sl@0
|
26 |
// FORWARD DECLARATIONS
|
sl@0
|
27 |
class TSrsRecognize;
|
sl@0
|
28 |
class TSrsAddPronunciation;
|
sl@0
|
29 |
class TSrsAddRule;
|
sl@0
|
30 |
class TSrsRuleValidity;
|
sl@0
|
31 |
class TSrsGetUtteranceDuration;
|
sl@0
|
32 |
class TSrsGetUtteranceDuration;
|
sl@0
|
33 |
class TSrsPlayUtterance;
|
sl@0
|
34 |
|
sl@0
|
35 |
// DATA TYPES
|
sl@0
|
36 |
|
sl@0
|
37 |
/**
|
sl@0
|
38 |
* @internalComponent
|
sl@0
|
39 |
* Custom command message definitions
|
sl@0
|
40 |
*/
|
sl@0
|
41 |
enum TSrCustomCommandMessages
|
sl@0
|
42 |
{
|
sl@0
|
43 |
ESrAddPronunciation,
|
sl@0
|
44 |
ESrAddRule,
|
sl@0
|
45 |
ESrCancel,
|
sl@0
|
46 |
ESrCreateGrammar,
|
sl@0
|
47 |
ESrCreateLexicon,
|
sl@0
|
48 |
ESrCreateModelBank,
|
sl@0
|
49 |
ESrEndRecSession,
|
sl@0
|
50 |
ESrGetAllModelIDs,
|
sl@0
|
51 |
ESrGetAllPronunciationIDs,
|
sl@0
|
52 |
ESrGetAllRuleIDs,
|
sl@0
|
53 |
ESrGetAvailableStorage,
|
sl@0
|
54 |
ESrGetEngineProperties,
|
sl@0
|
55 |
ESrGetModelCount,
|
sl@0
|
56 |
ESrGetPronunciationCount,
|
sl@0
|
57 |
ESrGetRuleCount,
|
sl@0
|
58 |
ESrGetRuleValidity,
|
sl@0
|
59 |
ESrUtteranceDuration,
|
sl@0
|
60 |
ESrLoadGrammar,
|
sl@0
|
61 |
ESrLoadLexicon,
|
sl@0
|
62 |
ESrLoadModels,
|
sl@0
|
63 |
ESrPlayUtterance,
|
sl@0
|
64 |
ESrRecognize,
|
sl@0
|
65 |
ESrRecord,
|
sl@0
|
66 |
ESrRemoveGrammar,
|
sl@0
|
67 |
ESrRemoveLexicon,
|
sl@0
|
68 |
ESrRemoveModelBank,
|
sl@0
|
69 |
ESrRemoveModel,
|
sl@0
|
70 |
ESrRemovePronunciation,
|
sl@0
|
71 |
ESrRemoveRule,
|
sl@0
|
72 |
ESrStartRecSession,
|
sl@0
|
73 |
ESrTrain,
|
sl@0
|
74 |
ESrUnloadRule,
|
sl@0
|
75 |
ESrLoadEngineParameters,
|
sl@0
|
76 |
ESrGetPronunciationIDArraySize,
|
sl@0
|
77 |
ESrGetPronunciationIDArrayContents,
|
sl@0
|
78 |
ESrGetRuleIDArraySize,
|
sl@0
|
79 |
ESrGetRuleIDArrayContents,
|
sl@0
|
80 |
ESrGetModelIDArraySize,
|
sl@0
|
81 |
ESrGetModelIDArrayContents,
|
sl@0
|
82 |
ESrGetClientResultSetSize,
|
sl@0
|
83 |
ESrGetClientResultSet,
|
sl@0
|
84 |
ESrSetClientUid,
|
sl@0
|
85 |
ESrCommitChanges,
|
sl@0
|
86 |
ESrGetAllClientGrammarIDs,
|
sl@0
|
87 |
ESrGetAllClientLexiconIDs,
|
sl@0
|
88 |
ESrGetAllClientModelBankIDs,
|
sl@0
|
89 |
ESrGetAllGrammarIDs,
|
sl@0
|
90 |
ESrGetAllLexiconIDs,
|
sl@0
|
91 |
ESrGetAllModelBankIDs,
|
sl@0
|
92 |
ESrGetGrammarIDArraySize,
|
sl@0
|
93 |
ESrGetGrammarIDArrayContents,
|
sl@0
|
94 |
ESrGetLexiconIDArraySize,
|
sl@0
|
95 |
ESrGetLexiconIDArrayContents,
|
sl@0
|
96 |
ESrGetModelBankIDArraySize,
|
sl@0
|
97 |
ESrGetModelBankIDArrayContents
|
sl@0
|
98 |
};
|
sl@0
|
99 |
|
sl@0
|
100 |
typedef TPckgBuf<TSrsRecognize> TSrsRecognizePckg;
|
sl@0
|
101 |
typedef TPckgBuf<TSrsAddPronunciation> TSrsAddPronunciationPckg;
|
sl@0
|
102 |
typedef TPckgBuf<TSrsAddRule> TSrsAddRulePckg;
|
sl@0
|
103 |
typedef TPckgBuf<TSrsRuleValidity> TSrsRuleValidityPckg;
|
sl@0
|
104 |
typedef TPckgBuf<TGrammarID> TSrsGrammarIDPckg;
|
sl@0
|
105 |
typedef TPckgBuf<TGrammarID *> TSrsGrammarIDPtrPckg;
|
sl@0
|
106 |
typedef TPckgBuf<TLexiconID> TSrsLexiconIDPckg;
|
sl@0
|
107 |
typedef TPckgBuf<TLexiconID *> TSrsLexiconIDPtrPckg;
|
sl@0
|
108 |
typedef TPckgBuf<TModelBankID> TSrsModelBankIDPckg;
|
sl@0
|
109 |
typedef TPckgBuf<TModelBankID *> TSrsModelBankIDPtrPckg;
|
sl@0
|
110 |
typedef TPckgBuf<TSrsGetUtteranceDuration> TSrsGetUtteranceDurationPckg;
|
sl@0
|
111 |
typedef TPckgBuf<TTimeIntervalMicroSeconds32> TSrsTimeIntervalMicroSeconds32Pckg;
|
sl@0
|
112 |
typedef TPckgBuf<TSrsPlayUtterance> TSrsPlayUtterancePckg;
|
sl@0
|
113 |
typedef TPckgBuf<TRecognitionMode> TSrsRecognitionModePckg;
|
sl@0
|
114 |
typedef TPckgBuf<TPronunciationID> TSrsPronunciationIDPckg;
|
sl@0
|
115 |
typedef TPckgBuf<TModelID> TSrsModelIDPckg;
|
sl@0
|
116 |
typedef TPckgBuf<TRuleID> TSrsRuleIDPckg;
|
sl@0
|
117 |
typedef TPckgBuf<TModelID *> TSrsModelIDPtrPckg;
|
sl@0
|
118 |
typedef TPckgBuf<TInt *> TSrsIntPtrPckg;
|
sl@0
|
119 |
typedef TPckgBuf<TUid> TSrsUidPckg;
|
sl@0
|
120 |
|
sl@0
|
121 |
// CLASS DECLARATION
|
sl@0
|
122 |
|
sl@0
|
123 |
/**
|
sl@0
|
124 |
* @internalComponent
|
sl@0
|
125 |
* This is the TSrsRecognize class declaration.
|
sl@0
|
126 |
*
|
sl@0
|
127 |
* @since 8.0
|
sl@0
|
128 |
*/
|
sl@0
|
129 |
class TSrsRecognize
|
sl@0
|
130 |
{
|
sl@0
|
131 |
public:
|
sl@0
|
132 |
|
sl@0
|
133 |
/**
|
sl@0
|
134 |
* C++ constructor for this class.
|
sl@0
|
135 |
* @since 8.0
|
sl@0
|
136 |
*/
|
sl@0
|
137 |
TSrsRecognize();
|
sl@0
|
138 |
|
sl@0
|
139 |
/**
|
sl@0
|
140 |
* C++ constructor for this class.
|
sl@0
|
141 |
* @since 8.0
|
sl@0
|
142 |
* @param aClientResultSet Pointer to client result set object.
|
sl@0
|
143 |
*/
|
sl@0
|
144 |
TSrsRecognize(CSDClientResultSet* aClientResultSet);
|
sl@0
|
145 |
|
sl@0
|
146 |
// member variable pointer to result set
|
sl@0
|
147 |
CSDClientResultSet* iClientResultSet;
|
sl@0
|
148 |
|
sl@0
|
149 |
};
|
sl@0
|
150 |
|
sl@0
|
151 |
/**
|
sl@0
|
152 |
* @internalComponent
|
sl@0
|
153 |
* This is the TSrsAddPronunciation class declaration.
|
sl@0
|
154 |
*
|
sl@0
|
155 |
* @since 8.0
|
sl@0
|
156 |
*/
|
sl@0
|
157 |
class TSrsAddPronunciation
|
sl@0
|
158 |
{
|
sl@0
|
159 |
public:
|
sl@0
|
160 |
|
sl@0
|
161 |
/**
|
sl@0
|
162 |
* C++ constructor for this class.
|
sl@0
|
163 |
* @since 8.0
|
sl@0
|
164 |
*/
|
sl@0
|
165 |
TSrsAddPronunciation();
|
sl@0
|
166 |
|
sl@0
|
167 |
/**
|
sl@0
|
168 |
* C++ constructor for this class.
|
sl@0
|
169 |
* @since 8.0
|
sl@0
|
170 |
* @param aLexiconID lexicon ID
|
sl@0
|
171 |
* @param aModelBankID model bank ID
|
sl@0
|
172 |
* @param aModelID model ID
|
sl@0
|
173 |
* @param aPronunciationID pronunciation ID
|
sl@0
|
174 |
*/
|
sl@0
|
175 |
TSrsAddPronunciation(TLexiconID aLexiconID, TModelBankID aModelBankID,
|
sl@0
|
176 |
TModelID aModelID, TPronunciationID* aPronunciationID);
|
sl@0
|
177 |
|
sl@0
|
178 |
// lexicon ID member variable
|
sl@0
|
179 |
TLexiconID iLexiconID;
|
sl@0
|
180 |
// model bank ID member variable
|
sl@0
|
181 |
TModelBankID iModelBankID;
|
sl@0
|
182 |
// model ID member variable
|
sl@0
|
183 |
TModelID iModelID;
|
sl@0
|
184 |
// pronunciation ID pointer member variable
|
sl@0
|
185 |
TPronunciationID* iPronunciationID;
|
sl@0
|
186 |
};
|
sl@0
|
187 |
|
sl@0
|
188 |
|
sl@0
|
189 |
/**
|
sl@0
|
190 |
* @internalComponent
|
sl@0
|
191 |
* This is the TSrsAddRule class declaration.
|
sl@0
|
192 |
*
|
sl@0
|
193 |
* @since 8.0
|
sl@0
|
194 |
*/
|
sl@0
|
195 |
class TSrsAddRule
|
sl@0
|
196 |
{
|
sl@0
|
197 |
public:
|
sl@0
|
198 |
/**
|
sl@0
|
199 |
* C++ constructor for this class.
|
sl@0
|
200 |
* @since 8.0
|
sl@0
|
201 |
*/
|
sl@0
|
202 |
TSrsAddRule();
|
sl@0
|
203 |
|
sl@0
|
204 |
/**
|
sl@0
|
205 |
* C++ constructor for this class.
|
sl@0
|
206 |
* @since 8.0
|
sl@0
|
207 |
* @param aGrammarID grammar ID
|
sl@0
|
208 |
* @param aLexiconID lexicon ID
|
sl@0
|
209 |
* @param aPronunciationID pronunciation ID
|
sl@0
|
210 |
* @param aRuleID rule ID
|
sl@0
|
211 |
*/
|
sl@0
|
212 |
TSrsAddRule(TGrammarID aGrammarID, TLexiconID aLexiconID,
|
sl@0
|
213 |
TPronunciationID aPronunciationID, TRuleID* aRuleID);
|
sl@0
|
214 |
|
sl@0
|
215 |
// grammar ID member variable
|
sl@0
|
216 |
TGrammarID iGrammarID;
|
sl@0
|
217 |
// lexicon ID member variable
|
sl@0
|
218 |
TLexiconID iLexiconID;
|
sl@0
|
219 |
// pronunciation ID member variable
|
sl@0
|
220 |
TPronunciationID iPronunciationID;
|
sl@0
|
221 |
// rule ID pointer member variable
|
sl@0
|
222 |
TRuleID* iRuleID;
|
sl@0
|
223 |
|
sl@0
|
224 |
};
|
sl@0
|
225 |
|
sl@0
|
226 |
|
sl@0
|
227 |
/**
|
sl@0
|
228 |
* @internalComponent
|
sl@0
|
229 |
* This is the TSrsRuleValidity class declaration.
|
sl@0
|
230 |
*
|
sl@0
|
231 |
* @since 8.0
|
sl@0
|
232 |
*/
|
sl@0
|
233 |
class TSrsRuleValidity
|
sl@0
|
234 |
{
|
sl@0
|
235 |
public:
|
sl@0
|
236 |
/**
|
sl@0
|
237 |
* C++ constructor for this class.
|
sl@0
|
238 |
* @since 8.0
|
sl@0
|
239 |
*/
|
sl@0
|
240 |
TSrsRuleValidity();
|
sl@0
|
241 |
|
sl@0
|
242 |
/**
|
sl@0
|
243 |
* C++ constructor for this class.
|
sl@0
|
244 |
* @since 8.0
|
sl@0
|
245 |
* @param aGrammarID grammar ID
|
sl@0
|
246 |
* @param aRuleID rule ID
|
sl@0
|
247 |
& @param aRuldValid indicates if the rule is valid
|
sl@0
|
248 |
*/
|
sl@0
|
249 |
TSrsRuleValidity(TGrammarID aGrammarID, TRuleID aRuleID, TBool* aRuleValid);
|
sl@0
|
250 |
|
sl@0
|
251 |
// grammar ID member variable
|
sl@0
|
252 |
TGrammarID iGrammarID;
|
sl@0
|
253 |
// rule ID pointer member variable
|
sl@0
|
254 |
TRuleID iRuleID;
|
sl@0
|
255 |
// rule valid member variable
|
sl@0
|
256 |
TBool* iRuleValid;
|
sl@0
|
257 |
};
|
sl@0
|
258 |
|
sl@0
|
259 |
/**
|
sl@0
|
260 |
* @internalComponent
|
sl@0
|
261 |
* This is the TSrsGetUtteranceDuration class declaration.
|
sl@0
|
262 |
*
|
sl@0
|
263 |
* @since 8.0
|
sl@0
|
264 |
*/
|
sl@0
|
265 |
class TSrsGetUtteranceDuration
|
sl@0
|
266 |
{
|
sl@0
|
267 |
public:
|
sl@0
|
268 |
/**
|
sl@0
|
269 |
* C++ constructor for this class.
|
sl@0
|
270 |
* @since 8.0
|
sl@0
|
271 |
*/
|
sl@0
|
272 |
TSrsGetUtteranceDuration();
|
sl@0
|
273 |
|
sl@0
|
274 |
/**
|
sl@0
|
275 |
* C++ constructor for this class.
|
sl@0
|
276 |
* @since 8.0
|
sl@0
|
277 |
* @param aModelBankID model bank ID
|
sl@0
|
278 |
* @param aModelID model ID
|
sl@0
|
279 |
* @param aDuration duration of the recorded utterance
|
sl@0
|
280 |
*/
|
sl@0
|
281 |
TSrsGetUtteranceDuration(TModelBankID aModelBankID, TModelID aModelID,
|
sl@0
|
282 |
TTimeIntervalMicroSeconds32* aDuration);
|
sl@0
|
283 |
|
sl@0
|
284 |
// model bank ID member variable
|
sl@0
|
285 |
TModelBankID iModelBankID;
|
sl@0
|
286 |
// model ID member variable
|
sl@0
|
287 |
TModelID iModelID;
|
sl@0
|
288 |
// utterance duration
|
sl@0
|
289 |
TTimeIntervalMicroSeconds32* iDuration;
|
sl@0
|
290 |
};
|
sl@0
|
291 |
|
sl@0
|
292 |
/**
|
sl@0
|
293 |
* @internalComponent
|
sl@0
|
294 |
* This is the TSrsPlayUtterance class declaration.
|
sl@0
|
295 |
*
|
sl@0
|
296 |
* @since 8.0
|
sl@0
|
297 |
*/
|
sl@0
|
298 |
class TSrsPlayUtterance
|
sl@0
|
299 |
{
|
sl@0
|
300 |
public:
|
sl@0
|
301 |
/**
|
sl@0
|
302 |
* C++ constructor for this class.
|
sl@0
|
303 |
* @since 8.0
|
sl@0
|
304 |
*/
|
sl@0
|
305 |
TSrsPlayUtterance();
|
sl@0
|
306 |
|
sl@0
|
307 |
/**
|
sl@0
|
308 |
* C++ constructor for this class.
|
sl@0
|
309 |
* @since 8.0
|
sl@0
|
310 |
* @param aModelBankID model bank ID
|
sl@0
|
311 |
* @param aModelID model ID
|
sl@0
|
312 |
* @param aFromMemory indicates if the utterance is in memory,
|
sl@0
|
313 |
* ETrue if in memory
|
sl@0
|
314 |
*/
|
sl@0
|
315 |
TSrsPlayUtterance(TModelBankID aModelBankID, TModelID aModelID);
|
sl@0
|
316 |
|
sl@0
|
317 |
// model bank ID member variable
|
sl@0
|
318 |
TModelBankID iModelBankID;
|
sl@0
|
319 |
// model ID member variable
|
sl@0
|
320 |
TModelID iModelID;
|
sl@0
|
321 |
};
|
sl@0
|
322 |
|
sl@0
|
323 |
// inlines
|
sl@0
|
324 |
|
sl@0
|
325 |
inline TSrsRecognize::TSrsRecognize()
|
sl@0
|
326 |
{
|
sl@0
|
327 |
}
|
sl@0
|
328 |
|
sl@0
|
329 |
inline TSrsRecognize::TSrsRecognize(CSDClientResultSet* aClientResultSet)
|
sl@0
|
330 |
: iClientResultSet(aClientResultSet)
|
sl@0
|
331 |
{
|
sl@0
|
332 |
}
|
sl@0
|
333 |
|
sl@0
|
334 |
inline TSrsAddPronunciation::TSrsAddPronunciation()
|
sl@0
|
335 |
{
|
sl@0
|
336 |
}
|
sl@0
|
337 |
|
sl@0
|
338 |
inline TSrsAddPronunciation::TSrsAddPronunciation(TLexiconID aLexiconID, TModelBankID aModelBankID,
|
sl@0
|
339 |
TModelID aModelID, TPronunciationID* aPronunciationID)
|
sl@0
|
340 |
: iLexiconID(aLexiconID), iModelBankID(aModelBankID),
|
sl@0
|
341 |
iModelID(aModelID), iPronunciationID(aPronunciationID)
|
sl@0
|
342 |
{
|
sl@0
|
343 |
}
|
sl@0
|
344 |
|
sl@0
|
345 |
inline TSrsAddRule::TSrsAddRule()
|
sl@0
|
346 |
{
|
sl@0
|
347 |
}
|
sl@0
|
348 |
|
sl@0
|
349 |
inline TSrsAddRule::TSrsAddRule(TGrammarID aGrammarID, TLexiconID aLexiconID,
|
sl@0
|
350 |
TPronunciationID aPronunciationID, TRuleID* aRuleID)
|
sl@0
|
351 |
: iGrammarID(aGrammarID), iLexiconID(aLexiconID),
|
sl@0
|
352 |
iPronunciationID(aPronunciationID), iRuleID(aRuleID)
|
sl@0
|
353 |
{
|
sl@0
|
354 |
}
|
sl@0
|
355 |
|
sl@0
|
356 |
inline TSrsRuleValidity::TSrsRuleValidity()
|
sl@0
|
357 |
{
|
sl@0
|
358 |
}
|
sl@0
|
359 |
|
sl@0
|
360 |
inline TSrsRuleValidity::TSrsRuleValidity(TGrammarID aGrammarID, TRuleID aRuleID, TBool* aRuleValid)
|
sl@0
|
361 |
: iGrammarID(aGrammarID), iRuleID(aRuleID), iRuleValid(aRuleValid)
|
sl@0
|
362 |
{
|
sl@0
|
363 |
}
|
sl@0
|
364 |
|
sl@0
|
365 |
inline TSrsGetUtteranceDuration::TSrsGetUtteranceDuration()
|
sl@0
|
366 |
{
|
sl@0
|
367 |
}
|
sl@0
|
368 |
|
sl@0
|
369 |
inline TSrsGetUtteranceDuration::TSrsGetUtteranceDuration(TModelBankID aModelBankID, TModelID aModelID,
|
sl@0
|
370 |
TTimeIntervalMicroSeconds32* aDuration)
|
sl@0
|
371 |
: iModelBankID(aModelBankID), iModelID(aModelID), iDuration(aDuration)
|
sl@0
|
372 |
{
|
sl@0
|
373 |
}
|
sl@0
|
374 |
|
sl@0
|
375 |
inline TSrsPlayUtterance::TSrsPlayUtterance()
|
sl@0
|
376 |
{
|
sl@0
|
377 |
}
|
sl@0
|
378 |
|
sl@0
|
379 |
|
sl@0
|
380 |
inline TSrsPlayUtterance::TSrsPlayUtterance(TModelBankID aModelBankID, TModelID aModelID)
|
sl@0
|
381 |
: iModelBankID(aModelBankID),
|
sl@0
|
382 |
iModelID(aModelID)
|
sl@0
|
383 |
{
|
sl@0
|
384 |
}
|
sl@0
|
385 |
|
sl@0
|
386 |
|
sl@0
|
387 |
#endif // __SPEECHRECOGNITIONCUSTOMCOMMANDCOMMON_H__
|
sl@0
|
388 |
|
sl@0
|
389 |
// end of file
|