voiceui/voiceuivoicerecognition/inc/vuicresultsstate.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 VUICRESULTSSTATE_H
       
    20 #define VUICRESULTSSTATE_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <cntdef.h> 
       
    24 #include <mccaconnection.h>
       
    25 
       
    26 #include "vuicstate.h"
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 
       
    30 class CNBestListDialog;
       
    31 class CDesC16ArrayFlat;
       
    32 class MNssTag;
       
    33 class MCCAConnection;
       
    34 
       
    35 // CLASS DECLARATION
       
    36 /**
       
    37 * COMMENT
       
    38 */
       
    39 NONSHARABLE_CLASS( CResultsState ) : public CState,
       
    40                                      public MCCAObserver
       
    41 {
       
    42     public:     // Constructors and destructor
       
    43 
       
    44         /**
       
    45         * Symbian two-phased constructor.
       
    46         */
       
    47         static CResultsState* NewL( CDataStorage& aDataStorage, CUiModel& aUiModel );
       
    48 
       
    49         /**
       
    50         * Destructor.
       
    51         */
       
    52         virtual ~CResultsState();
       
    53                                 
       
    54     public:     // New functions
       
    55     
       
    56         /**
       
    57         * Handles received event
       
    58         * @param Event to be handled
       
    59         */
       
    60         virtual void HandleEventL( TInt aEvent );
       
    61         
       
    62         /**
       
    63         * Executes the state functionality
       
    64         */
       
    65         virtual void ExecuteL();
       
    66         
       
    67     public:
       
    68         
       
    69         /**
       
    70         * From MCCAObserver
       
    71         * @see MCCAObserver for more information
       
    72         */
       
    73         void CCASimpleNotifyL( TNotifyType aType, TInt aReason );
       
    74          
       
    75     protected:  // New functions
       
    76         
       
    77         /**
       
    78         * C++ default constructor.
       
    79         */
       
    80         CResultsState( CDataStorage& aDataStorage, CUiModel& aUiModel );
       
    81         
       
    82         /**
       
    83         * Symbian OS 2nd phase constructor.
       
    84         */
       
    85         virtual void ConstructL();
       
    86         
       
    87         /**
       
    88         * Handles timed event
       
    89         */
       
    90         void DoTimedEventL();
       
    91         
       
    92     private:    // Functions        
       
    93         
       
    94         /**
       
    95         * Handles keypress event
       
    96         * @return ETrue if event was handled else EFalse
       
    97         */
       
    98         TBool HandleKeypressL();
       
    99         
       
   100         /**
       
   101         * Plays currently selected name from the n-best list with TTS
       
   102         */
       
   103         void PlaySelectedNameL();
       
   104         
       
   105         /**
       
   106         * Changes options menu commands visibility if necessary
       
   107         */
       
   108         void CheckOptionsCommands();
       
   109         
       
   110         /**
       
   111         * Creates a contact array.
       
   112         */
       
   113         void CreateContactArrayL();
       
   114         
       
   115         /**
       
   116         * Updates contact array.
       
   117         * @return ETrue if array was updated else EFalse
       
   118         */
       
   119         TBool UpdateContactArray();
       
   120         
       
   121         /**
       
   122         * Checks if given tag exists in taglist
       
   123         * @param aTag Tag that is searched
       
   124         * @return ETrue if tag exists else EFalse
       
   125         */
       
   126         TBool CheckIfAlreadyAdded( MNssTag* aTag );
       
   127         
       
   128         /**
       
   129         * Creates new items array. Ownership is transferred to caller.
       
   130         * @return Items array     
       
   131         */
       
   132         CDesC16ArrayFlat* CreateItemsArrayL();
       
   133        
       
   134         /**
       
   135         * Fills buffer with dial tag information
       
   136         * @param aTag Tag containing all needed information
       
   137         * @param aBuffer Buffer to be filled
       
   138         */
       
   139         void FillDialContextBufferL( MNssTag* aTag, TDes& aBuffer );
       
   140         
       
   141         /**
       
   142         * Fills buffer with command tag information
       
   143         * @param aTag Tag containing all needed information
       
   144         * @param aBuffer Buffer to be filled
       
   145         */
       
   146         void FillCommandContextBuffer( MNssTag* aTag, TDes& aBuffer );
       
   147        
       
   148         /**
       
   149         * Gets the right icon for contact
       
   150         * @param aFieldType The type of contacts field
       
   151         * @return Icon type   
       
   152         */
       
   153         TPtrC GetContactIconType( TFieldType aFieldType );
       
   154         
       
   155         /**
       
   156         * Selects currently active tag from n-best list
       
   157         */
       
   158         void SelectTag();
       
   159         
       
   160         /**
       
   161         * Opens phonebook info view of the selected contact
       
   162         */
       
   163         void OpenPhonebookContactL();
       
   164                
       
   165     private:    // Data
       
   166     
       
   167         enum TInternalState
       
   168             {
       
   169             ENotStarted,
       
   170             EStarted,
       
   171             EInitialized,
       
   172             ECompleted
       
   173             };
       
   174     
       
   175         // N-best list dialog
       
   176         CNBestListDialog*           iNBestListDialog;
       
   177         
       
   178         // Stores a keypress event from HandleEventL
       
   179         TInt                        iKeypress;
       
   180         
       
   181         // For handling internal state logics
       
   182         TInternalState              iInternalState;
       
   183                 
       
   184         // For storing copies of tag pointers
       
   185         CArrayPtrFlat<MNssTag>*     iTagList;
       
   186         
       
   187         MCCAConnection*             iConnection;
       
   188     };
       
   189 
       
   190 #endif  // VUICRESULTSSTATE_H
       
   191 
       
   192 // End of File