os/mm/mmdevicefw/speechrecogsupport/ASR/src/SpeechRecognitionCustomCommandCommon.h
Update contrib.
1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __SPEECHRECOGNITIONCUSTOMCOMMANDCOMMON_H__
17 #define __SPEECHRECOGNITIONCUSTOMCOMMANDCOMMON_H__
21 #include <mmf/common/speechrecognitiondataclient.h>
24 static const TUid KUidInterfaceSpeechRecognition = {0x101F8CA6};
26 // FORWARD DECLARATIONS
28 class TSrsAddPronunciation;
30 class TSrsRuleValidity;
31 class TSrsGetUtteranceDuration;
32 class TSrsGetUtteranceDuration;
33 class TSrsPlayUtterance;
39 * Custom command message definitions
41 enum TSrCustomCommandMessages
51 ESrGetAllPronunciationIDs,
53 ESrGetAvailableStorage,
54 ESrGetEngineProperties,
56 ESrGetPronunciationCount,
70 ESrRemovePronunciation,
75 ESrLoadEngineParameters,
76 ESrGetPronunciationIDArraySize,
77 ESrGetPronunciationIDArrayContents,
78 ESrGetRuleIDArraySize,
79 ESrGetRuleIDArrayContents,
80 ESrGetModelIDArraySize,
81 ESrGetModelIDArrayContents,
82 ESrGetClientResultSetSize,
83 ESrGetClientResultSet,
86 ESrGetAllClientGrammarIDs,
87 ESrGetAllClientLexiconIDs,
88 ESrGetAllClientModelBankIDs,
91 ESrGetAllModelBankIDs,
92 ESrGetGrammarIDArraySize,
93 ESrGetGrammarIDArrayContents,
94 ESrGetLexiconIDArraySize,
95 ESrGetLexiconIDArrayContents,
96 ESrGetModelBankIDArraySize,
97 ESrGetModelBankIDArrayContents
100 typedef TPckgBuf<TSrsRecognize> TSrsRecognizePckg;
101 typedef TPckgBuf<TSrsAddPronunciation> TSrsAddPronunciationPckg;
102 typedef TPckgBuf<TSrsAddRule> TSrsAddRulePckg;
103 typedef TPckgBuf<TSrsRuleValidity> TSrsRuleValidityPckg;
104 typedef TPckgBuf<TGrammarID> TSrsGrammarIDPckg;
105 typedef TPckgBuf<TGrammarID *> TSrsGrammarIDPtrPckg;
106 typedef TPckgBuf<TLexiconID> TSrsLexiconIDPckg;
107 typedef TPckgBuf<TLexiconID *> TSrsLexiconIDPtrPckg;
108 typedef TPckgBuf<TModelBankID> TSrsModelBankIDPckg;
109 typedef TPckgBuf<TModelBankID *> TSrsModelBankIDPtrPckg;
110 typedef TPckgBuf<TSrsGetUtteranceDuration> TSrsGetUtteranceDurationPckg;
111 typedef TPckgBuf<TTimeIntervalMicroSeconds32> TSrsTimeIntervalMicroSeconds32Pckg;
112 typedef TPckgBuf<TSrsPlayUtterance> TSrsPlayUtterancePckg;
113 typedef TPckgBuf<TRecognitionMode> TSrsRecognitionModePckg;
114 typedef TPckgBuf<TPronunciationID> TSrsPronunciationIDPckg;
115 typedef TPckgBuf<TModelID> TSrsModelIDPckg;
116 typedef TPckgBuf<TRuleID> TSrsRuleIDPckg;
117 typedef TPckgBuf<TModelID *> TSrsModelIDPtrPckg;
118 typedef TPckgBuf<TInt *> TSrsIntPtrPckg;
119 typedef TPckgBuf<TUid> TSrsUidPckg;
125 * This is the TSrsRecognize class declaration.
134 * C++ constructor for this class.
140 * C++ constructor for this class.
142 * @param aClientResultSet Pointer to client result set object.
144 TSrsRecognize(CSDClientResultSet* aClientResultSet);
146 // member variable pointer to result set
147 CSDClientResultSet* iClientResultSet;
153 * This is the TSrsAddPronunciation class declaration.
157 class TSrsAddPronunciation
162 * C++ constructor for this class.
165 TSrsAddPronunciation();
168 * C++ constructor for this class.
170 * @param aLexiconID lexicon ID
171 * @param aModelBankID model bank ID
172 * @param aModelID model ID
173 * @param aPronunciationID pronunciation ID
175 TSrsAddPronunciation(TLexiconID aLexiconID, TModelBankID aModelBankID,
176 TModelID aModelID, TPronunciationID* aPronunciationID);
178 // lexicon ID member variable
179 TLexiconID iLexiconID;
180 // model bank ID member variable
181 TModelBankID iModelBankID;
182 // model ID member variable
184 // pronunciation ID pointer member variable
185 TPronunciationID* iPronunciationID;
191 * This is the TSrsAddRule class declaration.
199 * C++ constructor for this class.
205 * C++ constructor for this class.
207 * @param aGrammarID grammar ID
208 * @param aLexiconID lexicon ID
209 * @param aPronunciationID pronunciation ID
210 * @param aRuleID rule ID
212 TSrsAddRule(TGrammarID aGrammarID, TLexiconID aLexiconID,
213 TPronunciationID aPronunciationID, TRuleID* aRuleID);
215 // grammar ID member variable
216 TGrammarID iGrammarID;
217 // lexicon ID member variable
218 TLexiconID iLexiconID;
219 // pronunciation ID member variable
220 TPronunciationID iPronunciationID;
221 // rule ID pointer member variable
229 * This is the TSrsRuleValidity class declaration.
233 class TSrsRuleValidity
237 * C++ constructor for this class.
243 * C++ constructor for this class.
245 * @param aGrammarID grammar ID
246 * @param aRuleID rule ID
247 & @param aRuldValid indicates if the rule is valid
249 TSrsRuleValidity(TGrammarID aGrammarID, TRuleID aRuleID, TBool* aRuleValid);
251 // grammar ID member variable
252 TGrammarID iGrammarID;
253 // rule ID pointer member variable
255 // rule valid member variable
261 * This is the TSrsGetUtteranceDuration class declaration.
265 class TSrsGetUtteranceDuration
269 * C++ constructor for this class.
272 TSrsGetUtteranceDuration();
275 * C++ constructor for this class.
277 * @param aModelBankID model bank ID
278 * @param aModelID model ID
279 * @param aDuration duration of the recorded utterance
281 TSrsGetUtteranceDuration(TModelBankID aModelBankID, TModelID aModelID,
282 TTimeIntervalMicroSeconds32* aDuration);
284 // model bank ID member variable
285 TModelBankID iModelBankID;
286 // model ID member variable
288 // utterance duration
289 TTimeIntervalMicroSeconds32* iDuration;
294 * This is the TSrsPlayUtterance class declaration.
298 class TSrsPlayUtterance
302 * C++ constructor for this class.
308 * C++ constructor for this class.
310 * @param aModelBankID model bank ID
311 * @param aModelID model ID
312 * @param aFromMemory indicates if the utterance is in memory,
315 TSrsPlayUtterance(TModelBankID aModelBankID, TModelID aModelID);
317 // model bank ID member variable
318 TModelBankID iModelBankID;
319 // model ID member variable
325 inline TSrsRecognize::TSrsRecognize()
329 inline TSrsRecognize::TSrsRecognize(CSDClientResultSet* aClientResultSet)
330 : iClientResultSet(aClientResultSet)
334 inline TSrsAddPronunciation::TSrsAddPronunciation()
338 inline TSrsAddPronunciation::TSrsAddPronunciation(TLexiconID aLexiconID, TModelBankID aModelBankID,
339 TModelID aModelID, TPronunciationID* aPronunciationID)
340 : iLexiconID(aLexiconID), iModelBankID(aModelBankID),
341 iModelID(aModelID), iPronunciationID(aPronunciationID)
345 inline TSrsAddRule::TSrsAddRule()
349 inline TSrsAddRule::TSrsAddRule(TGrammarID aGrammarID, TLexiconID aLexiconID,
350 TPronunciationID aPronunciationID, TRuleID* aRuleID)
351 : iGrammarID(aGrammarID), iLexiconID(aLexiconID),
352 iPronunciationID(aPronunciationID), iRuleID(aRuleID)
356 inline TSrsRuleValidity::TSrsRuleValidity()
360 inline TSrsRuleValidity::TSrsRuleValidity(TGrammarID aGrammarID, TRuleID aRuleID, TBool* aRuleValid)
361 : iGrammarID(aGrammarID), iRuleID(aRuleID), iRuleValid(aRuleValid)
365 inline TSrsGetUtteranceDuration::TSrsGetUtteranceDuration()
369 inline TSrsGetUtteranceDuration::TSrsGetUtteranceDuration(TModelBankID aModelBankID, TModelID aModelID,
370 TTimeIntervalMicroSeconds32* aDuration)
371 : iModelBankID(aModelBankID), iModelID(aModelID), iDuration(aDuration)
375 inline TSrsPlayUtterance::TSrsPlayUtterance()
380 inline TSrsPlayUtterance::TSrsPlayUtterance(TModelBankID aModelBankID, TModelID aModelID)
381 : iModelBankID(aModelBankID),
387 #endif // __SPEECHRECOGNITIONCUSTOMCOMMANDCOMMON_H__