srsf/nssvasapi/nssvascore/inc/nssvascspeechitemsrsportal.h
branchRCL_3
changeset 19 e36f3802f733
parent 0 bf1d17376201
equal deleted inserted replaced
18:cad71a31b7fc 19:e36f3802f733
       
     1 /*
       
     2 * Copyright (c) 2003-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 VasCSpeechItemSrsPortal provides the portal to the 
       
    15 *               SpeechRecognitionUtility object.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef NSSVASCSPEECHITEMSRSPORTAL_H
       
    22 #define NSSVASCSPEECHITEMSRSPORTAL_H
       
    23 
       
    24 #include <nsssispeechrecognitionutilityobserver.h>
       
    25 #include "nssvassiutilitywrapper.h"
       
    26 
       
    27 #include "nssvascoreconstant.h" 
       
    28 #include "nssvastspeechitemconstant.h"     
       
    29 
       
    30 
       
    31 /**
       
    32 * This class handles accessing the SpeechRecognitionUtility services. 
       
    33 * It allows only one transaction for each SpeechItem object to be in 
       
    34 * progress at any given time. 
       
    35 *
       
    36 *  @lib NssVASApi.lib
       
    37 *  @since 2.8
       
    38 */
       
    39 class CNssSpeechItemSrsPortal:public CBase
       
    40 {
       
    41   public:
       
    42         
       
    43     /**
       
    44     * Destructor.
       
    45     */
       
    46     ~CNssSpeechItemSrsPortal();
       
    47 
       
    48     /**
       
    49     * Creates CNssSpeechItemSrsPortal.
       
    50     * Get the SpeechRecognitionUtility's engine status ?????
       
    51     * @since 2.0
       
    52     * @param 
       
    53     * @return 
       
    54     */      
       
    55     static CNssSpeechItemSrsPortal* NewL();
       
    56 
       
    57     /**
       
    58     * Creates CNssSpeechItemSrsPortal.
       
    59     * 2 phase construction
       
    60     * @since 2.0
       
    61     * @param 
       
    62     * @return 
       
    63     */      
       
    64     static CNssSpeechItemSrsPortal* NewLC();
       
    65  
       
    66     /**
       
    67     * Requests that the value of the state be changed to Termination state. 
       
    68     * If the counter is zero, the SpeechItemPortal will delete itself.
       
    69     * @since 2.0
       
    70     * @param 
       
    71     * @return 
       
    72     */ 
       
    73     void SetTerminationState();
       
    74 
       
    75     /**
       
    76     * Get training capabilities from SpeechRecognitionUtility object.
       
    77     * @since 2.0
       
    78     * @param 
       
    79     * @return 
       
    80     */      
       
    81     CArrayFixFlat<TNssVasCoreConstant::TNssTrainingCapability>* 
       
    82         GetTrainingCapability();
       
    83 
       
    84     /**
       
    85     * Increment the counter to count the number of created SpeechItem objects.
       
    86     * @since 2.0
       
    87     * @param 
       
    88     * @return 
       
    89     */      
       
    90     void Register();
       
    91 
       
    92     /**
       
    93     * Decrement the counter when SpeechItem objects is destroy.
       
    94     * If the counter is zero and the state is in termination state, 
       
    95     * the portal will destroy the SpeechRecognitionUtility object if exist, 
       
    96     * and it destroys itself.
       
    97     * @since 2.0
       
    98     * @param 
       
    99     * @return 
       
   100     */      
       
   101     void Deregister();
       
   102 
       
   103 
       
   104 
       
   105 	/**
       
   106     * overloaded assignment operator
       
   107     * @param 
       
   108     * @return reference to the CNssSpeechItemSrsPortal
       
   109     */
       
   110     CNssSpeechItemSrsPortal& 
       
   111         operator=(const CNssSpeechItemSrsPortal& aCNssSpeechItemSrsPortal);
       
   112 
       
   113 
       
   114     /**
       
   115     * Return the status of whether the Engine Property Set flag
       
   116     * @param 
       
   117     * @return the status of Engine Property Set flag
       
   118     */
       
   119     TBool IsEnginePropertySet();
       
   120 
       
   121     /**
       
   122     * Return the Maximum Loadable Models from the SRS 
       
   123     * @param - the Model Storage capacity
       
   124     * @param - the Maximum Loadable Models
       
   125     * @return 
       
   126     */
       
   127     void SetEngineProperty(TInt aModelStorageCapacity, TInt aMaxLoadableModels);
       
   128 
       
   129     /**
       
   130     * Return the Model Storage Capacity from the SRS
       
   131     * @param 
       
   132     * @return the Model Storage capacity
       
   133     */
       
   134     TInt ModelStorageCapacity();
       
   135 
       
   136     /**
       
   137     * Return the Maximum Loadable Models from the SRS 
       
   138     * @param 
       
   139     * @return the Maximum Loadable Models
       
   140     */
       
   141     TInt MaxLoadableModels();
       
   142 
       
   143 
       
   144 
       
   145 
       
   146   private: //function
       
   147 
       
   148 
       
   149     /**
       
   150     * C++ constructor.
       
   151     */   
       
   152     CNssSpeechItemSrsPortal();
       
   153 
       
   154 
       
   155   
       
   156   private: //data
       
   157 
       
   158 
       
   159     // The Portal's state
       
   160     TNssSpeechItemConstant::TNssState iState;
       
   161 
       
   162     // Counter to count the total of registered SpeechItem objects 
       
   163     TInt iSpeechItemCounter; 
       
   164 
       
   165     // The SRS's Engine Property has been set flag
       
   166     TBool iEnginePropertySet;
       
   167     
       
   168     // The SRS's ModelStorageCapacity 
       
   169     TInt iModelStorageCapacity;
       
   170 
       
   171     // The SRS's MaxLoadableModels  
       
   172     TInt iMaxLoadableModels;
       
   173 
       
   174 
       
   175 };
       
   176 
       
   177 #endif // NSSVASCSPEECHITEMSRSPORTAL_H
       
   178 
       
   179 // End of file