sl@0: // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #ifndef __SPEECHRECOGNITIONCUSTOMCOMMANDCOMMON_H__ sl@0: #define __SPEECHRECOGNITIONCUSTOMCOMMANDCOMMON_H__ sl@0: sl@0: #include sl@0: // INCLUDE FILES sl@0: #include sl@0: sl@0: // CONSTANTS sl@0: static const TUid KUidInterfaceSpeechRecognition = {0x101F8CA6}; sl@0: sl@0: // FORWARD DECLARATIONS sl@0: class TSrsRecognize; sl@0: class TSrsAddPronunciation; sl@0: class TSrsAddRule; sl@0: class TSrsRuleValidity; sl@0: class TSrsGetUtteranceDuration; sl@0: class TSrsGetUtteranceDuration; sl@0: class TSrsPlayUtterance; sl@0: sl@0: // DATA TYPES sl@0: sl@0: /** sl@0: * @internalComponent sl@0: * Custom command message definitions sl@0: */ sl@0: enum TSrCustomCommandMessages sl@0: { sl@0: ESrAddPronunciation, sl@0: ESrAddRule, sl@0: ESrCancel, sl@0: ESrCreateGrammar, sl@0: ESrCreateLexicon, sl@0: ESrCreateModelBank, sl@0: ESrEndRecSession, sl@0: ESrGetAllModelIDs, sl@0: ESrGetAllPronunciationIDs, sl@0: ESrGetAllRuleIDs, sl@0: ESrGetAvailableStorage, sl@0: ESrGetEngineProperties, sl@0: ESrGetModelCount, sl@0: ESrGetPronunciationCount, sl@0: ESrGetRuleCount, sl@0: ESrGetRuleValidity, sl@0: ESrUtteranceDuration, sl@0: ESrLoadGrammar, sl@0: ESrLoadLexicon, sl@0: ESrLoadModels, sl@0: ESrPlayUtterance, sl@0: ESrRecognize, sl@0: ESrRecord, sl@0: ESrRemoveGrammar, sl@0: ESrRemoveLexicon, sl@0: ESrRemoveModelBank, sl@0: ESrRemoveModel, sl@0: ESrRemovePronunciation, sl@0: ESrRemoveRule, sl@0: ESrStartRecSession, sl@0: ESrTrain, sl@0: ESrUnloadRule, sl@0: ESrLoadEngineParameters, sl@0: ESrGetPronunciationIDArraySize, sl@0: ESrGetPronunciationIDArrayContents, sl@0: ESrGetRuleIDArraySize, sl@0: ESrGetRuleIDArrayContents, sl@0: ESrGetModelIDArraySize, sl@0: ESrGetModelIDArrayContents, sl@0: ESrGetClientResultSetSize, sl@0: ESrGetClientResultSet, sl@0: ESrSetClientUid, sl@0: ESrCommitChanges, sl@0: ESrGetAllClientGrammarIDs, sl@0: ESrGetAllClientLexiconIDs, sl@0: ESrGetAllClientModelBankIDs, sl@0: ESrGetAllGrammarIDs, sl@0: ESrGetAllLexiconIDs, sl@0: ESrGetAllModelBankIDs, sl@0: ESrGetGrammarIDArraySize, sl@0: ESrGetGrammarIDArrayContents, sl@0: ESrGetLexiconIDArraySize, sl@0: ESrGetLexiconIDArrayContents, sl@0: ESrGetModelBankIDArraySize, sl@0: ESrGetModelBankIDArrayContents sl@0: }; sl@0: sl@0: typedef TPckgBuf TSrsRecognizePckg; sl@0: typedef TPckgBuf TSrsAddPronunciationPckg; sl@0: typedef TPckgBuf TSrsAddRulePckg; sl@0: typedef TPckgBuf TSrsRuleValidityPckg; sl@0: typedef TPckgBuf TSrsGrammarIDPckg; sl@0: typedef TPckgBuf TSrsGrammarIDPtrPckg; sl@0: typedef TPckgBuf TSrsLexiconIDPckg; sl@0: typedef TPckgBuf TSrsLexiconIDPtrPckg; sl@0: typedef TPckgBuf TSrsModelBankIDPckg; sl@0: typedef TPckgBuf TSrsModelBankIDPtrPckg; sl@0: typedef TPckgBuf TSrsGetUtteranceDurationPckg; sl@0: typedef TPckgBuf TSrsTimeIntervalMicroSeconds32Pckg; sl@0: typedef TPckgBuf TSrsPlayUtterancePckg; sl@0: typedef TPckgBuf TSrsRecognitionModePckg; sl@0: typedef TPckgBuf TSrsPronunciationIDPckg; sl@0: typedef TPckgBuf TSrsModelIDPckg; sl@0: typedef TPckgBuf TSrsRuleIDPckg; sl@0: typedef TPckgBuf TSrsModelIDPtrPckg; sl@0: typedef TPckgBuf TSrsIntPtrPckg; sl@0: typedef TPckgBuf TSrsUidPckg; sl@0: sl@0: // CLASS DECLARATION sl@0: sl@0: /** sl@0: * @internalComponent sl@0: * This is the TSrsRecognize class declaration. sl@0: * sl@0: * @since 8.0 sl@0: */ sl@0: class TSrsRecognize sl@0: { sl@0: public: sl@0: sl@0: /** sl@0: * C++ constructor for this class. sl@0: * @since 8.0 sl@0: */ sl@0: TSrsRecognize(); sl@0: sl@0: /** sl@0: * C++ constructor for this class. sl@0: * @since 8.0 sl@0: * @param aClientResultSet Pointer to client result set object. sl@0: */ sl@0: TSrsRecognize(CSDClientResultSet* aClientResultSet); sl@0: sl@0: // member variable pointer to result set sl@0: CSDClientResultSet* iClientResultSet; sl@0: sl@0: }; sl@0: sl@0: /** sl@0: * @internalComponent sl@0: * This is the TSrsAddPronunciation class declaration. sl@0: * sl@0: * @since 8.0 sl@0: */ sl@0: class TSrsAddPronunciation sl@0: { sl@0: public: sl@0: sl@0: /** sl@0: * C++ constructor for this class. sl@0: * @since 8.0 sl@0: */ sl@0: TSrsAddPronunciation(); sl@0: sl@0: /** sl@0: * C++ constructor for this class. sl@0: * @since 8.0 sl@0: * @param aLexiconID lexicon ID sl@0: * @param aModelBankID model bank ID sl@0: * @param aModelID model ID sl@0: * @param aPronunciationID pronunciation ID sl@0: */ sl@0: TSrsAddPronunciation(TLexiconID aLexiconID, TModelBankID aModelBankID, sl@0: TModelID aModelID, TPronunciationID* aPronunciationID); sl@0: sl@0: // lexicon ID member variable sl@0: TLexiconID iLexiconID; sl@0: // model bank ID member variable sl@0: TModelBankID iModelBankID; sl@0: // model ID member variable sl@0: TModelID iModelID; sl@0: // pronunciation ID pointer member variable sl@0: TPronunciationID* iPronunciationID; sl@0: }; sl@0: sl@0: sl@0: /** sl@0: * @internalComponent sl@0: * This is the TSrsAddRule class declaration. sl@0: * sl@0: * @since 8.0 sl@0: */ sl@0: class TSrsAddRule sl@0: { sl@0: public: sl@0: /** sl@0: * C++ constructor for this class. sl@0: * @since 8.0 sl@0: */ sl@0: TSrsAddRule(); sl@0: sl@0: /** sl@0: * C++ constructor for this class. sl@0: * @since 8.0 sl@0: * @param aGrammarID grammar ID sl@0: * @param aLexiconID lexicon ID sl@0: * @param aPronunciationID pronunciation ID sl@0: * @param aRuleID rule ID sl@0: */ sl@0: TSrsAddRule(TGrammarID aGrammarID, TLexiconID aLexiconID, sl@0: TPronunciationID aPronunciationID, TRuleID* aRuleID); sl@0: sl@0: // grammar ID member variable sl@0: TGrammarID iGrammarID; sl@0: // lexicon ID member variable sl@0: TLexiconID iLexiconID; sl@0: // pronunciation ID member variable sl@0: TPronunciationID iPronunciationID; sl@0: // rule ID pointer member variable sl@0: TRuleID* iRuleID; sl@0: sl@0: }; sl@0: sl@0: sl@0: /** sl@0: * @internalComponent sl@0: * This is the TSrsRuleValidity class declaration. sl@0: * sl@0: * @since 8.0 sl@0: */ sl@0: class TSrsRuleValidity sl@0: { sl@0: public: sl@0: /** sl@0: * C++ constructor for this class. sl@0: * @since 8.0 sl@0: */ sl@0: TSrsRuleValidity(); sl@0: sl@0: /** sl@0: * C++ constructor for this class. sl@0: * @since 8.0 sl@0: * @param aGrammarID grammar ID sl@0: * @param aRuleID rule ID sl@0: & @param aRuldValid indicates if the rule is valid sl@0: */ sl@0: TSrsRuleValidity(TGrammarID aGrammarID, TRuleID aRuleID, TBool* aRuleValid); sl@0: sl@0: // grammar ID member variable sl@0: TGrammarID iGrammarID; sl@0: // rule ID pointer member variable sl@0: TRuleID iRuleID; sl@0: // rule valid member variable sl@0: TBool* iRuleValid; sl@0: }; sl@0: sl@0: /** sl@0: * @internalComponent sl@0: * This is the TSrsGetUtteranceDuration class declaration. sl@0: * sl@0: * @since 8.0 sl@0: */ sl@0: class TSrsGetUtteranceDuration sl@0: { sl@0: public: sl@0: /** sl@0: * C++ constructor for this class. sl@0: * @since 8.0 sl@0: */ sl@0: TSrsGetUtteranceDuration(); sl@0: sl@0: /** sl@0: * C++ constructor for this class. sl@0: * @since 8.0 sl@0: * @param aModelBankID model bank ID sl@0: * @param aModelID model ID sl@0: * @param aDuration duration of the recorded utterance sl@0: */ sl@0: TSrsGetUtteranceDuration(TModelBankID aModelBankID, TModelID aModelID, sl@0: TTimeIntervalMicroSeconds32* aDuration); sl@0: sl@0: // model bank ID member variable sl@0: TModelBankID iModelBankID; sl@0: // model ID member variable sl@0: TModelID iModelID; sl@0: // utterance duration sl@0: TTimeIntervalMicroSeconds32* iDuration; sl@0: }; sl@0: sl@0: /** sl@0: * @internalComponent sl@0: * This is the TSrsPlayUtterance class declaration. sl@0: * sl@0: * @since 8.0 sl@0: */ sl@0: class TSrsPlayUtterance sl@0: { sl@0: public: sl@0: /** sl@0: * C++ constructor for this class. sl@0: * @since 8.0 sl@0: */ sl@0: TSrsPlayUtterance(); sl@0: sl@0: /** sl@0: * C++ constructor for this class. sl@0: * @since 8.0 sl@0: * @param aModelBankID model bank ID sl@0: * @param aModelID model ID sl@0: * @param aFromMemory indicates if the utterance is in memory, sl@0: * ETrue if in memory sl@0: */ sl@0: TSrsPlayUtterance(TModelBankID aModelBankID, TModelID aModelID); sl@0: sl@0: // model bank ID member variable sl@0: TModelBankID iModelBankID; sl@0: // model ID member variable sl@0: TModelID iModelID; sl@0: }; sl@0: sl@0: // inlines sl@0: sl@0: inline TSrsRecognize::TSrsRecognize() sl@0: { sl@0: } sl@0: sl@0: inline TSrsRecognize::TSrsRecognize(CSDClientResultSet* aClientResultSet) sl@0: : iClientResultSet(aClientResultSet) sl@0: { sl@0: } sl@0: sl@0: inline TSrsAddPronunciation::TSrsAddPronunciation() sl@0: { sl@0: } sl@0: sl@0: inline TSrsAddPronunciation::TSrsAddPronunciation(TLexiconID aLexiconID, TModelBankID aModelBankID, sl@0: TModelID aModelID, TPronunciationID* aPronunciationID) sl@0: : iLexiconID(aLexiconID), iModelBankID(aModelBankID), sl@0: iModelID(aModelID), iPronunciationID(aPronunciationID) sl@0: { sl@0: } sl@0: sl@0: inline TSrsAddRule::TSrsAddRule() sl@0: { sl@0: } sl@0: sl@0: inline TSrsAddRule::TSrsAddRule(TGrammarID aGrammarID, TLexiconID aLexiconID, sl@0: TPronunciationID aPronunciationID, TRuleID* aRuleID) sl@0: : iGrammarID(aGrammarID), iLexiconID(aLexiconID), sl@0: iPronunciationID(aPronunciationID), iRuleID(aRuleID) sl@0: { sl@0: } sl@0: sl@0: inline TSrsRuleValidity::TSrsRuleValidity() sl@0: { sl@0: } sl@0: sl@0: inline TSrsRuleValidity::TSrsRuleValidity(TGrammarID aGrammarID, TRuleID aRuleID, TBool* aRuleValid) sl@0: : iGrammarID(aGrammarID), iRuleID(aRuleID), iRuleValid(aRuleValid) sl@0: { sl@0: } sl@0: sl@0: inline TSrsGetUtteranceDuration::TSrsGetUtteranceDuration() sl@0: { sl@0: } sl@0: sl@0: inline TSrsGetUtteranceDuration::TSrsGetUtteranceDuration(TModelBankID aModelBankID, TModelID aModelID, sl@0: TTimeIntervalMicroSeconds32* aDuration) sl@0: : iModelBankID(aModelBankID), iModelID(aModelID), iDuration(aDuration) sl@0: { sl@0: } sl@0: sl@0: inline TSrsPlayUtterance::TSrsPlayUtterance() sl@0: { sl@0: } sl@0: sl@0: sl@0: inline TSrsPlayUtterance::TSrsPlayUtterance(TModelBankID aModelBankID, TModelID aModelID) sl@0: : iModelBankID(aModelBankID), sl@0: iModelID(aModelID) sl@0: { sl@0: } sl@0: sl@0: sl@0: #endif // __SPEECHRECOGNITIONCUSTOMCOMMANDCOMMON_H__ sl@0: sl@0: // end of file