srsf/nssvasapi/nssvasrecognition/inc/nssvascadaptationitem.h
branchRCL_3
changeset 19 e36f3802f733
parent 0 bf1d17376201
equal deleted inserted replaced
18:cad71a31b7fc 19:e36f3802f733
       
     1 /*
       
     2 * Copyright (c) 2004-2006 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  The MNssAdaptationItem interface class handles speaker adaptation,
       
    15 *               when the client wants to decide herself, when to adapt.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef NSSVASCADAPTATIONITEM_H
       
    21 #define NSSVASCADAPTATIONITEM_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32std.h>
       
    25 #include <e32base.h>
       
    26 #include <nssvasmadaptationitem.h>
       
    27 #include <nssvasmadaptationeventhandler.h>
       
    28 #include "nssvascrecognitionhandler.h"
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33 *  CNssAdaptationItem class
       
    34 *  Contains adaptation data.
       
    35 *
       
    36 *  @lib NssVASApi.lib
       
    37 *  @since 2.8
       
    38 */
       
    39 class CNssAdaptationItem : public CBase, public MNssAdaptationItem
       
    40     {
       
    41 
       
    42     public:  //enum
       
    43 
       
    44 	  enum TNssRejectTagError
       
    45         {
       
    46         EVasErrorNone,
       
    47         EVasRejectTagFailed,
       
    48         EVasNoTagInContexts,
       
    49         EVasRecognizeUndefinedError10,   // for place holder
       
    50         EVasRecognizeUndefinedError9,
       
    51         EVasRecognizeUndefinedError8,
       
    52         EVasRecognizeUndefinedError7,
       
    53         EVasRecognizeUndefinedError6,
       
    54         EVasRecognizeUndefinedError5,
       
    55         EVasRecognizeUndefinedError4,
       
    56         EVasRecognizeUndefinedError3,
       
    57         EVasRecognizeUndefinedError2,
       
    58         EVasRecognizeUndefinedError1
       
    59         };
       
    60 
       
    61     public: // Constructors and destructors
       
    62 
       
    63     /**
       
    64     * NewL - 2-phase constructor
       
    65     * @param aRecHandlerHost The recognition handler, which created this item.
       
    66     * @param aRecResult Recognition result contains the data required for adaptation.
       
    67     * @since 2.8
       
    68     */
       
    69     IMPORT_C static CNssAdaptationItem* NewL(
       
    70         CNssRecognitionHandler* aRecHandlerHost,
       
    71         CSIClientResultSet* aRecResult );
       
    72 
       
    73     /**
       
    74 	* ~MNssAdaptationItem - Destructor  
       
    75     * @since 2.8
       
    76     */
       
    77     IMPORT_C ~CNssAdaptationItem();
       
    78 
       
    79 public: // Functions from base classes
       
    80 
       
    81     /**
       
    82 	* AdaptL - Adapts the models using utterance and result
       
    83     * @from MNssAdaptationItem
       
    84     * @since 2.8
       
    85     * @param aHandler Adaptation handler is called when adaptation has finished.
       
    86     * @param aCorrect Which result from the N-best list is the correct one.
       
    87     */
       
    88     IMPORT_C void AdaptL( MNssAdaptationEventHandler *aHandler, TInt aCorrect );
       
    89 
       
    90     /**
       
    91     * Adapts the models using the tag information
       
    92     * 
       
    93     * @since 3.2
       
    94     * @param aHandler Event handler for this adaptation
       
    95     * @param aTag Selected tag
       
    96     */ 
       
    97     IMPORT_C void AdaptL( MNssAdaptationEventHandler* aHandler,
       
    98                           MNssTag& aTag );
       
    99 
       
   100 public: // New functions
       
   101 
       
   102     /**
       
   103     * Disable - CNssRecognitionHandler calls this function, when the handler
       
   104     * is destroyed. It deactivates the adaptation item, since adaptation
       
   105     * can't happen without the recognition handler host.
       
   106     * @since 2.8
       
   107     */
       
   108     IMPORT_C void Disable();
       
   109 
       
   110     private: // New functions
       
   111 
       
   112     /**
       
   113     * 1st phase constructor
       
   114     */
       
   115     CNssAdaptationItem( CNssRecognitionHandler* aRecHandlerHost, CSIClientResultSet* aRecResult );
       
   116 
       
   117 private: // Data
       
   118 
       
   119     // Pointer to the recognition handler host
       
   120     CNssRecognitionHandler* iRecHandler;
       
   121 
       
   122     // If the recognition handler host is destroyed, the associated 
       
   123     // adaptation items are deactivated.
       
   124     TBool iIsActive;
       
   125 
       
   126     // Recognition result set contains the data required for adaptation.
       
   127     CSIClientResultSet* iAdaptationData;
       
   128     };
       
   129 
       
   130 #endif // NSSVASCADAPTATIONITEM_H   
       
   131             
       
   132 // End of File