srsf/vcommandexecutor/inc/nssvcapplauncher.h
branchRCL_3
changeset 23 e36f3802f733
parent 0 bf1d17376201
equal deleted inserted replaced
22:cad71a31b7fc 23:e36f3802f733
       
     1 /*
       
     2 * Copyright (c) 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:  Does the application launching of the recognized voice command
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __NSSVCAPPLAUNCHER_H__
       
    20 #define __NSSVCAPPLAUNCHER_H__
       
    21 
       
    22 //  INCLUDES
       
    23 //#include "AppControllerConstants.h"
       
    24 #include "nssvcapplauncher.hrh"
       
    25 #include <e32base.h>
       
    26 #include <e32std.h>
       
    27 #include <apgcli.h>
       
    28 #include <barsc.h>       // RResourceFile
       
    29 
       
    30 #include <remconcoreapicontrollerobserver.h>
       
    31 
       
    32 #include <nssttsutility.h>
       
    33 #include <nssttscommon.h>
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 class RFs;
       
    37 class RResourceFile;
       
    38 
       
    39 // CLASS DECLARATION
       
    40 
       
    41 /**
       
    42 * This is the implementation class for launching applications and initiating profiles.
       
    43 * @lib AppController.lib
       
    44 * @since 3.0
       
    45 */
       
    46 
       
    47 class CNssVCAppLauncher : public CBase, public MTtsClientUtilityObserver, public MRemConCoreApiControllerObserver
       
    48     {
       
    49     public:  // Constructors and destructor
       
    50 
       
    51         /**
       
    52         * Two-phased constructor.
       
    53         */
       
    54         static CNssVCAppLauncher* NewL();
       
    55         
       
    56         /**
       
    57         * Destructor.
       
    58         */
       
    59         virtual ~CNssVCAppLauncher();
       
    60 
       
    61     public: // New functions
       
    62         
       
    63         /**
       
    64         * Checks the id and calls the appropriate function.
       
    65         * @since Averell 2.0
       
    66         * @param aCommandId     ID of command to be executed.
       
    67         * @return TInt          KErrNone if OK, else value indicating error situation.
       
    68         */
       
    69         TInt ExecuteCommandL( TUint aCommandId );
       
    70     
       
    71     public: // Functions from base classes
       
    72         
       
    73         // From MTtsClientUtilityObserver
       
    74         void MapcPlayComplete( TInt aError );
       
    75         
       
    76         // From MTtsClientUtilityObserver
       
    77         void MapcInitComplete( TInt aError,
       
    78                                const TTimeIntervalMicroSeconds& aDuration );
       
    79         
       
    80         // Not implemented
       
    81         void MapcCustomCommandEvent( TInt /*aEvent*/, TInt /*aError*/ ) {};
       
    82                         
       
    83         /** 
       
    84 	    A response has been received. 
       
    85 	    @param aOperationId The operation ID. The response is to a previous 
       
    86 	    command of this type.
       
    87 	    @param The response error.
       
    88 	    */
       
    89 	    void MrccacoResponse( TRemConCoreApiOperationId aOperationId, TInt aError );
       
    90 
       
    91 		
       
    92     private: // Constructors
       
    93 
       
    94         /**
       
    95         * C++ default constructor.
       
    96         */
       
    97         CNssVCAppLauncher();
       
    98 
       
    99         /**
       
   100         * By default Symbian 2nd phase constructor is private.
       
   101         */
       
   102         void ConstructL();
       
   103 
       
   104 	private: // New functions
       
   105 	    
       
   106 	    /**
       
   107         * Launches calendars day view to a selected day.
       
   108         * @since 3.0
       
   109         * @param day Which day will be opened in the wiew:
       
   110                       today | tomorrow | monday | tuesday | ...
       
   111         * @return void
       
   112         */
       
   113         void CalendarDayViewL( const TInt aDay );
       
   114         
       
   115         /**
       
   116         * Launches calendars week view to a selected week.
       
   117         * @since 3.0
       
   118         * @param week Which week will be opened in the wiew:
       
   119                       this week | next week
       
   120         * @return void
       
   121         */
       
   122         void CalendarWeekViewL( const TInt aWeek );
       
   123         
       
   124         /**
       
   125         * Launches calendars month view to a selected month.
       
   126         * @since 3.0
       
   127         * @param month Which month will be opened in the wiew:
       
   128                        this month | next month | january | february | ...
       
   129         * @return void
       
   130         */
       
   131         void CalendarMonthViewL( const TInt aMonth );
       
   132         
       
   133         /**
       
   134         * Opens browser with the user defined homepage.
       
   135         * @since 3.0
       
   136         * @return void
       
   137         */
       
   138         void OpenHomepageL();
       
   139         
       
   140         /**
       
   141         * Activates SMS reader
       
   142         * @since 3.0
       
   143         * @param aAppUid UID for SMS reader
       
   144         * @return
       
   145         */
       
   146         TInt SMSReaderL( const TUid aAppUid );
       
   147         
       
   148         /**
       
   149         * Provides the answer to the voice command "What time is it?"
       
   150         * @since 3.0
       
   151         * @return void
       
   152         */
       
   153         void StatusTimeL();
       
   154         
       
   155         /**
       
   156         * Provides the answer to the voice command "Who is my operator?"
       
   157         * @since 3.0
       
   158         * @return void
       
   159         */
       
   160         void StatusOperatorL();
       
   161         
       
   162         /**
       
   163         * Provides the answer to the voice command "What is the battery strength?"
       
   164         * @since 3.0
       
   165         * @return void
       
   166         */
       
   167         void StatusBatteryL();
       
   168         
       
   169         /**
       
   170         * Provides the answer to the voice command "What is the signal strength?"
       
   171         * @since 3.0
       
   172         * @return void
       
   173         */
       
   174         void StatusSignalL();
       
   175         
       
   176         /**
       
   177         * Performs text to speech answer for a status query.
       
   178         * @since 3.0
       
   179         * @return void
       
   180         */
       
   181         void PlaybackStatusInfoL();
       
   182         
       
   183         /**
       
   184         * Connects to RApaLsSession.
       
   185         * @since 3.0
       
   186         * @return void
       
   187         */  
       
   188         void CreateApaConnectionL();
       
   189 
       
   190         /* Activates an instance of an application.
       
   191         * @since 3.0
       
   192         * @param aUid Application UID
       
   193         * @param aCommandLine Command line parameters.
       
   194         * @return void
       
   195         */
       
   196         void ActivateAppInstanceL( const TUid aUid,
       
   197                                    const TDesC16* aCmdLine = NULL );
       
   198     
       
   199         /**
       
   200         * Used to launch applications. Checks whether an instance of the launched
       
   201         * application is already running.
       
   202         * @since 3.0
       
   203         * @param aUid The Uid of the specific application.
       
   204         * @param aCommandLine Command line parameters.
       
   205         * @param aMultipleInstances If true, the application is activated
       
   206         *        in multiple instances.
       
   207         * @return void
       
   208         */
       
   209         void ActivateAppL( const TUid aUid,
       
   210                            const TDesC16* aCmdLine = NULL,
       
   211                            TBool aMultipleInstances = EFalse );
       
   212         
       
   213         /**
       
   214         * Tells whether it is am or pm.
       
   215         * @since 3.0
       
   216         * @param aTime Current time
       
   217         * @return TTimeOfDay enum value for am or pm is put here
       
   218         */
       
   219         void GetAmOrPmL( const TTime& aTime, TAmPm& aTod );
       
   220         
       
   221         /**
       
   222         * Gets network operator's name.
       
   223         * @since 3.0
       
   224         * @param aOperator The name of the operator will be put here
       
   225         *        if it is found.
       
   226         * @return void
       
   227         */
       
   228         void GetOperatorL( TDesC*& aOperator );
       
   229         
       
   230         /**
       
   231         * Gets the battery strength.
       
   232         * @since 3.0
       
   233         * @param aBattStrength The battery strength will be put here
       
   234         * return void
       
   235         */
       
   236         void GetBatteryStrengthL( TSpokenStatusInfo& aBattStrength );
       
   237         
       
   238         /**
       
   239         * Gets the signal strength.
       
   240         * @since 3.0
       
   241         * @param aSignalStrength The signal strength will be put here
       
   242         * @return void
       
   243         */
       
   244         void GetSignalStrengthL( TSpokenStatusInfo& aSignalStrength );
       
   245         
       
   246         /**
       
   247         * Gets the name of the currently selected TSY.
       
   248         * @since 3.0
       
   249         * @param aTSYName The name of the currently selected TSY will be put
       
   250         *        here.
       
   251         * @return void
       
   252         */
       
   253         void GetTSYNameL( TDes& aTSYName );
       
   254         
       
   255         /**
       
   256         * Executes a media command using Symbian Remote Control FW.
       
   257         * @since 3.0
       
   258         * @param aCommandId The media command to be executed
       
   259         * @return void
       
   260         */
       
   261         void ExecuteMediaCommandL( TUint aMediaCommandId );
       
   262         
       
   263         /*
       
   264         * Gets localized string from the resource file for text-to-speech
       
   265         * status info.
       
   266         * @since 3.0
       
   267         * @param aStringId The string which we want
       
   268         * @param aString Localized string will be put here
       
   269         */
       
   270         void GetLocalizedStringL( TSpokenStatusInfo aStringId, HBufC*& aString );   
       
   271 
       
   272 
       
   273     private:     // Data
       
   274         
       
   275         RApaLsSession*   iApaLsSession;
       
   276 		
       
   277 		// Text to speech stuff
       
   278 		CTtsUtility*     iTts;
       
   279         CTtsParsedText*  iParsedText;
       
   280         TTtsStyle        iStyle;
       
   281         // Answer for a status query
       
   282         HBufC*           iStatusInfo;
       
   283         
       
   284         // Wait loop for TTS callbacks
       
   285         CActiveSchedulerWait iWait;
       
   286     };
       
   287 
       
   288 #endif      // __NSSVCAPPLAUNCHER_H__   
       
   289             
       
   290 // End of File