csxhelp/inc/AppLauncherForCSXH.h
branchRCL_3
changeset 17 12f60d9a73b3
parent 16 0d1adf67ec1b
child 18 cbffe13eac63
equal deleted inserted replaced
16:0d1adf67ec1b 17:12f60d9a73b3
     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:  AppLauncherForCSXH class declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef INC_APPLAUNCHERFORCSXH_H_HEADER_INCLUDED_BC03B1F7
       
    20 #define INC_APPLAUNCHERFORCSXH_H_HEADER_INCLUDED_BC03B1F7
       
    21 
       
    22 #include <e32std.h> 
       
    23 #include <apgtask.h> 
       
    24 
       
    25 class TApaTask;
       
    26 
       
    27 const TInt KMaxParamLength = 32;
       
    28 const TInt KMaxVSAPrefix = 32;
       
    29 const TInt KMaxVSAScheme = 88;
       
    30 const TInt KBackSlashLength = 1;
       
    31 /**
       
    32  *  AppLauncherForCSXH 
       
    33  *  This class implements launching applications from help
       
    34  *  @since S60 v3.2
       
    35  */
       
    36 class AppLauncherForCSXH 
       
    37     {
       
    38     public:
       
    39 /** 
       
    40 *  @function NewL
       
    41 *  @since S60 3.2
       
    42 *  Construct a AppLauncherForCSXH 
       
    43 *  and return a pointer to the created object
       
    44 *  @return a AppLauncherForCSXH Pointer 
       
    45 */
       
    46     static AppLauncherForCSXH* NewL();
       
    47     
       
    48 /** 
       
    49 *  @function ~AppLauncherForCSXH
       
    50 *  @since S60 3.2
       
    51 *  Destroy the object and release all memory objects
       
    52 */    
       
    53       ~AppLauncherForCSXH();
       
    54 /** 
       
    55 *  @function LaunchAppL
       
    56 *  @since S60 3.2
       
    57 *  Launches Application
       
    58 *  @param aUrl  - Buffer which contains iformation about Application Uid,MessageId, ViewID 
       
    59 *         aCurrentUrl - Currently displayed file path info
       
    60 *  @return ETrue, if Application Launches Successfully, EFalse otherwise	
       
    61 */      
       
    62       TBool LaunchAppL(const TDesC& aUrl,const TDesC& aCurrentUrl); 
       
    63 /** 
       
    64 *  @function LaunchBrowserNGL
       
    65 *  @since S60 3.2
       
    66 *  Launches BrowserNG Application
       
    67 *  @param aUrl  - external hyperlink info.
       
    68 *  @return ETrue, if Application Launches Successfully, EFalse otherwise	
       
    69 */      
       
    70       void LaunchBrowserNGL(const TDesC& aUrl);     	     	
       
    71     private:
       
    72 
       
    73 /** 
       
    74 *  @function AppLauncherForCSXH
       
    75 *  @since S60 3.2
       
    76 *  Perform the first phase of two phase construction
       
    77 */ 
       
    78      AppLauncherForCSXH();
       
    79      
       
    80 /** 
       
    81 *  @function ConstructL
       
    82 *  @since S60 3.2
       
    83 *  Perform the second phase construction of a legacytopicview object
       
    84 */     
       
    85      void ConstructL();
       
    86 /** 
       
    87 *  @function GetAppLaunchModeL
       
    88 *  @since S60 3.2
       
    89 *  Get the Mode Application Launch Command / View Switch Architecture
       
    90 *  @param 	aUrl  - Buffer which contains iformation about Application Uid,MessageId, ViewID 
       
    91 *   		aCurrentUrl - Currently displayed file path info
       
    92 *  @return  Mode of Launch
       
    93 */    
       
    94       TInt GetAppLaunchModeL(const TDesC& aUrl,const TDesC& aCurrentUrl);       
       
    95 /** 
       
    96 *  @function LaunchApp
       
    97 *  @since S60 3.2
       
    98 *  Launch the Application
       
    99 *  @param 	aUrl  - Buffer which contains iformation about Application Uid,MessageId, ViewID 
       
   100 *   		aVSAMode - Etrue for View Switch Architecture - EFalse for Command Launch
       
   101 *  @return  ETrue, Application Launch Successful, EFalse otherwise
       
   102 */      
       
   103       TBool LaunchApp(const TDesC& aUrl, TBool aVSAMode = ETrue);
       
   104 /** 
       
   105 *  @function LaunchCmdApp
       
   106 *  @since S60 3.2
       
   107 *  Launch the Application 
       
   108 *  @param 	aParamsMode  - ETrue, If Application has to be launched with Message. 
       
   109 *  @return  ETrue, Application Launch Successful, EFalse otherwise
       
   110 */      
       
   111       TBool LaunchCmdApp(TBool aParamsMode = ETrue);
       
   112 /** 
       
   113 *  @function LaunchCmdAppL
       
   114 *  @since S60 3.2
       
   115 *  Launch the Application using Command line APIs with parameters
       
   116 *  @param 	aParamsMode  - ETrue, If Application has to be launched with Message. 
       
   117 *  @return  ETrue, Application Launch Successful, EFalse otherwise
       
   118 */     
       
   119       TBool LaunchCmdAppL(TBool aParamsMode);
       
   120   /** 
       
   121 *  @function GetCmdAppTask
       
   122 *  @since S60 3.2
       
   123 *  Launch the Application using Command line APIs with parameters
       
   124 *  @return  Get the TApaTask of the Launched Application
       
   125 */      
       
   126       TApaTask GetCmdAppTask();
       
   127 /** 
       
   128 *  @function SendMsgToCmdAppTaskL
       
   129 *  @since S60 3.2
       
   130 *  Send the Message to the Launched Application
       
   131 *  @param 	aTask  - TApaTask of the launched Application 
       
   132 */      
       
   133       void SendMsgToCmdAppTaskL(TApaTask &aTask);
       
   134 
       
   135 /** 
       
   136 *  @function HandleFailedAppLauchL
       
   137 *  @since S60 3.2
       
   138 *  Gives Information Note if Application Launch Failed.
       
   139 */      
       
   140       void HandleFailedAppLauchL();
       
   141 
       
   142 /** 
       
   143 *  @function HandleAppLauchFromInternetL
       
   144 *  @since S60 3.2
       
   145 *  Gives Information Note if user try to Launch the application from the external link
       
   146 */      
       
   147       void HandleAppLauchFromInternetL();
       
   148 /** 
       
   149 *  @function CheckAppLaunchFromInternetL
       
   150 *  @since S60 3.2
       
   151 *  Checks wether using is trying to launch the application from  external link
       
   152 *  @param aCurrentMode - VSA / Cmd
       
   153 *		  aCurrentUrl  - Currently displayed file path info
       
   154 */  
       
   155       TInt CheckAppLaunchFromInternetL(TInt aCurrentMode,const TDesC& aCurrentUrl );
       
   156 
       
   157 /** 
       
   158 *  @function CheckMsgParams
       
   159 *  @since S60 3.2
       
   160 *  Checks wether parameters are Valid / Invalid
       
   161 *  @param Buffer which contains iformation about Application Uid,MessageId, ViewID 
       
   162 *  @return EParamsWithMsg / EParamsInvalid / EParamsNoMsg
       
   163 */      
       
   164       TInt CheckMsgParams(const TDesC& aUrl);
       
   165 
       
   166 /** 
       
   167 *  @function CheckMsgParams
       
   168 *  @since S60 3.2
       
   169 *  Copies Uid & View Id into Variables
       
   170 *  @param Buffer which contains information about Application Uid,ViewID 
       
   171 */ 
       
   172       void ExtractTwoParams(const TDesC& aUrl);
       
   173 
       
   174 /** 
       
   175 *  @function ExtractFourParams
       
   176 *  @since S60 3.2
       
   177 *  Copies Uid, View Id, MessageId & Message into Variables
       
   178 *  @param aUrl - Buffer which contains information about Application Uid,ViewID, MessageId &  
       
   179 */ 
       
   180       void ExtractFourParams(const TDesC& aUrl);     
       
   181 /** 
       
   182 *  @function GetUid
       
   183 *  @since S60 3.2
       
   184 *  Coverts Buffer Content to TInt
       
   185 *  @param aUid - Application Uid 
       
   186 *		  aResult - Application Uid	
       
   187 */
       
   188       void GetUid(TPtrC aUid, TInt32 &aResult);       
       
   189 
       
   190 /** 
       
   191 *  @function SendMsgToBrowserNGL
       
   192 *  @since S60 3.2
       
   193 *  Send the Message to the BrowserNG
       
   194 *  @param aUrl - External Hyper Link
       
   195 *  @return ETrue MessageSent Successfully, EFalse otherwise
       
   196 */      
       
   197 	  TBool SendMsgToBrowserNGL(const HBufC* aUrl);		
       
   198 /** 
       
   199 *  @function StartTimer
       
   200 *  @since S60 3.2
       
   201 *  Starts the timer
       
   202 *  @param aCallBack - Callback function for timer
       
   203 */      
       
   204 	  void StartTimer(TCallBack aCallBack);
       
   205 
       
   206 /** 
       
   207 *  @function Timer_Callback_to_TerminateApp
       
   208 *  @since S60 3.2
       
   209 *  Timer callback function
       
   210 *  @param aPtr - AppLauncherForCSXH class pointer
       
   211 *  @return 0
       
   212 */      
       
   213       static TInt Timer_Callback_to_TerminateApp(TAny* aPtr);
       
   214 
       
   215 /** 
       
   216 *  @function SendMsgToApplication
       
   217 *  @since S60 3.2
       
   218 *  SendMessage to BrowserNG Application
       
   219 *  @return 0
       
   220 */     
       
   221       TInt SendMsgToApplication();    		 
       
   222       
       
   223     private:
       
   224 	  CPeriodic* iTimer;
       
   225 	  TInt iCount;
       
   226 	  TBuf<KMaxFileName> iUrl;      
       
   227       TBuf<KMaxParamLength> iParam1;
       
   228       TBuf<KMaxParamLength> iParam2;
       
   229       TBuf<KMaxParamLength> iParam3;
       
   230       TBuf<KMaxParamLength> iParam4;	  
       
   231     };    
       
   232 		
       
   233 
       
   234 #endif /* INC_APPLAUNCHERFORCSXH_H_HEADER_INCLUDED_BC03B1F7 */