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