voiceui/voiceuivoicerecognition/inc/vuicdatastorage.h
branchRCL_3
changeset 19 e36f3802f733
parent 0 bf1d17376201
equal deleted inserted replaced
18:cad71a31b7fc 19:e36f3802f733
       
     1 /*
       
     2 * Copyright (c) 2006-2007 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:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef VUICDATASTORAGE_H
       
    20 #define VUICDATASTORAGE_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 #include <nssvasapi.h>
       
    26 
       
    27 #include <vuivoicerecogdefs.h>
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CVoiceRecognitionDialogImpl;
       
    31 class CNssRecognitionHandlerBuilder;
       
    32 class MNssRecognitionHandler;
       
    33 class CTonePlayer;
       
    34 class CPropertyHandler;
       
    35 class CTutorial;
       
    36 class CTTSPlayer;
       
    37 class MVasBasePbkHandler;
       
    38 
       
    39 // CONSTANTS
       
    40 
       
    41 const TInt KResetMode = -1;
       
    42 
       
    43 // CLASS DECLARATION
       
    44 /**
       
    45 * COMMENT
       
    46 */
       
    47 NONSHARABLE_CLASS( CDataStorage ) : public CBase
       
    48 {
       
    49     public:     // Constructors and destructor
       
    50 
       
    51         /**
       
    52         * Symbian two-phased constructor.
       
    53         */
       
    54         static CDataStorage* NewL( CVoiceRecognitionDialogImpl* aVoiceRecognitionImpl );
       
    55 
       
    56         /**
       
    57         * Destructor.
       
    58         */
       
    59         virtual ~CDataStorage();
       
    60                                 
       
    61     public:     // New functions
       
    62         
       
    63         /**
       
    64         * Stores recognition handler builder pointer
       
    65         * @param aRecognitionHandlerBuilder Pointer to be stored
       
    66         */
       
    67         void SetRecognitionHandlerBuilder( CNssRecognitionHandlerBuilder* aRecognitionHandlerBuilder );
       
    68         
       
    69         /**
       
    70         * Stores recognition handler pointer
       
    71         * @param aRecognitionHandler Pointer to be stored
       
    72         */
       
    73         void SetRecognitionHandler( MNssRecognitionHandler* aRecognitionHandler );
       
    74         
       
    75         /**
       
    76         * Stores recognition handler builder pointer
       
    77         * @param aRecognitionHandlerBuilder Pointer to be stored
       
    78         */
       
    79         void SetVerificationRecognitionHandlerBuilder( CNssRecognitionHandlerBuilder* aRecognitionHandlerBuilder );
       
    80         
       
    81         /**
       
    82         * Stores recognition handler pointer
       
    83         * @param aRecognitionHandler Pointer to be stored
       
    84         */
       
    85         void SetVerificationRecognitionHandler( MNssRecognitionHandler* aRecognitionHandler );
       
    86                        
       
    87         /**
       
    88         * Stores additional tag list pointer
       
    89         * @param aAdditionalTagList Pointer to be stored
       
    90         */
       
    91         void SetAdditionalTagList( CArrayPtrFlat<MNssTag>* aAdditionalTagList );
       
    92         
       
    93         /**
       
    94         * Stores tag list pointer
       
    95         * @param aTagList Pointer to be stored
       
    96         */
       
    97         void SetCompleteTagList( CArrayPtrFlat<MNssTag>* aCompleteTagList );
       
    98         
       
    99         /**
       
   100         * Stores tag pointer
       
   101         * @param aTag Pointer to be stored
       
   102         * @param aDestroyIfExists Destroys old tag if one exists
       
   103         */
       
   104         void SetTag( MNssTag* aTag, TBool aDestroyIfExists );
       
   105         
       
   106         /**
       
   107         * Stores context pointer
       
   108         * @param aContext Pointer to be stored
       
   109         */
       
   110         void SetContext( MNssContext* aContext );
       
   111         
       
   112         /**
       
   113         * Stores adaptation state
       
   114         * @param aAdaptationEnabled ETrue to enable adaptation, else EFalse
       
   115         */
       
   116         void SetAdaptationEnabled( const TBool aAdaptationEnabled );
       
   117         
       
   118         /**
       
   119         * Stores play duration
       
   120         * @param aPlayDuration Play duration in milliseconds
       
   121         */
       
   122         void SetPlayDuration( const TTimeIntervalMicroSeconds& aPlayDuration );
       
   123         
       
   124         /**
       
   125         * Stores verification mode
       
   126         * @param aMode One of TVuiVerificationMode values or if not given the
       
   127         * value is reseted
       
   128         */
       
   129         void SetVerificationMode( const TInt aMode = KResetMode );
       
   130         
       
   131         /**
       
   132         * Sets verification try count
       
   133         * @param aCount Number of tries left
       
   134         */
       
   135         void SetVerificationTryCount( const TInt aCount );
       
   136         
       
   137         /**
       
   138         * Sets flag if device lock mode is enabled
       
   139         * @param aDeviceLockMode Flag value
       
   140         */
       
   141         void SetDeviceLockMode( const TBool aDeviceLockMode );
       
   142                 
       
   143         /**
       
   144         * Returns RecognitionDialogImpl
       
   145         * @return Pointer to RecognitionDialogImpl object
       
   146         */
       
   147         CVoiceRecognitionDialogImpl* VoiceRecognitionImpl() const;
       
   148         
       
   149         /**
       
   150         * Returns recognition handler builder
       
   151         * @return Pointer to recognition handler builder object
       
   152         */
       
   153         CNssRecognitionHandlerBuilder* RecognitionHandlerBuilder() const;
       
   154         
       
   155         /**
       
   156         * Returns recognition handler
       
   157         * @return Pointer to recognition handler object
       
   158         */
       
   159         MNssRecognitionHandler* RecognitionHandler() const;
       
   160         
       
   161         /**
       
   162         * Returns recognition handler builder
       
   163         * @return Pointer to recognition handler builder object
       
   164         */
       
   165         CNssRecognitionHandlerBuilder* VerificationRecognitionHandlerBuilder() const;
       
   166         
       
   167         /**
       
   168         * Returns recognition handler
       
   169         * @return Pointer to recognition handler object
       
   170         */
       
   171         MNssRecognitionHandler* VerificationRecognitionHandler() const;
       
   172         
       
   173         /**
       
   174         * Returns tone player
       
   175         * @return Pointer to tone player object
       
   176         */
       
   177         CTonePlayer* TonePlayer() const;
       
   178         
       
   179         /**
       
   180         * Returns tts player
       
   181         * @return Pointer to tts player object
       
   182         */
       
   183         CTTSPlayer* TtsPlayer() const;
       
   184         
       
   185         /**
       
   186         * Returns phonebook handler
       
   187         * @return Pointer to phonebook handler object
       
   188         */
       
   189         MVasBasePbkHandler* PbkHandler() const;
       
   190                 
       
   191         /**
       
   192         * Returns accessory button monitor
       
   193         * @return Pointer to accessory button monitor object
       
   194         */
       
   195         CPropertyHandler* AccessoryButtonMonitor() const;   
       
   196         
       
   197         /**
       
   198         * Returns tutorial
       
   199         * @return Pointer to tutorial object
       
   200         */
       
   201         CTutorial* Tutorial() const;
       
   202         
       
   203         /**
       
   204         * Returns additional tag list
       
   205         * @return Pointer to tag list object
       
   206         */
       
   207         CArrayPtrFlat<MNssTag>* AdditionalTagList() const;
       
   208         
       
   209         /**
       
   210         * Returns complete tag list
       
   211         * @return Pointer to tag list object
       
   212         */
       
   213         CArrayPtrFlat<MNssTag>* CompleteTagList() const;
       
   214         
       
   215         /**
       
   216         * Returns tag
       
   217         * @return Pointer to tag object
       
   218         */
       
   219         MNssTag* Tag() const;
       
   220         
       
   221         /**
       
   222         * Returns context 
       
   223         * @return Pointer to context object
       
   224         */
       
   225         MNssContext* Context() const;
       
   226         
       
   227         /**
       
   228         * Returns synthesizer mode
       
   229         * @return Current synthesizer mode, either 0 or 1
       
   230         */
       
   231         TInt SynthesizerMode() const;
       
   232         
       
   233         /**
       
   234         * Returns adaptation state
       
   235         * @return Current adaptation state, either ETrue or EFalse
       
   236         */
       
   237         TBool AdaptationEnabled() const;
       
   238         
       
   239         /**
       
   240         * Returns play duration
       
   241         * @return Play duration in microseconds
       
   242         */
       
   243         TTimeIntervalMicroSeconds PlayDuration() const;
       
   244         
       
   245         /**
       
   246         * Returns verification mode
       
   247         * @return One of TVuiVerificationMode values
       
   248         */
       
   249         TInt VerificationMode() const;
       
   250         
       
   251         /**
       
   252         * Returns verification try count
       
   253         * @return Number of verification tries left
       
   254         */
       
   255         TInt VerificationTryCount() const;
       
   256         
       
   257         /**
       
   258         * Returns if device lock mode is enabled
       
   259         * @return ETrue if device lock mode is enabled else EFalse
       
   260         */
       
   261         TBool DeviceLockMode() const;
       
   262          
       
   263     private:    // Functions
       
   264         
       
   265         /**
       
   266         * C++ default constructor.
       
   267         */
       
   268         CDataStorage( CVoiceRecognitionDialogImpl* aVoiceRecognitionImpl );
       
   269         
       
   270         /**
       
   271         * Symbian OS 2nd phase constructor.
       
   272         */
       
   273         virtual void ConstructL();
       
   274                 
       
   275     private:    // Data
       
   276 
       
   277         // Main storage owner
       
   278         CVoiceRecognitionDialogImpl*        iVoiceRecognitionImpl;
       
   279         
       
   280         // Recognition handler builder
       
   281         CNssRecognitionHandlerBuilder*      iRecognitionHandlerBuilder;
       
   282         
       
   283         // Recognition handler
       
   284         MNssRecognitionHandler*             iRecognitionHandler;
       
   285         
       
   286         // Recognition handler builder
       
   287         CNssRecognitionHandlerBuilder*      iVerificationRecognitionHandlerBuilder;
       
   288         
       
   289         // Recognition handler
       
   290         MNssRecognitionHandler*             iVerificationRecognitionHandler;
       
   291                
       
   292         // For playing tones
       
   293         CTonePlayer*                        iTonePlayer;
       
   294         
       
   295         // For tts playback
       
   296         CTTSPlayer*                         iTtsPlayer;
       
   297         
       
   298         // For phonebook handling
       
   299         MVasBasePbkHandler*                 iPbkHandler;
       
   300         
       
   301         // For handling accessory buttons
       
   302         CPropertyHandler*                   iAccessoryButtonMonitor;
       
   303         
       
   304         // Tutorial
       
   305         CTutorial*                          iTutorial;
       
   306         
       
   307         // Received tag list includes tags for one contact
       
   308         CArrayPtrFlat<MNssTag>*             iAdditionalTagList;
       
   309         
       
   310         // Received tag list includes recognition results
       
   311         CArrayPtrFlat<MNssTag>*             iCompleteTagList;
       
   312         
       
   313         // One tag from tag list
       
   314         MNssTag*                            iTag;
       
   315         
       
   316         // Received context
       
   317         MNssContext*                        iContext;
       
   318         
       
   319         // TTS mode
       
   320         TInt                                iSynthesizerMode;
       
   321         
       
   322         // Adaptation state
       
   323         TBool                               iAdaptationEnabled;
       
   324         
       
   325         // Time of how long playback will take
       
   326         TTimeIntervalMicroSeconds           iPlayDuration;
       
   327         
       
   328         // Automatic/manual/voice confirmation mode
       
   329         TInt                                iVerificationMode;
       
   330         
       
   331         // Number of verification tries left
       
   332         TInt                                iVerificationTryCount;
       
   333         
       
   334         // Device lock mode flag
       
   335         TBool                               iDeviceLockMode;
       
   336 };
       
   337 
       
   338 #endif  // VUICDATASTORAGE_H
       
   339 
       
   340 // End of File