epoc32/include/speechrecognitionutility.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@2
     1
// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@4
     4
// under the terms of "Eclipse Public License v1.0"
williamr@2
     5
// which accompanies this distribution, and is available
williamr@4
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
//
williamr@2
    15
williamr@2
    16
#ifndef __SPEECHRECOGNITIONUTILITY_H__
williamr@2
    17
#define __SPEECHRECOGNITIONUTILITY_H__
williamr@2
    18
williamr@2
    19
// INCLUDES
williamr@2
    20
williamr@2
    21
#include <e32base.h>
williamr@2
    22
#include <mmf/common/mmfcontroller.h>
williamr@2
    23
#include <mmf/common/speechrecognitioncustomcommands.h>
williamr@2
    24
#include <mmf/common/speechrecognitiondataclient.h>
williamr@2
    25
#include <speechrecognitionutilityobserver.h>
williamr@2
    26
williamr@2
    27
williamr@2
    28
// CLASS DECLARATION
williamr@2
    29
williamr@2
    30
/**
williamr@2
    31
@publishedAll
williamr@2
    32
@released
williamr@2
    33
williamr@2
    34
This is the main class of Speech Recognition Utility.
williamr@2
    35
williamr@2
    36
@since  8.0
williamr@2
    37
*/
williamr@2
    38
