os/mm/mmdevicefw/speechrecogsupport/ASR/inc/mmf/common/SpeechRecognitionDataDevASR.h
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmdevicefw/speechrecogsupport/ASR/inc/mmf/common/SpeechRecognitionDataDevASR.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,839 @@
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 __SPEECHRECOGNITIONDATADEVASR_H__
1.20 +#define __SPEECHRECOGNITIONDATADEVASR_H__
1.21 +
1.22 +// INCLUDES
1.23 +#include <mmf/common/speechrecognitiondatacommon.h>
1.24 +
1.25 +
1.26 +// FORWARD DECLARATION
1.27 +class TDiagnostic;
1.28 +
1.29 +
1.30 +// CLASS DECLARATION
1.31 +
1.32 +/**
1.33 +@publishedAll
1.34 +@released
1.35 +
1.36 +Class to encapsulate a Speaker Dependent Rule.
1.37 +
1.38 +@since 8.0
1.39 +*/
1.40 +class CSDRule : public CBase
1.41 +{
1.42 +public:// Constructors and destructor
1.43 +
1.44 + /**
1.45 + Destructor.
1.46 + */
1.47 + IMPORT_C ~CSDRule();
1.48 +
1.49 + /**
1.50 + Instantiates an instance of CSDRule.
1.51 +
1.52 + @param aRuleID
1.53 + The rule identifier.
1.54 + @param aLexiconID
1.55 + The lexicon identifier.
1.56 + @param aPronunciationID
1.57 + The pronunciation identifier.
1.58 +
1.59 + @return A pointer to a CSDRule object.
1.60 + */
1.61 + IMPORT_C static CSDRule* NewL(TRuleID aRuleID, TLexiconID aLexiconID, TPronunciationID aPronunciationID);
1.62 +
1.63 + /**
1.64 + Instantiates an instance of CSDRule and leaves a pointer on the cleanup stack.
1.65 +
1.66 + @param aRuleID
1.67 + The rule identifier.
1.68 + @param aLexiconID
1.69 + The lexicon identifier.
1.70 + @param aPronunciationID
1.71 + The pronunciation identifier.
1.72 +
1.73 + @return A pointer to a CSDRule object.
1.74 + */
1.75 + IMPORT_C static CSDRule* NewLC(TRuleID aRuleID, TLexiconID aLexiconID, TPronunciationID aPronunciationID);
1.76 +
1.77 +
1.78 + /**
1.79 + Returns the rule ID of the result.
1.80 +
1.81 + @return The rule identifier.
1.82 +
1.83 + @since 8.0
1.84 + */
1.85 + IMPORT_C TRuleID RuleID() const;
1.86 +
1.87 + /**
1.88 + Returns the lexicon ID of the result.
1.89 +
1.90 + @return The lexicon identifier.
1.91 +
1.92 + @since 8.0
1.93 + */
1.94 + IMPORT_C TLexiconID LexiconID() const;
1.95 +
1.96 + /**
1.97 + Returns the pronunciation ID of the result.
1.98 +
1.99 + @return The pronunciation identifier.
1.100 +
1.101 + @since 8.0
1.102 + */
1.103 + IMPORT_C TPronunciationID PronunciationID() const;
1.104 +
1.105 +private:
1.106 + void ConstructL();
1.107 + CSDRule(TRuleID aRuleID, TLexiconID aLexiconID, TPronunciationID aPronunciationID);
1.108 +
1.109 +private:
1.110 + TRuleID iRuleID;
1.111 + TLexiconID iLexiconID;
1.112 + TPronunciationID iPronunciationID;
1.113 +};
1.114 +
1.115 +
1.116 +/**
1.117 +@publishedAll
1.118 +@released
1.119 +
1.120 +Class to encapsulate a Speaker Dependent Grammar.
1.121 +
1.122 +A grammar consists of a list of rules.
1.123 +
1.124 +@since 8.0
1.125 +*/
1.126 +class CSDGrammar : public CBase
1.127 +{
1.128 +public:// Constructors and destructor
1.129 +
1.130 + /**
1.131 + Destructor.
1.132 + */
1.133 + IMPORT_C ~CSDGrammar();
1.134 +
1.135 + /**
1.136 + Instantiates an instance of CSDGrammar.
1.137 +
1.138 + @param aGrammarID
1.139 + The grammar identifier.
1.140 +
1.141 + @return A pointer to a CSDGrammar object.
1.142 + */
1.143 + IMPORT_C static CSDGrammar* NewL(TGrammarID aGrammarID);
1.144 +
1.145 + /**
1.146 + Instantiates an instance of CSDGrammar and leaves a pointer on the cleanup stack.
1.147 +
1.148 + @param aGrammarID
1.149 + The grammar identifier.
1.150 +
1.151 + @return A pointer to CSDGrammar object.
1.152 + */
1.153 + IMPORT_C static CSDGrammar* NewLC(TGrammarID aGrammarID);
1.154 +
1.155 + /**
1.156 + Returns the grammar ID of the result.
1.157 +
1.158 + @return The grammar identifier.
1.159 +
1.160 + @since 8.0
1.161 + */
1.162 + IMPORT_C TGrammarID GrammarID() const;
1.163 +
1.164 + /**
1.165 + Adds a rule to the grammar.
1.166 +
1.167 + @param aRule
1.168 + A reference to a CSDRule object.
1.169 +
1.170 + @return An error code indicating if the function call was successful. KErrNone on success, otherwise
1.171 + another of the system-wide error codes.
1.172 +
1.173 + @since 8.0
1.174 + */
1.175 + IMPORT_C TInt Add(CSDRule& aRule);
1.176 +
1.177 + /**
1.178 + Deletes a rule from the grammar.
1.179 +
1.180 + @param aRuleID
1.181 + The rule identifier to delete.
1.182 +
1.183 + @since 8.0
1.184 + */
1.185 + IMPORT_C void Delete(TRuleID aRuleID);
1.186 +
1.187 + /**
1.188 + Returns a rule based at an index.
1.189 +
1.190 + @param aIndex
1.191 + An index value. The value must not be negative and must not be greater than the number
1.192 + of rules currently in the grammar, otherwise the function will panic.
1.193 +
1.194 + @return A reference to a CSDRule object.
1.195 +
1.196 + @since 8.0
1.197 + */
1.198 + IMPORT_C const CSDRule& At(TInt aIndex) const;
1.199 +
1.200 + /**
1.201 + Finds a rule in the grammar based on the rule ID.
1.202 +
1.203 + @param aRuleID
1.204 + The rule identifier.
1.205 +
1.206 + @return The index of the first matching rule within the grammar. Returns KErrNotFound, if a
1.207 + matching rule can not be found.
1.208 +
1.209 + @since 8.0
1.210 + */
1.211 + IMPORT_C TInt FindRule(TRuleID aRuleID) const;
1.212 +
1.213 + /**
1.214 + Returns the number of rules in the grammar
1.215 +
1.216 + @return The number of rules.
1.217 +
1.218 + @since 8.0
1.219 + */
1.220 + IMPORT_C TInt Count() const;
1.221 +
1.222 +private:
1.223 + void ConstructL();
1.224 + CSDGrammar(TGrammarID aGrammarID);
1.225 +
1.226 +private:
1.227 + TGrammarID iGrammarID;
1.228 + RPointerArray<CSDRule> iRuleArray;
1.229 +};
1.230 +
1.231 +
1.232 +/**
1.233 +@publishedAll
1.234 +@released
1.235 +
1.236 +Class to encapsulate a Speaker Dependent Pronunciation.
1.237 +
1.238 +@since 8.0
1.239 +*/
1.240 +class CSDPronunciation : public CBase
1.241 +{
1.242 +public:// Constructors and destructor
1.243 +
1.244 + /**
1.245 + Destructor.
1.246 + */
1.247 + IMPORT_C ~CSDPronunciation();
1.248 +
1.249 + /**
1.250 + Instantiates an instance of CSDPronunciation.
1.251 +
1.252 + @param aPronunciationID
1.253 + The pronunciation identifier.
1.254 + @param aModelBankID
1.255 + The model bank identifier.
1.256 + @param aPhonemeID
1.257 + The phoneme identifier.
1.258 +
1.259 + @return A pointer to a CSDPronunciation object.
1.260 + */
1.261 + IMPORT_C static CSDPronunciation* NewL(TPronunciationID aPronunciationID, TModelBankID aModelBankID, TPhonemeID aPhonemeID);
1.262 +
1.263 + /**
1.264 + Instantiates an instance of CSDPronunciation and leaves a pointer on the cleanup stack.
1.265 +
1.266 + @param aPronunciationID
1.267 + The pronunciation identifier.
1.268 + @param aModelBankID
1.269 + The model bank identifier.
1.270 + @param aPhonemeID
1.271 + The phoneme identifier.
1.272 +
1.273 + @return A pointer to a CSDPronunciation object.
1.274 + */
1.275 + IMPORT_C static CSDPronunciation* NewLC(TPronunciationID aPronunciationID, TModelBankID aModelBankID, TPhonemeID aPhonemeID);
1.276 +
1.277 + /**
1.278 + Returns the pronunciation ID of this lexicon entry.
1.279 +
1.280 + @return The pronunciation identifier.
1.281 +
1.282 + @since 8.0
1.283 + */
1.284 + IMPORT_C TPronunciationID PronunciationID() const;
1.285 +
1.286 + /**
1.287 + Returns the ID of the model bank.
1.288 +
1.289 + @return The model bank identifier.
1.290 +
1.291 + @since 8.0
1.292 + */
1.293 + IMPORT_C TModelBankID ModelBankID() const;
1.294 +
1.295 + /**
1.296 + Returns the phoneme ID of this lexicon entry.
1.297 +
1.298 + @return The phoneme identifier.
1.299 +
1.300 + @since 8.0
1.301 + */
1.302 + IMPORT_C TPhonemeID PhonemeID() const;
1.303 +
1.304 +private:
1.305 + void ConstructL();
1.306 + CSDPronunciation(TPronunciationID aPronunciationID, TModelBankID aModelBankID, TPhonemeID aPhonemeID);
1.307 +
1.308 +private:
1.309 + TPronunciationID iPronunciationID;
1.310 + TModelBankID iModelBankID;
1.311 + TPhonemeID iPhonemeID;
1.312 +};
1.313 +
1.314 +
1.315 +/**
1.316 +@publishedAll
1.317 +@released
1.318 +
1.319 +Class to encapsulate a Speaker Dependent Lexicon.
1.320 +
1.321 +@since 8.0
1.322 +*/
1.323 +class CSDLexicon : public CBase
1.324 +{
1.325 +public:// Constructors and destructor
1.326 +
1.327 + /**
1.328 + Destructor.
1.329 + */
1.330 + IMPORT_C ~CSDLexicon();
1.331 +
1.332 + /**
1.333 + Instantiates an instance of CSDLexicon.
1.334 +
1.335 + @param aLexiconID
1.336 + The lexicon identifier.
1.337 +
1.338 + @return A pointer to a CSDLexicon object.
1.339 + */
1.340 + IMPORT_C static CSDLexicon* NewL(TLexiconID aLexiconID);
1.341 +
1.342 + /**
1.343 + Instantiates an instance of CSDGrammar and leaves a pointer on the cleanup stack.
1.344 +
1.345 + @param aLexiconID
1.346 + The lexicon identifier.
1.347 +
1.348 + @return A pointer to a CSDLexicon object.
1.349 + */
1.350 + IMPORT_C static CSDLexicon* NewLC(TLexiconID aLexiconID);
1.351 +
1.352 + /**
1.353 + Returns the ID of the lexicon.
1.354 +
1.355 + @return The lexicon identifier.
1.356 +
1.357 + @since 8.0
1.358 + */
1.359 + IMPORT_C TLexiconID LexiconID() const;
1.360 +
1.361 + /**
1.362 + Adds a lexicon entry to the lexicon.
1.363 +
1.364 + @param aPronunciation
1.365 + A reference to a CSDPronunciation object.
1.366 +
1.367 + @return An error code indicating if the function call was successful. KErrNone on success, otherwise
1.368 + another of the system-wide error codes.
1.369 +
1.370 + @since 8.0
1.371 + */
1.372 + IMPORT_C TInt Add(CSDPronunciation& aPronunciation);
1.373 +
1.374 + /**
1.375 + Returns a pronunciation based at an index.
1.376 +
1.377 + @param aIndex
1.378 + The pronunciation index. This value must not be negative and must not be greater than
1.379 + the number of pronunciations currently in the lexicon, otherwise the function will
1.380 + panic.
1.381 +
1.382 + @return A reference to a CSDPronunciation object.
1.383 +
1.384 + @since 8.0
1.385 + */
1.386 + IMPORT_C const CSDPronunciation& At(TInt aIndex) const;
1.387 +
1.388 + /**
1.389 + Finds a pronunciation based on the specified pronunciation ID.
1.390 +
1.391 + @param aPronunciationID
1.392 + The pronunciation identifier.
1.393 +
1.394 + @return The index of the first matching pronunciation within the lexicon. Returns KErrNotFound,
1.395 + if a matching pronunciation can not be found.
1.396 + */
1.397 + IMPORT_C TInt FindPronunciation(TPronunciationID aPronunciationID) const;
1.398 +
1.399 + /**
1.400 + Returns the number of lexicon entries in the lexicon.
1.401 +
1.402 + @return The number of pronunciations.
1.403 +
1.404 + @since 8.0
1.405 + */
1.406 + IMPORT_C TInt Count() const;
1.407 +
1.408 +private:
1.409 + void ConstructL();
1.410 + CSDLexicon(TLexiconID aLexiconID);
1.411 +
1.412 +private:
1.413 + TLexiconID iLexiconID;
1.414 + RPointerArray<CSDPronunciation> iPronunciationArray;
1.415 +};
1.416 +
1.417 +
1.418 +/**
1.419 +@publishedAll
1.420 +@released
1.421 +
1.422 +Class to encapsulate a Speaker Dependent Model created during the training process.
1.423 +
1.424 +@since 8.0
1.425 +*/
1.426 +class CSDModel : public CBase
1.427 +{
1.428 +public:// Constructors and destructor
1.429 +
1.430 + /**
1.431 + Destructor.
1.432 + */
1.433 + IMPORT_C ~CSDModel();
1.434 +
1.435 + /**
1.436 + Instantiates an instance of a CSDModel.
1.437 +
1.438 + @return A pointer to a CSDModel object.
1.439 + */
1.440 + IMPORT_C static CSDModel* NewL();
1.441 +
1.442 + /**
1.443 + Instantiates an instance of a CSDModel.
1.444 +
1.445 + @return A pointer to a CSDModel object.
1.446 + */
1.447 + IMPORT_C static CSDModel* NewLC();
1.448 +
1.449 + /**
1.450 + Instantiates an instance of a CSDModel.
1.451 +
1.452 + @param aPhonemeID
1.453 + The phoneme identifier.
1.454 +
1.455 + @return A pointer to a CSDModel object.
1.456 + */
1.457 + IMPORT_C static CSDModel* NewL(TPhonemeID aPhonemeID);
1.458 +
1.459 + /**
1.460 + Instantiates an instance of a CSDModel.
1.461 +
1.462 + @param aPhonemeID
1.463 + The phoneme identifier.
1.464 +
1.465 + @return A pointer to a CSDModel object.
1.466 + */
1.467 + IMPORT_C static CSDModel* NewLC(TPhonemeID aPhonemeID);
1.468 +
1.469 + /**
1.470 + Sets the phoneme ID of this model.
1.471 +
1.472 + @param aPhonemeID
1.473 + The phoneme identifier.
1.474 +
1.475 + @since 8.0
1.476 + */
1.477 + IMPORT_C void SetPhonemeID(TPhonemeID aPhonemeID);
1.478 +
1.479 + /**
1.480 + Returns the phoneme ID of this model.
1.481 +
1.482 + @return The phoneme identifier.
1.483 +
1.484 + @since 8.0
1.485 + */
1.486 + IMPORT_C TPhonemeID PhonemeID() const;
1.487 +
1.488 + /**
1.489 + Sets the acoustic model of the model.
1.490 +
1.491 + @param aAcousticModel
1.492 + A pointer descriptor containing the acoustic model (binary).
1.493 +
1.494 + @since 8.0
1.495 + */
1.496 + IMPORT_C void SetAcousticModel(TPtr8& aAcousticModel);
1.497 +
1.498 + /**
1.499 + Gets a pointer to the acoustic model of this model.
1.500 +
1.501 + @return A descriptor to the acoustic model data.
1.502 +
1.503 + @since 8.0
1.504 + */
1.505 + IMPORT_C const TDesC8& AcousticModel() const;
1.506 +
1.507 +private:
1.508 + void ConstructL();
1.509 + CSDModel();
1.510 + CSDModel(TPhonemeID aPhonemeID);
1.511 +
1.512 +private:
1.513 + TPhonemeID iPhonemeID;
1.514 + TPtr8 iAcousticModelPtr;
1.515 +};
1.516 +
1.517 +
1.518 +/**
1.519 +@publishedAll
1.520 +@released
1.521 +
1.522 +Class to encapsulate a Speaker Dependent Model Bank used by the recognizer during the
1.523 +recognition process.
1.524 +
1.525 +@since 8.0
1.526 +*/
1.527 +class CSDModelBank : public CBase
1.528 +{
1.529 +public:// Constructors and destructor
1.530 +
1.531 + /**
1.532 + Destructor.
1.533 + */
1.534 + IMPORT_C ~CSDModelBank();
1.535 +
1.536 + /**
1.537 + Instantiates an instance of a CSDModelBank.
1.538 +
1.539 + @param aModelBankID
1.540 + The model bank identifier.
1.541 +
1.542 + @return A pointer to a CSDModelBank object.
1.543 + */
1.544 + IMPORT_C static CSDModelBank* NewL(TModelBankID aModelBankID);
1.545 +
1.546 + /**
1.547 + Instantiates an instance of a CSDModelBank and leaves a pointer on the cleanup stack.
1.548 +
1.549 + @param aModelBankID
1.550 + The model bank identifier.
1.551 +
1.552 + @return A pointer to a CSDModelBank object.
1.553 + */
1.554 + IMPORT_C static CSDModelBank* NewLC(TModelBankID aModelBankID);
1.555 +
1.556 + /**
1.557 + Returns the model bank ID of the model bank.
1.558 +
1.559 + @return The model bank identifier.
1.560 +
1.561 + @since 8.0
1.562 + */
1.563 + IMPORT_C TModelBankID ModelBankID() const;
1.564 +
1.565 + /**
1.566 + Adds a model to the model bank.
1.567 +
1.568 + @param aModel
1.569 + The reference to CSDModel object.
1.570 +
1.571 + @return An error code indicating if the function call was successful. KErrNone on success, otherwise
1.572 + another of the system-wide error codes.
1.573 +
1.574 + @since 8.0
1.575 + */
1.576 + IMPORT_C TInt Add(CSDModel& aModel);
1.577 +
1.578 + /**
1.579 + Returns a model at the given index.
1.580 +
1.581 + @param aIndex
1.582 + A reference to a CSDModel object.
1.583 +
1.584 + @return The index of the first matching model within the model bank. Returns KErrNotFound, if a
1.585 + matching model can not be found.
1.586 +
1.587 + @since 8.0
1.588 + */
1.589 + IMPORT_C const CSDModel& At(TInt aIndex) const;
1.590 +
1.591 + /**
1.592 + Finds a model based on the specified phoneme ID.
1.593 +
1.594 + @param aPhonemeID
1.595 + The phoneme ID.
1.596 +
1.597 + @return The index of the first matching model within the model bank. Returns KErrNotFound, if a
1.598 + matching model can not be found.
1.599 +
1.600 + @since 8.0
1.601 + */
1.602 + IMPORT_C TInt FindModel(TPhonemeID aPhonemeID) const;
1.603 +
1.604 + /**
1.605 + Returns the number of models in the model bank.
1.606 +
1.607 + @return The number of models in the model bank.
1.608 +
1.609 + @since 8.0
1.610 + */
1.611 + IMPORT_C TInt Count() const;
1.612 +
1.613 +private:
1.614 + void ConstructL();
1.615 + CSDModelBank(TModelBankID aModelBankID);
1.616 +
1.617 +private:
1.618 + TModelBankID iModelBankID;
1.619 + RPointerArray<CSDModel> iModelArray;
1.620 +};
1.621 +
1.622 +
1.623 +/**
1.624 +@publishedAll
1.625 +@released
1.626 +
1.627 +Class to encapsulate a Recognition Result
1.628 +
1.629 +@since 8.0
1.630 +*/
1.631 +class CSDResult : public CBase
1.632 +{
1.633 +public:// Constructors and destructor
1.634 +
1.635 + /**
1.636 + Destructor.
1.637 + */
1.638 + IMPORT_C ~CSDResult();
1.639 +
1.640 + /**
1.641 + Instantiates an instance of a CSDResult.
1.642 +
1.643 + @return A pointer to a CSDResult object.
1.644 + */
1.645 + IMPORT_C static CSDResult* NewL();
1.646 +
1.647 + /**
1.648 + Instantiates an instance of CSDResult and leaves a pointer on the cleanup stack.
1.649 +
1.650 + @return A pointer to a CSDResult object.
1.651 + */
1.652 + IMPORT_C static CSDResult* NewLC();
1.653 +
1.654 + /**
1.655 + Instantiates an instance of a CSDResult.
1.656 +
1.657 + @param aGrammarID
1.658 + The grammar identifier.
1.659 + @param aRuleID
1.660 + The rule identifier.
1.661 +
1.662 + @return A pointer to a CSDResult object.
1.663 + */
1.664 + IMPORT_C static CSDResult* NewL(TGrammarID aGrammarID, TRuleID aRuleID);
1.665 +
1.666 + /**
1.667 + Instantiates an instance of a CSDResult and leaves a pointer on the cleanup stack.
1.668 +
1.669 + @param aGrammarID
1.670 + The grammar identifier.
1.671 + @param aRuleID
1.672 + The rule identifier.
1.673 +
1.674 + @return A pointer to a CSDResult object.
1.675 + */
1.676 + IMPORT_C static CSDResult* NewLC(TGrammarID aGrammarID, TRuleID aRuleID);
1.677 +
1.678 + /**
1.679 + Sets the grammar ID on the result.
1.680 +
1.681 + @param aGrammarID
1.682 + The grammar identifier.
1.683 +
1.684 + @since 8.0
1.685 + */
1.686 + IMPORT_C void SetGrammarID(TGrammarID aGrammarID);
1.687 +
1.688 + /**
1.689 + Returns the grammar ID of the result.
1.690 +
1.691 + @return The grammar identifier.
1.692 +
1.693 + @since 8.0
1.694 + */
1.695 + IMPORT_C TGrammarID GrammarID() const;
1.696 +
1.697 + /**
1.698 + Sets the rule ID of the result.
1.699 +
1.700 + @param aRuleID
1.701 + The rule identifier.
1.702 +
1.703 + @since 8.0
1.704 + */
1.705 + IMPORT_C void SetRuleID(TRuleID aRuleID);
1.706 +
1.707 + /**
1.708 + Returns the rule ID of the result.
1.709 +
1.710 + @return The rule identifier.
1.711 +
1.712 + @since 8.0
1.713 + */
1.714 + IMPORT_C TRuleID RuleID() const;
1.715 +
1.716 + /**
1.717 + Sets the score for this result.
1.718 +
1.719 + @param aScore
1.720 + The score of this result.
1.721 +
1.722 + @since 8.0
1.723 + */
1.724 + IMPORT_C void SetScore(const TInt32 aScore);
1.725 +
1.726 + /**
1.727 + Returns the score of this result.
1.728 +
1.729 + @return The score of this result.
1.730 +
1.731 + @since 8.0
1.732 + */
1.733 + IMPORT_C TInt32 Score() const;
1.734 +
1.735 +private:
1.736 + void ConstructL();
1.737 + CSDResult();
1.738 + CSDResult(TGrammarID aGrammarID, TRuleID aRuleID);
1.739 +
1.740 +private:
1.741 + TGrammarID iGrammarID;
1.742 + TRuleID iRuleID;
1.743 + TInt32 iScore;
1.744 +};
1.745 +
1.746 +
1.747 +/**
1.748 +@publishedAll
1.749 +@released
1.750 +
1.751 +CSDResultSet encapsulates a set of result objects returned by the recognizer at the end of the
1.752 +recognition process. A result set may include additional diagnostic information for error analysis.
1.753 +
1.754 +@since 8.0
1.755 +*/
1.756 +class CSDResultSet : public CBase
1.757 +{
1.758 +public:// Constructors and destructor
1.759 +
1.760 + /**
1.761 + Destructor.
1.762 + */
1.763 + IMPORT_C ~CSDResultSet();
1.764 +
1.765 + /**
1.766 + Instantiates an instance of CSDResultSet.
1.767 +
1.768 + @return A pointer to a CSDResultSet object.
1.769 + */
1.770 + IMPORT_C static CSDResultSet* NewL();
1.771 +
1.772 + /**
1.773 + Instantiates an instance of CSDResultSet and leaves a pointer on the cleanup stack.
1.774 +
1.775 + @return A pointer to a CSDResultSet object.
1.776 + */
1.777 + IMPORT_C static CSDResultSet* NewLC();
1.778 +
1.779 + /**
1.780 + Adds a result to the rule set.
1.781 +
1.782 + @param aResult
1.783 + A reference to the result object to be added.
1.784 +
1.785 + @return An error code indicating if the function call was successful. KErrNone on success, otherwise
1.786 + another of the system-wide error codes.
1.787 +
1.788 + @since 8.0
1.789 + */
1.790 + IMPORT_C TInt Add(CSDResult& aResult);
1.791 +
1.792 + /**
1.793 + Returns a result at a given index within the result set.
1.794 +
1.795 + @param aIndex
1.796 + The index in the result set.
1.797 +
1.798 + @return A reference to CSDResult object.
1.799 +
1.800 + @since 8.0
1.801 + */
1.802 + IMPORT_C const CSDResult& At(TInt aIndex);
1.803 +
1.804 + /**
1.805 + Returns the number of results in the result set.
1.806 +
1.807 + @return The number of results in the result set.
1.808 +
1.809 + @since 8.0
1.810 + */
1.811 + IMPORT_C TInt Count() const;
1.812 +
1.813 + /**
1.814 + Sets the diagnostic of this result set.
1.815 +
1.816 + @param aDiagnostic
1.817 + A reference to the diagostic object.
1.818 +
1.819 + @since 8.0
1.820 + */
1.821 + IMPORT_C void SetDiagnostic(TDiagnostic& aDiagnostic);
1.822 +
1.823 + /**
1.824 + Gets the diagnostic of this result set.
1.825 +
1.826 + @return A reference to A TDiagnostic object.
1.827 +
1.828 + @since 8.0
1.829 + */
1.830 + IMPORT_C const TDiagnostic& Diagnostic() const;
1.831 +
1.832 +private:
1.833 + void ConstructL();
1.834 + CSDResultSet();
1.835 +
1.836 +private:
1.837 + RPointerArray<CSDResult> iResultArray;
1.838 + TDiagnostic* iDiagnostic;
1.839 +};
1.840 +
1.841 +
1.842 +#endif