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