os/mm/mmdevicefw/speechrecogsupport/ASR/src/SpeechRecognitionCustomCommandCommon.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mmdevicefw/speechrecogsupport/ASR/src/SpeechRecognitionCustomCommandCommon.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,389 @@
     1.4 +// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#ifndef	__SPEECHRECOGNITIONCUSTOMCOMMANDCOMMON_H__
    1.20 +#define __SPEECHRECOGNITIONCUSTOMCOMMANDCOMMON_H__
    1.21 +
    1.22 +#include <e32std.h>
    1.23 +// INCLUDE FILES
    1.24 +#include <mmf/common/speechrecognitiondataclient.h>
    1.25 +
    1.26 +// CONSTANTS
    1.27 +static const TUid KUidInterfaceSpeechRecognition = {0x101F8CA6};
    1.28 +
    1.29 +// FORWARD DECLARATIONS
    1.30 +class TSrsRecognize;
    1.31 +class TSrsAddPronunciation;
    1.32 +class TSrsAddRule;
    1.33 +class TSrsRuleValidity;
    1.34 +class TSrsGetUtteranceDuration;
    1.35 +class TSrsGetUtteranceDuration;
    1.36 +class TSrsPlayUtterance;
    1.37 +
    1.38 +// DATA TYPES
    1.39 +
    1.40 +/**
    1.41 +* @internalComponent
    1.42 +* Custom command message definitions
    1.43 +*/
    1.44 +enum TSrCustomCommandMessages
    1.45 +	{
    1.46 +	ESrAddPronunciation,
    1.47 +	ESrAddRule,
    1.48 +	ESrCancel,
    1.49 +	ESrCreateGrammar,
    1.50 +	ESrCreateLexicon,
    1.51 +	ESrCreateModelBank,
    1.52 +	ESrEndRecSession,
    1.53 +	ESrGetAllModelIDs,
    1.54 +	ESrGetAllPronunciationIDs,
    1.55 +	ESrGetAllRuleIDs,
    1.56 +	ESrGetAvailableStorage,
    1.57 +	ESrGetEngineProperties,
    1.58 +	ESrGetModelCount,
    1.59 +	ESrGetPronunciationCount,
    1.60 +	ESrGetRuleCount,
    1.61 +	ESrGetRuleValidity,
    1.62 +	ESrUtteranceDuration,
    1.63 +	ESrLoadGrammar,
    1.64 +	ESrLoadLexicon,
    1.65 +	ESrLoadModels,
    1.66 +	ESrPlayUtterance,
    1.67 +	ESrRecognize,
    1.68 +	ESrRecord,
    1.69 +	ESrRemoveGrammar,
    1.70 +	ESrRemoveLexicon,
    1.71 +	ESrRemoveModelBank,
    1.72 +	ESrRemoveModel,
    1.73 +	ESrRemovePronunciation,
    1.74 +	ESrRemoveRule,
    1.75 +	ESrStartRecSession,
    1.76 +	ESrTrain,
    1.77 +	ESrUnloadRule,
    1.78 +	ESrLoadEngineParameters,
    1.79 +	ESrGetPronunciationIDArraySize,
    1.80 +	ESrGetPronunciationIDArrayContents,
    1.81 +	ESrGetRuleIDArraySize,
    1.82 +	ESrGetRuleIDArrayContents,
    1.83 +	ESrGetModelIDArraySize,
    1.84 +	ESrGetModelIDArrayContents,
    1.85 +	ESrGetClientResultSetSize,
    1.86 +	ESrGetClientResultSet,
    1.87 +	ESrSetClientUid,
    1.88 +	ESrCommitChanges,
    1.89 +	ESrGetAllClientGrammarIDs,
    1.90 +	ESrGetAllClientLexiconIDs,
    1.91 +	ESrGetAllClientModelBankIDs,
    1.92 +	ESrGetAllGrammarIDs,
    1.93 +	ESrGetAllLexiconIDs,
    1.94 +	ESrGetAllModelBankIDs,
    1.95 +	ESrGetGrammarIDArraySize,
    1.96 +	ESrGetGrammarIDArrayContents,
    1.97 +	ESrGetLexiconIDArraySize,
    1.98 +	ESrGetLexiconIDArrayContents,
    1.99 +	ESrGetModelBankIDArraySize,
   1.100 +	ESrGetModelBankIDArrayContents
   1.101 +	};
   1.102 +
   1.103 +typedef TPckgBuf<TSrsRecognize> TSrsRecognizePckg;
   1.104 +typedef TPckgBuf<TSrsAddPronunciation> TSrsAddPronunciationPckg;
   1.105 +typedef TPckgBuf<TSrsAddRule> TSrsAddRulePckg;
   1.106 +typedef TPckgBuf<TSrsRuleValidity> TSrsRuleValidityPckg;
   1.107 +typedef TPckgBuf<TGrammarID> TSrsGrammarIDPckg;
   1.108 +typedef TPckgBuf<TGrammarID *> TSrsGrammarIDPtrPckg;
   1.109 +typedef TPckgBuf<TLexiconID> TSrsLexiconIDPckg;
   1.110 +typedef TPckgBuf<TLexiconID *> TSrsLexiconIDPtrPckg;
   1.111 +typedef TPckgBuf<TModelBankID> TSrsModelBankIDPckg;
   1.112 +typedef TPckgBuf<TModelBankID *> TSrsModelBankIDPtrPckg;
   1.113 +typedef TPckgBuf<TSrsGetUtteranceDuration> TSrsGetUtteranceDurationPckg;
   1.114 +typedef TPckgBuf<TTimeIntervalMicroSeconds32> TSrsTimeIntervalMicroSeconds32Pckg;
   1.115 +typedef TPckgBuf<TSrsPlayUtterance> TSrsPlayUtterancePckg;
   1.116 +typedef TPckgBuf<TRecognitionMode> TSrsRecognitionModePckg;
   1.117 +typedef TPckgBuf<TPronunciationID> TSrsPronunciationIDPckg;
   1.118 +typedef TPckgBuf<TModelID> TSrsModelIDPckg;
   1.119 +typedef TPckgBuf<TRuleID> TSrsRuleIDPckg;
   1.120 +typedef TPckgBuf<TModelID *> TSrsModelIDPtrPckg;
   1.121 +typedef TPckgBuf<TInt *> TSrsIntPtrPckg;
   1.122 +typedef TPckgBuf<TUid> TSrsUidPckg;
   1.123 +
   1.124 +// CLASS DECLARATION
   1.125 +
   1.126 +/**
   1.127 +*  @internalComponent
   1.128 +*  This is the TSrsRecognize class declaration.
   1.129 +*
   1.130 +*  @since 8.0
   1.131 +*/
   1.132 +class TSrsRecognize
   1.133 +{
   1.134 +public:
   1.135 +
   1.136 +	/**
   1.137 +	*	C++ constructor for this class.
   1.138 +    * @since	8.0
   1.139 +    */
   1.140 +	TSrsRecognize();
   1.141 +
   1.142 +	/**
   1.143 +	*	C++ constructor for this class.
   1.144 +    * @since	8.0
   1.145 +    * @param	aClientResultSet	Pointer to client result set object.
   1.146 +    */
   1.147 +	TSrsRecognize(CSDClientResultSet* aClientResultSet);
   1.148 +		
   1.149 +	// member variable pointer to result set
   1.150 +	CSDClientResultSet* iClientResultSet;
   1.151 +
   1.152 +};
   1.153 +
   1.154 +/**
   1.155 +*  @internalComponent
   1.156 +*  This is the TSrsAddPronunciation class declaration.
   1.157 +*
   1.158 +*  @since 8.0
   1.159 +*/
   1.160 +class TSrsAddPronunciation
   1.161 +{
   1.162 +public:
   1.163 +
   1.164 +	/**
   1.165 +	*	C++ constructor for this class.
   1.166 +    * @since	8.0
   1.167 +    */
   1.168 +	TSrsAddPronunciation();
   1.169 +
   1.170 +	/**
   1.171 +	*	C++ constructor for this class.
   1.172 +    * @since	8.0
   1.173 +	* @param	aLexiconID			lexicon ID
   1.174 +	* @param	aModelBankID		model bank ID
   1.175 +	* @param    aModelID			model ID
   1.176 +	* @param	aPronunciationID	pronunciation ID 
   1.177 +    */
   1.178 +	TSrsAddPronunciation(TLexiconID aLexiconID, TModelBankID aModelBankID,
   1.179 +		TModelID aModelID, TPronunciationID* aPronunciationID);
   1.180 +
   1.181 +	// lexicon ID member variable 
   1.182 +	TLexiconID iLexiconID;
   1.183 +	// model bank ID member variable 
   1.184 +	TModelBankID iModelBankID;
   1.185 +	// model ID member variable 
   1.186 +	TModelID iModelID;
   1.187 +	// pronunciation ID pointer member variable
   1.188 +	TPronunciationID* iPronunciationID;
   1.189 +};
   1.190 +
   1.191 +
   1.192 +/**
   1.193 +*  @internalComponent
   1.194 +*  This is the TSrsAddRule class declaration.
   1.195 +*
   1.196 +*  @since 8.0
   1.197 +*/
   1.198 +class TSrsAddRule
   1.199 +{
   1.200 +public:
   1.201 +	/**
   1.202 +	*	C++ constructor for this class.
   1.203 +    * @since	8.0
   1.204 +    */
   1.205 +	TSrsAddRule();
   1.206 +
   1.207 +	/**
   1.208 +	*	C++ constructor for this class.
   1.209 +    * @since	8.0
   1.210 +	* @param	aGrammarID			grammar ID
   1.211 +	* @param	aLexiconID			lexicon ID
   1.212 +	* @param	aPronunciationID	pronunciation ID 
   1.213 +	* @param	aRuleID				rule ID
   1.214 +    */
   1.215 +	TSrsAddRule(TGrammarID aGrammarID, TLexiconID aLexiconID,
   1.216 +		TPronunciationID aPronunciationID, TRuleID* aRuleID);
   1.217 +
   1.218 +	// grammar ID member variable
   1.219 +	TGrammarID iGrammarID;
   1.220 +	// lexicon ID member variable
   1.221 +	TLexiconID iLexiconID;
   1.222 +	// pronunciation ID member variable
   1.223 +	TPronunciationID iPronunciationID;
   1.224 +	// rule ID pointer member variable
   1.225 +	TRuleID* iRuleID;
   1.226 +
   1.227 +};
   1.228 +
   1.229 +
   1.230 +/**
   1.231 +*  @internalComponent
   1.232 +*  This is the TSrsRuleValidity class declaration.
   1.233 +*
   1.234 +*  @since 8.0
   1.235 +*/
   1.236 +class TSrsRuleValidity
   1.237 +	{
   1.238 +public:
   1.239 +	/**
   1.240 +	*	C++ constructor for this class.
   1.241 +    * @since	8.0
   1.242 +    */
   1.243 +	TSrsRuleValidity();
   1.244 +
   1.245 +	/**
   1.246 +	*	C++ constructor for this class.
   1.247 +    * @since	8.0
   1.248 +	* @param	aGrammarID			grammar ID
   1.249 +	* @param	aRuleID				rule ID
   1.250 +	& @param	aRuldValid			indicates if the rule is valid
   1.251 +    */
   1.252 +	TSrsRuleValidity(TGrammarID aGrammarID, TRuleID aRuleID, TBool* aRuleValid);
   1.253 +
   1.254 +	// grammar ID member variable
   1.255 +	TGrammarID iGrammarID;
   1.256 +	// rule ID pointer member variable
   1.257 +	TRuleID iRuleID;
   1.258 +	// rule valid member variable
   1.259 +	TBool* iRuleValid; 
   1.260 +	};
   1.261 +
   1.262 +/**
   1.263 +*  @internalComponent
   1.264 +*  This is the TSrsGetUtteranceDuration class declaration.
   1.265 +*
   1.266 +*  @since 8.0
   1.267 +*/
   1.268 +class TSrsGetUtteranceDuration
   1.269 +	{
   1.270 +public:
   1.271 +	/**
   1.272 +	*	C++ constructor for this class.
   1.273 +    * @since	8.0
   1.274 +    */
   1.275 +	TSrsGetUtteranceDuration();
   1.276 +
   1.277 +	/**
   1.278 +	*	C++ constructor for this class.
   1.279 +    * @since	8.0
   1.280 +	* @param	aModelBankID		model bank ID
   1.281 +	* @param	aModelID			model ID
   1.282 +	* @param	aDuration			duration of the recorded utterance
   1.283 +    */
   1.284 +	TSrsGetUtteranceDuration(TModelBankID aModelBankID, TModelID aModelID,
   1.285 +		TTimeIntervalMicroSeconds32* aDuration); 
   1.286 +
   1.287 +	// model bank ID member variable
   1.288 +	TModelBankID iModelBankID;
   1.289 +	// model ID member variable
   1.290 +	TModelID iModelID;
   1.291 +	// utterance duration
   1.292 +	TTimeIntervalMicroSeconds32* iDuration;
   1.293 +	};
   1.294 +
   1.295 +/**
   1.296 +*  @internalComponent
   1.297 +*  This is the TSrsPlayUtterance class declaration.
   1.298 +*
   1.299 +*  @since 8.0
   1.300 +*/
   1.301 +class TSrsPlayUtterance
   1.302 +	{
   1.303 +public:
   1.304 +	/**
   1.305 +	*	C++ constructor for this class.
   1.306 +    * @since	8.0
   1.307 +    */
   1.308 +	TSrsPlayUtterance();
   1.309 +
   1.310 +	/**
   1.311 +	*	C++ constructor for this class.
   1.312 +    * @since	8.0
   1.313 +	* @param	aModelBankID		model bank ID
   1.314 +	* @param	aModelID			model ID
   1.315 +	* @param	aFromMemory			indicates if the utterance is in memory, 
   1.316 +	*								ETrue if in memory
   1.317 +    */
   1.318 +	TSrsPlayUtterance(TModelBankID aModelBankID, TModelID aModelID);
   1.319 +
   1.320 +	// model bank ID member variable
   1.321 +	TModelBankID iModelBankID;
   1.322 +	// model ID member variable
   1.323 +	TModelID iModelID;
   1.324 +	};
   1.325 +	
   1.326 +// inlines
   1.327 +
   1.328 +inline TSrsRecognize::TSrsRecognize() 
   1.329 +	{
   1.330 +	}
   1.331 +	
   1.332 +inline TSrsRecognize::TSrsRecognize(CSDClientResultSet* aClientResultSet) 
   1.333 +	: iClientResultSet(aClientResultSet)
   1.334 +	{
   1.335 +	}
   1.336 +	
   1.337 +inline TSrsAddPronunciation::TSrsAddPronunciation()
   1.338 +	{
   1.339 +	}
   1.340 +	
   1.341 +inline TSrsAddPronunciation::TSrsAddPronunciation(TLexiconID aLexiconID, TModelBankID aModelBankID,
   1.342 +		TModelID aModelID, TPronunciationID* aPronunciationID) 
   1.343 +	: iLexiconID(aLexiconID), iModelBankID(aModelBankID), 
   1.344 +		iModelID(aModelID), iPronunciationID(aPronunciationID)
   1.345 +	{
   1.346 +	}
   1.347 +
   1.348 +inline TSrsAddRule::TSrsAddRule()
   1.349 +	{
   1.350 +	}
   1.351 +
   1.352 +inline TSrsAddRule::TSrsAddRule(TGrammarID aGrammarID, TLexiconID aLexiconID,
   1.353 +		TPronunciationID aPronunciationID, TRuleID* aRuleID) 
   1.354 +	: iGrammarID(aGrammarID), iLexiconID(aLexiconID), 
   1.355 +		iPronunciationID(aPronunciationID), iRuleID(aRuleID)
   1.356 +	{
   1.357 +	}
   1.358 +	
   1.359 +inline TSrsRuleValidity::TSrsRuleValidity() 
   1.360 +	{
   1.361 +	}
   1.362 +
   1.363 +inline TSrsRuleValidity::TSrsRuleValidity(TGrammarID aGrammarID, TRuleID aRuleID, TBool* aRuleValid) 
   1.364 +	: iGrammarID(aGrammarID), iRuleID(aRuleID), iRuleValid(aRuleValid) 
   1.365 +	{
   1.366 +	}
   1.367 +	
   1.368 +inline TSrsGetUtteranceDuration::TSrsGetUtteranceDuration()
   1.369 +	{
   1.370 +	}
   1.371 +
   1.372 +inline TSrsGetUtteranceDuration::TSrsGetUtteranceDuration(TModelBankID aModelBankID, TModelID aModelID,
   1.373 +	TTimeIntervalMicroSeconds32* aDuration) 
   1.374 +	: iModelBankID(aModelBankID), iModelID(aModelID), iDuration(aDuration) 
   1.375 +	{
   1.376 +	}
   1.377 +		
   1.378 +inline TSrsPlayUtterance::TSrsPlayUtterance() 
   1.379 +	{
   1.380 +	}
   1.381 +
   1.382 +
   1.383 +inline TSrsPlayUtterance::TSrsPlayUtterance(TModelBankID aModelBankID, TModelID aModelID) 
   1.384 +	: iModelBankID(aModelBankID), 
   1.385 +	iModelID(aModelID) 
   1.386 +	{
   1.387 +	}
   1.388 +
   1.389 +
   1.390 +#endif	// __SPEECHRECOGNITIONCUSTOMCOMMANDCOMMON_H__
   1.391 +
   1.392 +// end of file