voiceui/vcommand/inc/vcommanduientry.h
branchRCL_3
changeset 19 e36f3802f733
parent 0 bf1d17376201
equal deleted inserted replaced
18:cad71a31b7fc 19:e36f3802f733
       
     1 /*
       
     2 * Copyright (c) 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:  Class to wrap a CVCommand object
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CVCOMMANDUIENTRY_H
       
    20 #define CVCOMMANDUIENTRY_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 class CVCommand;
       
    25 class CVCModel;
       
    26 class CGulIcon;
       
    27 class CVCommandHandler;
       
    28 class MNssPlayEventHandler;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33 * Class to wrap a CVCommand-object for abstraction and for simplified use.
       
    34 */
       
    35 class CVCommandUiEntry : public CBase
       
    36     {
       
    37     public: // Constructor and destructor
       
    38     
       
    39         /**
       
    40         * Two-phased constructor.
       
    41         */
       
    42         static CVCommandUiEntry* NewL( const CVCommand& aCommand );
       
    43 
       
    44         /**
       
    45         * Destructor.
       
    46         */      
       
    47         virtual ~CVCommandUiEntry();
       
    48         
       
    49     public: // New Functions
       
    50 
       
    51         /**
       
    52         * @return Unmodifiable user-specified shortcut for the command
       
    53         *         KNullDesC if none
       
    54         */
       
    55         virtual const TDesC& UserText() const;
       
    56         
       
    57         /**
       
    58         * @return Unmodifiable written text
       
    59         */
       
    60         virtual const TDesC& WrittenText() const;
       
    61         
       
    62         /**
       
    63         * @return the text that the user is expected to pronounce
       
    64         */
       
    65         virtual const TDesC& SpokenText() const;
       
    66         
       
    67         /**
       
    68         * @return the user specified text that the user can pronounce to
       
    69         *         recognize the command. Is always identical to UserText
       
    70         */
       
    71         virtual const TDesC& AlternativeSpokenText() const;
       
    72         
       
    73         /**
       
    74          * Version of the title shown when the folder is displayed in the list
       
    75          * of voice commands
       
    76          */
       
    77         virtual const TDesC& FolderListedName() const;
       
    78         
       
    79         /**
       
    80          * Returns folder title to be shown at the top of the screen
       
    81          */
       
    82         virtual const TDesC& FolderTitle() const;
       
    83         
       
    84         /**
       
    85          * Returns folder title to be shown at the top of the screen
       
    86          */
       
    87         virtual const TDesC& Tooltip() const;
       
    88         
       
    89 	    /**
       
    90         * Creates the command icon.
       
    91         * @return The command icon pushed to the cleanup stack
       
    92         */
       
    93         virtual CGulIcon* IconLC() const;
       
    94         
       
    95 	    /**
       
    96         * Creates an icon for the folder to which this command belongs to.
       
    97 	    * @return Icon for the folder
       
    98 	    */
       
    99         virtual CGulIcon* FolderIconLC() const;
       
   100         
       
   101         /**
       
   102         * Asynchronous
       
   103         * Attempts to play the text expected to be recognized.
       
   104         */
       
   105         virtual void PlaySpokenTextL( CVCommandHandler& aService, 
       
   106             MNssPlayEventHandler& aPlayEventHandler ) const;
       
   107         
       
   108         /**
       
   109         * Asynchronous
       
   110         * Plays the user-specified alternative spoken text.
       
   111         */
       
   112         virtual void PlayAlternativeSpokenTextL( CVCommandHandler& aService,
       
   113             MNssPlayEventHandler& aPlayEventHandler ) const;
       
   114           
       
   115         /**
       
   116         * Cancels playback of a spoken or alternative spoken text
       
   117         * @param aHandler CVCommandHandler where the command is stored
       
   118         */  
       
   119         virtual void CancelPlaybackL( CVCommandHandler& aService ) const;
       
   120         
       
   121         /**
       
   122         * Checks whether this voice command object is equivalent to another one
       
   123         * @param aCommand A voice command to compare
       
   124         * @return TBool
       
   125         */  
       
   126         TBool operator==( const CVCommandUiEntry& aCommand ) const;
       
   127         
       
   128         /**
       
   129         * Utility function for getting the CVCommand-object this class wraps.
       
   130         */
       
   131         const CVCommand& Command() const;
       
   132         
       
   133 	protected:
       
   134 	
       
   135 	    /**
       
   136         * Constructor
       
   137         */
       
   138         CVCommandUiEntry( const CVCommand& aCommand );
       
   139     
       
   140     private: // data
       
   141         const CVCommand& iCommand;
       
   142     };
       
   143 
       
   144 #endif  // CVCOMMANDUIENTRY_H
       
   145 
       
   146 // End of File
       
   147 
       
   148