class CSpeechRecognitionUtility : public CBase
williamr@2
    39
	{
williamr@2
    40
	class CBody;
williamr@2
    41
public:
williamr@2
    42
williamr@2
    43
	/**
williamr@2
    44
	Factory function for creating this class.
williamr@2
    45
williamr@2
    46
	@param	aClientUid
williamr@2
    47
	        The UID of the client.
williamr@2
    48
	@param 	aSpeechRecognitionUtilityObserver
williamr@2
    49
	        A reference to the event observer class.
williamr@2
    50
williamr@2
    51
	@return	A pointer to CSpeechRecognitionUtility object
williamr@2
    52
williamr@2
    53
	@since  8.0
williamr@2
    54
	*/
williamr@2
    55
	IMPORT_C static CSpeechRecognitionUtility* NewL(
williamr@2
    56
							MSpeechRecognitionUtilityObserver&
williamr@2
    57
							aSpeechRecognitionUtilityObserver, TUid aClientUid );
williamr@2
    58
williamr@2
    59
	/**
williamr@2
    60
	Factory function for creating this class. Leaves a pointer on the cleanup stack.
williamr@2
    61
williamr@2
    62
	@param  aSpeechRecognitionUtilityObserver		
williamr@2
    63
	        A reference to the event observer class.
williamr@2
    64
	@param  aClientUid
williamr@2
    65
	        A client UID for data ownership.
williamr@2
    66
williamr@2
    67
	@return A pointer to a CSpeechRecognitionUtility object.
williamr@2
    68
williamr@2
    69
	@since  8.0
williamr@2
    70
	*/
williamr@2
    71
	IMPORT_C static CSpeechRecognitionUtility* NewLC(
williamr@2
    72
							MSpeechRecognitionUtilityObserver&
williamr@2
    73
							aSpeechRecognitionUtilityObserver, TUid aClientUid );
williamr@2
    74
williamr@2
    75
	/**
williamr@2
    76
	Destructor.
williamr@2
    77
williamr@2
    78
	@since  8.0
williamr@2
    79
	*/
williamr@2
    80
	IMPORT_C ~CSpeechRecognitionUtility();
williamr@2
    81
williamr@2
    82
	/**
williamr@2
    83
	Returns the engine properties specified by the engine property
williamr@2
    84
	ID array. On return aPropertyValue contains an array of engine
williamr@2
    85
	properties.
williamr@2
    86
williamr@2
    87
	@param  aPropertyId		
williamr@2
    88
	        A constant reference to an array of engine property ID's.
williamr@2
    89
	@param  aPropertyValue
williamr@2
    90
	        A reference to an array of engine property values.
williamr@2
    91
williamr@2
    92
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
    93
	        another of the system-wide error codes.
williamr@2
    94
williamr@2
    95
	@since  8.0
williamr@2
    96
	*/
williamr@2
    97
	IMPORT_C TInt GetEngineProperties( const RArray<TInt>& aPropertyId,
williamr@2
    98
		RArray<TInt>& aPropertyValue );
williamr@2
    99
williamr@2
   100
	/**
williamr@2
   101
	Adds a new pronunciation for the given model into the
williamr@2
   102
	specified lexicon.
williamr@2
   103
	
williamr@2
   104
	@param  aLexiconID			
williamr@2
   105
	        The lexicon ID, where the new pronunciation is added to.
williamr@2
   106
	@param  aModelBankID		
williamr@2
   107
	        The model bank ID.
williamr@2
   108
	@param	aModelID			
williamr@2
   109
	        The model ID.
williamr@2
   110
	@param  aPronunciationID	
williamr@2
   111
	        A reference where the new pronunciation ID is assigned to.
williamr@2
   112
williamr@2
   113
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   114
	        another of the system-wide error codes.
williamr@2
   115
williamr@2
   116
	@since  8.0
williamr@2
   117
	*/
williamr@2
   118
	IMPORT_C TInt AddPronunciation( TLexiconID aLexiconID,
williamr@2
   119
		TModelBankID aModelBankID, TModelID aModelID,
williamr@2
   120
		TPronunciationID& aPronunciationID );
williamr@2
   121
williamr@2
   122
	/**
williamr@2
   123
	Adds a new rule for the given pronunciation into the
williamr@2
   124
	specified grammar.
williamr@2
   125
williamr@2
   126
	@param  aGrammarID			
williamr@2
   127
	        The grammar ID, where the new rule is added to.
williamr@2
   128
	@param  aLexiconID			
williamr@2
   129
	        The lexicon ID.
williamr@2
   130
	@param  aPronunciationID	
williamr@2
   131
	        The pronunciation ID.
williamr@2
   132
	@param  aRuleID				
williamr@2
   133
	        A reference where the new rule ID is assigned to.
williamr@2
   134
williamr@2
   135
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   136
	        another of the system-wide error codes.
williamr@2
   137
williamr@2
   138
	@since  8.0
williamr@2
   139
	*/
williamr@2
   140
	IMPORT_C TInt AddRule( TGrammarID aGrammarID, TLexiconID aLexiconID,
williamr@2
   141
		TPronunciationID aPronunciationID, TRuleID& aRuleID );
williamr@2
   142
williamr@2
   143
	/**
williamr@2
   144
	Cancels the current operation.
williamr@2
   145
williamr@2
   146
	@since 8.0
williamr@2
   147
	*/
williamr@2
   148
	IMPORT_C void Cancel();
williamr@2
   149
williamr@2
   150
	/**
williamr@2
   151
	Commit the current train operation to the database.
williamr@2
   152
williamr@2
   153
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   154
	        another of the system-wide error codes.
williamr@2
   155
williamr@2
   156
	@since  8.0
williamr@2
   157
	*/
williamr@2
   158
	IMPORT_C TInt CommitChanges();
williamr@2
   159
williamr@2
   160
	/**
williamr@2
   161
	Creates a new grammar.
williamr@2
   162
williamr@2
   163
	@param  aGrammarID			
williamr@2
   164
	        A reference where grammar ID is stored.
williamr@2
   165
williamr@2
   166
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   167
	        another of the system-wide error codes.
williamr@2
   168
williamr@2
   169
	@since  8.0
williamr@2
   170
	*/
williamr@2
   171
	IMPORT_C TInt CreateGrammar( TGrammarID& aGrammarID );
williamr@2
   172
williamr@2
   173
	/**
williamr@2
   174
	Creates a new lexicon.
williamr@2
   175
williamr@2
   176
	@param  aLexiconID			
williamr@2
   177
	        A reference where lexicon ID is stored.
williamr@2
   178
williamr@2
   179
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   180
	        another of the system-wide error codes.
williamr@2
   181
williamr@2
   182
	@since  8.0
williamr@2
   183
	*/
williamr@2
   184
	IMPORT_C TInt CreateLexicon( TLexiconID& aLexiconID );
williamr@2
   185
williamr@2
   186
	/**
williamr@2
   187
	Loads the specified model bank into the recognizer;
williamr@2
   188
	done prior to recognition.
williamr@2
   189
williamr@2
   190
	@param  aModelBankID
williamr@2
   191
			The Model bank ID
williamr@2
   192
williamr@2
   193
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   194
	        another of the system-wide error codes.
williamr@2
   195
williamr@2
   196
	@since  8.0
williamr@2
   197
	*/
williamr@2
   198
	IMPORT_C TInt LoadModels( TModelBankID aModelBankID );
williamr@2
   199
williamr@2
   200
	/**
williamr@2
   201
	Loads the specified grammar into the recognizer;
williamr@2
   202
	done prior to recognition.
williamr@2
   203
	
williamr@2
   204
	@param  aGrammarID			
williamr@2
   205
	        The grammar ID.
williamr@2
   206
williamr@2
   207
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   208
	        another of the system-wide error codes.
williamr@2
   209
williamr@2
   210
	@since  8.0
williamr@2
   211
	*/
williamr@2
   212
	IMPORT_C TInt LoadGrammar( TGrammarID aGrammarID );
williamr@2
   213
williamr@2
   214
	/**
williamr@2
   215
	Loads the specified lexicon into the recognizer;
williamr@2
   216
	done prior to recognition.
williamr@2
   217
williamr@2
   218
	@param  aLexiconID			
williamr@2
   219
	        The lexicon ID.
williamr@2
   220
williamr@2
   221
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   222
	        another of the system-wide error codes.
williamr@2
   223
williamr@2
   224
	@since  8.0
williamr@2
   225
	*/
williamr@2
   226
	IMPORT_C TInt LoadLexicon( TLexiconID aLexiconID );
williamr@2
   227
williamr@2
   228
	/**
williamr@2
   229
	Returns the duration of the utterance for the specified model.
williamr@2
   230
williamr@2
   231
	@param  aModelBankID		
williamr@2
   232
	        The model bank ID.
williamr@2
   233
	@param  aModelID			
williamr@2
   234
	        The model ID.
williamr@2
   235
	@param  aDuration			
williamr@2
   236
	        The reference where the duration of utterance is set.
williamr@2
   237
williamr@2
   238
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   239
	        another of the system-wide error codes.
williamr@2
   240
williamr@2
   241
	@since  8.0
williamr@2
   242
	*/
williamr@2
   243
	IMPORT_C TInt GetUtteranceDuration( TModelBankID aModelBankID,
williamr@2
   244
		TModelID aModelID,
williamr@2
   245
		TTimeIntervalMicroSeconds32& aDuration);
williamr@2
   246
williamr@2
   247
	/**
williamr@2
   248
	Plays the previously trained utterance.
williamr@2
   249
williamr@2
   250
	@param  aModelBankID
williamr@2
   251
	        The model bank ID.
williamr@2
   252
	@param  aModelID
williamr@2
   253
	        The model ID, whose utterance is played.
williamr@2
   254
williamr@2
   255
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   256
	        another of the system-wide error codes.
williamr@2
   257
williamr@2
   258
	@since  8.0
williamr@2
   259
	*/
williamr@2
   260
	IMPORT_C TInt PlayUtterance( TModelBankID aModelBankID,
williamr@2
   261
		TModelID aModelID);
williamr@2
   262
williamr@2
   263
	/**
williamr@2
   264
	Returns the number of models in the specified model bank.
williamr@2
   265
williamr@2
   266
	@param  aModelBankID		
williamr@2
   267
	        The model bank ID.
williamr@2
   268
	@param  aModelCount			
williamr@2
   269
	        The reference where the number of models is set.
williamr@2
   270
williamr@2
   271
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   272
	        another of the system-wide error codes.
williamr@2
   273
williamr@2
   274
	@since  8.0
williamr@2
   275
	*/
williamr@2
   276
	IMPORT_C TInt GetModelCount( TModelBankID aModelBankID, TInt& aModelCount );
williamr@2
   277
williamr@2
   278
	/**
williamr@2
   279
	Ends the current recognition session. Resources allocated
williamr@2
   280
	for recognition are freed.
williamr@2
   281
williamr@2
   282
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   283
	        another of the system-wide error codes.
williamr@2
   284
williamr@2
   285
	@since  8.0
williamr@2
   286
	*/
williamr@2
   287
	IMPORT_C TInt EndRecSession();
williamr@2
   288
williamr@2
   289
	/**
williamr@2
   290
	Starts a new recognition session.
williamr@2
   291
williamr@2
   292
	@param  aMode				
williamr@2
   293
	        The recognition mode.
williamr@2
   294
williamr@2
   295
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   296
	        another of the system-wide error codes.
williamr@2
   297
williamr@2
   298
	@since  8.0
williamr@2
   299
	*/
williamr@2
   300
	IMPORT_C TInt StartRecSession( TRecognitionMode aMode );
williamr@2
   301
williamr@2
   302
	/**
williamr@2
   303
	Initiates recognition; performed following loading of
williamr@2
   304
	model bank, lexicon, and grammar.
williamr@2
   305
williamr@2
   306
	@param  aResultSet			
williamr@2
   307
	        A reference where the recognition result is set.
williamr@2
   308
williamr@2
   309
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   310
	        another of the system-wide error codes.
williamr@2
   311
williamr@2
   312
	@since  8.0
williamr@2
   313
	*/
williamr@2
   314
	IMPORT_C TInt Recognize( CSDClientResultSet& aResultSet );
williamr@2
   315
williamr@2
   316
	/**
williamr@2
   317
	Records user utterance for training and recognition.
williamr@2
   318
williamr@2
   319
	@param  aRecordTime			
williamr@2
   320
	        The recording time in microseconds.
williamr@2
   321
williamr@2
   322
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   323
	        another of the system-wide error codes.
williamr@2
   324
williamr@2
   325
	@since  8.0
williamr@2
   326
	*/
williamr@2
   327
	IMPORT_C TInt Record( TTimeIntervalMicroSeconds32 aRecordTime );
williamr@2
   328
williamr@2
   329
	/**
williamr@2
   330
	Removes the specified grammar from the permanent storage. 
williamr@2
   331
williamr@2
   332
	Removing a grammar will remove all rules within the grammar.
williamr@2
   333
williamr@2
   334
	@param  aGrammarID			
williamr@2
   335
	        The grammar ID.
williamr@2
   336
williamr@2
   337
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   338
	        another of the system-wide error codes.
williamr@2
   339
williamr@2
   340
	@since  8.0
williamr@2
   341
	*/
williamr@2
   342
	IMPORT_C TInt RemoveGrammar( TGrammarID aGrammarID );
williamr@2
   343
williamr@2
   344
	/**
williamr@2
   345
	Removes the specified pronunciation from the specified lexicon permanently.
williamr@2
   346
williamr@2
   347
	@param  aLexiconID			
williamr@2
   348
	        The lexicon ID.
williamr@2
   349
	@param  aPronunciationID	
williamr@2
   350
	        The pronunciation ID.
williamr@2
   351
williamr@2
   352
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   353
	        another of the system-wide error codes.
williamr@2
   354
williamr@2
   355
	@since  8.0
williamr@2
   356
	*/
williamr@2
   357
	IMPORT_C TInt RemovePronunciation( TLexiconID aLexiconID,
williamr@2
   358
		TPronunciationID aPronunciationID );
williamr@2
   359
williamr@2
   360
	/**
williamr@2
   361
	Removes the specified lexicon from the permanent storage.
williamr@2
   362
	
williamr@2
   363
	Removing a lexicon will remove all pronunciations within the lexicon.
williamr@2
   364
williamr@2
   365
	@param  aLexiconID			
williamr@2
   366
	        The lexicon ID.
williamr@2
   367
williamr@2
   368
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   369
	        another of the system-wide error codes.
williamr@2
   370
williamr@2
   371
	@since  8.0
williamr@2
   372
	*/
williamr@2
   373
	IMPORT_C TInt RemoveLexicon( TLexiconID aLexiconID );
williamr@2
   374
williamr@2
   375
	/**
williamr@2
   376
	Removes the specified model from the specified model bank
williamr@2
   377
	permanently.
williamr@2
   378
williamr@2
   379
	@param  aModelBankID		
williamr@2
   380
	        The model bank ID.
williamr@2
   381
	@param  aModelID			
williamr@2
   382
	        The model ID.
williamr@2
   383
williamr@2
   384
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   385
	        another of the system-wide error codes.
williamr@2
   386
williamr@2
   387
	@since  8.0
williamr@2
   388
	*/
williamr@2
   389
	IMPORT_C TInt RemoveModel( TModelBankID aModelBankID,
williamr@2
   390
		TModelID aModelID );
williamr@2
   391
williamr@2
   392
	/**
williamr@2
   393
	Removes the specified rule from the specified grammar permanently.
williamr@2
   394
williamr@2
   395
	@param  aGrammarID			
williamr@2
   396
	        The grammar ID.
williamr@2
   397
	@param  aRuleID
williamr@2
   398
	        The rule ID.
williamr@2
   399
williamr@2
   400
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   401
	        another of the system-wide error codes.
williamr@2
   402
williamr@2
   403
	@since  8.0
williamr@2
   404
	*/
williamr@2
   405
	IMPORT_C TInt RemoveRule( TGrammarID aGrammarID, TRuleID aRuleID );
williamr@2
   406
williamr@2
   407
	/**
williamr@2
   408
	Trains a new model into the specified model bank.
williamr@2
   409
williamr@2
   410
	@param  aModelBankID		
williamr@2
   411
	        The model bank ID.
williamr@2
   412
	@param  aModelID			
williamr@2
   413
	        A reference where a new model ID is assigned to.
williamr@2
   414
williamr@2
   415
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   416
	        another of the system-wide error codes.
williamr@2
   417
williamr@2
   418
	@since  8.0
williamr@2
   419
	*/
williamr@2
   420
	IMPORT_C TInt Train( TModelBankID aModelBankID, TModelID& aModelID );
williamr@2
   421
williamr@2
   422
	/**
williamr@2
   423
	Unloads the specified rule from the specified grammar in temporary memory, previously loaded 
williamr@2
   424
	with LoadGrammarL.
williamr@2
   425
williamr@2
   426
	The rule in the permanent storage remains intact.
williamr@2
   427
williamr@2
   428
	@param  aGrammarID			
williamr@2
   429
	        The grammar ID.
williamr@2
   430
	@param  aRuleID				
williamr@2
   431
	        The rule ID.
williamr@2
   432
williamr@2
   433
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   434
	        another of the system-wide error codes.
williamr@2
   435
williamr@2
   436
	@since  8.0
williamr@2
   437
	*/
williamr@2
   438
	IMPORT_C TInt UnloadRule( TGrammarID aGrammarID, TRuleID aRuleID );
williamr@2
   439
williamr@2
   440
	/**
williamr@2
   441
	Sets the event handler for asynchronous events.
williamr@2
   442
williamr@2
   443
	@param  aSpeechRecognitionUtilityObserver		
williamr@2
   444
	        A pointer to an observer.
williamr@2
   445
williamr@2
   446
	@since  8.0
williamr@2
   447
	*/
williamr@2
   448
	IMPORT_C void SetEventHandler( MSpeechRecognitionUtilityObserver*
williamr@2
   449
		aSpeechRecognitionUtilityObserver );
williamr@2
   450
williamr@2
   451
	/**
williamr@2
   452
	Returns all pronunciation IDs that exist in the specified lexicon.
williamr@2
   453
williamr@2
   454
	@param  aLexiconID
williamr@2
   455
	        The lexicon ID.
williamr@2
   456
	@param  aPronunciationIDs
williamr@2
   457
	        A reference where pronunciation IDs are stored.
williamr@2
   458
williamr@2
   459
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   460
	        another of the system-wide error codes.
williamr@2
   461
williamr@2
   462
	@since  8.0
williamr@2
   463
	*/
williamr@2
   464
	IMPORT_C TInt GetAllPronunciationIDs( TLexiconID aLexiconID,
williamr@2
   465
		RArray <TPronunciationID>& aPronunciationIDs );
williamr@2
   466
williamr@2
   467
	/**
williamr@2
   468
	Returns all grammar IDs owned by the client.
williamr@2
   469
williamr@2
   470
	@param  aGrammarIDs			
williamr@2
   471
	        A reference where rule IDs are stored.
williamr@2
   472
williamr@2
   473
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   474
	        another of the system-wide error codes.
williamr@2
   475
williamr@2
   476
	@since  8.0
williamr@2
   477
	*/
williamr@2
   478
	IMPORT_C TInt GetAllClientGrammarIDs(RArray <TGrammarID>& aGrammarIDs );
williamr@2
   479
williamr@2
   480
	/**
williamr@2
   481
	Returns all lexicons owned by the client.
williamr@2
   482
williamr@2
   483
	@param  aLexiconIDs	
williamr@2
   484
	        A reference where lexicon IDs are stored.
williamr@2
   485
williamr@2
   486
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   487
	        another of the system-wide error codes.
williamr@2
   488
williamr@2
   489
	@since  8.0
williamr@2
   490
	*/
williamr@2
   491
	IMPORT_C TInt GetAllClientLexiconIDs(RArray <TLexiconID>& aLexiconIDs );
williamr@2
   492
williamr@2
   493
	/**
williamr@2
   494
	Returns all modelbank IDs owned by the client.
williamr@2
   495
williamr@2
   496
	@param  aModelBankIDs			
williamr@2
   497
	        A reference where modelbank IDs are stored.
williamr@2
   498
williamr@2
   499
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   500
	        another of the system-wide error codes.
williamr@2
   501
williamr@2
   502
	@since  8.0
williamr@2
   503
	*/
williamr@2
   504
		IMPORT_C TInt GetAllClientModelBankIDs(
williamr@2
   505
							RArray<TModelBankID>& aModelBankIDs );
williamr@2
   506
	/**
williamr@2
   507
	Returns all grammar IDs.
williamr@2
   508
williamr@2
   509
	@param  aGrammarIDs			
williamr@2
   510
	        A reference where rule IDs are stored.
williamr@2
   511
williamr@2
   512
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   513
	        another of the system-wide error codes.
williamr@2
   514
williamr@2
   515
	@since  8.0
williamr@2
   516
	*/
williamr@2
   517
	IMPORT_C TInt GetAllGrammarIDs(RArray <TGrammarID>& aGrammarIDs );
williamr@2
   518
	
williamr@2
   519
	/**
williamr@2
   520
	Returns all lexicons IDs.
williamr@2
   521
williamr@2
   522
	@param  aLexiconIDs	
williamr@2
   523
	        A reference where lexicon IDs are stored.
williamr@2
   524
williamr@2
   525
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   526
	        another of the system-wide error codes.
williamr@2
   527
williamr@2
   528
	@since  8.0
williamr@2
   529
	*/
williamr@2
   530
	IMPORT_C TInt GetAllLexiconIDs(RArray <TLexiconID>& aLexiconIDs );
williamr@2
   531
williamr@2
   532
	/**
williamr@2
   533
	Returns all modelbank IDs.
williamr@2
   534
williamr@2
   535
	@param  aModelBankIDs			
williamr@2
   536
	        A reference where modelbank IDs are stored.
williamr@2
   537
williamr@2
   538
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   539
	        another of the system-wide error codes.
williamr@2
   540
williamr@2
   541
	@since  8.0
williamr@2
   542
	*/
williamr@2
   543
	IMPORT_C TInt GetAllModelBankIDs(
williamr@2
   544
		RArray<TModelBankID>& aModelBankIDs );
williamr@2
   545
williamr@2
   546
	/**
williamr@2
   547
	Returns all model IDs that exist in the specified model bank.
williamr@2
   548
williamr@2
   549
	@param  aModelBankID		
williamr@2
   550
	        The model bank ID.
williamr@2
   551
	@param  aModelIDs			
williamr@2
   552
	        A reference where model IDs are stored.
williamr@2
   553
williamr@2
   554
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   555
	        another of the system-wide error codes.
williamr@2
   556
williamr@2
   557
	@since  8.0
williamr@2
   558
	*/
williamr@2
   559
	IMPORT_C TInt GetAllModelIDs( TModelBankID aModelBankID,
williamr@2
   560
		RArray <TModelID>& aModelIDs );
williamr@2
   561
williamr@2
   562
	/**
williamr@2
   563
	Checks if the rule is valid or not.
williamr@2
   564
williamr@2
   565
	@param  aGrammarID
williamr@2
   566
	        The grammar ID.
williamr@2
   567
	@param	aRuleID
williamr@2
   568
			The rule ID.
williamr@2
   569
	@param  aValid
williamr@2
   570
	        A reference where the validity of the rule is set.
williamr@2
   571
williamr@2
   572
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   573
	        another of the system-wide error codes.
williamr@2
   574
williamr@2
   575
	@since  8.0
williamr@2
   576
	*/
williamr@2
   577
	IMPORT_C TInt GetRuleValidity( TGrammarID aGrammarID, TRuleID aRuleID,
williamr@2
   578
		TBool& aValid );
williamr@2
   579
williamr@2
   580
	/**
williamr@2
   581
	Returns all rule IDs that exist in the specified grammar.
williamr@2
   582
williamr@2
   583
	@param  aGrammarID			
williamr@2
   584
	        The grammar ID.
williamr@2
   585
	@param  aRuleIDs			
williamr@2
   586
	        A reference where rule IDs are stored.
williamr@2
   587
williamr@2
   588
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   589
	        another of the system-wide error codes.
williamr@2
   590
williamr@2
   591
	@since  8.0
williamr@2
   592
	*/
williamr@2
   593
	IMPORT_C TInt GetAllRuleIDs( TGrammarID aGrammarID,
williamr@2
   594
		RArray <TRuleID>& aRuleIDs );
williamr@2
   595
williamr@2
   596
	/**
williamr@2
   597
	Creates a new model bank.
williamr@2
   598
williamr@2
   599
	@param  aModelBankID		
williamr@2
   600
	        A reference where a new model bank IF is assigned to.
williamr@2
   601
williamr@2
   602
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   603
	        another of the system-wide error codes.
williamr@2
   604
williamr@2
   605
	@since  8.0
williamr@2
   606
	*/
williamr@2
   607
	IMPORT_C TInt CreateModelBank( TModelBankID& aModelBankID );
williamr@2
   608
williamr@2
   609
	/**
williamr@2
   610
	Removes the specified model bank from the permanent storage.
williamr@2
   611
williamr@2
   612
	Removing a model bank will remove all models within the model bank.
williamr@2
   613
williamr@2
   614
	@param  aModelBankID		
williamr@2
   615
	        The model bank ID.
williamr@2
   616
williamr@2
   617
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   618
	        another of the system-wide error codes.
williamr@2
   619
williamr@2
   620
	@since	8.0
williamr@2
   621
	*/
williamr@2
   622
	IMPORT_C TInt RemoveModelBank( TModelBankID aModelBankID );
williamr@2
   623
williamr@2
   624
	/**
williamr@2
   625
	Returns the number of models available for training system model storage, based on available 
williamr@2
   626
	disk space.
williamr@2
   627
williamr@2
   628
	@param  aAvailableStorage	
williamr@2
   629
	        The number of models that can be contained in available storage.
williamr@2
   630
williamr@2
   631
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   632
	        another of the system-wide error codes.
williamr@2
   633
williamr@2
   634
	@since  8.0
williamr@2
   635
	*/
williamr@2
   636
	IMPORT_C TInt GetAvailableStorage( TInt& aAvailableStorage );
williamr@2
   637
williamr@2
   638
	/**
williamr@2
   639
	Loads the specified parameters into the recognition engine.
williamr@2
   640
williamr@2
   641
	@param  aParameterId		
williamr@2
   642
	        The array of parameter IDs.
williamr@2
   643
	@param  aParameterValue		
williamr@2
   644
	        The array of parameter values.
williamr@2
   645
williamr@2
   646
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   647
	        another of the system-wide error codes.
williamr@2
   648
williamr@2
   649
	@since  8.0
williamr@2
   650
	*/
williamr@2
   651
	IMPORT_C TInt LoadEngineParameters( const RArray<TInt>& aParameterId,
williamr@2
   652
					const RArray<TInt>& aParameterValue );
williamr@2
   653
williamr@2
   654
	/**
williamr@2
   655
	Sets the audio priority and preference for train, playback and recognition.
williamr@2
   656
williamr@2
   657
	@param  aPriority				
williamr@2
   658
	        The priority for voice recognition.
williamr@2
   659
	@param  aTrainPreference		
williamr@2
   660
	        The preference for training.
williamr@2
   661
	@param  aPlaybackPreference		
williamr@2
   662
	        The preference for playback.
williamr@2
   663
	@param  aRecognitionPreference	
williamr@2
   664
	        The preference for recognition.
williamr@2
   665
williamr@2
   666
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
   667
	        another of the system-wide error codes.
williamr@2
   668
williamr@2
   669
	@since  8.0
williamr@2
   670
williamr@2
   671
	*/
williamr@2
   672
	IMPORT_C TInt SetAudioPriority( TInt aPriority, TInt aTrainPreference,
williamr@2
   673
		TInt aPlaybackPreference, TInt aRecognitionPreference );
williamr@2
   674
williamr@2
   675
private:
williamr@2
   676
	/**
williamr@2
   677
	Private C++ constructor for this class.
williamr@2
   678
williamr@2
   679
	@since  8.0
williamr@2
   680
	*/
williamr@2
   681
	CSpeechRecognitionUtility();
williamr@2
   682
williamr@2
   683
	/**
williamr@2
   684
	Second phase constructor for this class.
williamr@2
   685
williamr@2
   686
	@param  aSpeechRecognitionUtilityObserver		
williamr@2
   687
	        A reference to the event observer class.
williamr@2
   688
williamr@2
   689
	@since  8.0
williamr@2
   690
	*/
williamr@2
   691
	void ConstructL(MSpeechRecognitionUtilityObserver& aSpeechRecognitionUtilityObserver);
williamr@2
   692
williamr@2
   693
private:
williamr@2
   694
	CBody* iBody;
williamr@2
   695
	friend class CBody;
williamr@2
   696
};
williamr@2
   697
williamr@2
   698
#endif	// of __SPEECHRECOGNITIONUTILITY_H__
williamr@2
   699
williamr@2
   700
	// End of File