installationservices/swi/inc/swi/sisuihandler.h
changeset 0 ba25891c3a9e
child 40 f8cf9d484c15
child 44 329d304c1aa1
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2004-2009 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 the License "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 * Definition of the client interface for the UI Support Server
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 /**
       
    21  @file 
       
    22  @internalComponent
       
    23  @released
       
    24 */
       
    25  
       
    26 #ifndef __SISUIHANDLER_H__
       
    27 #define __SISUIHANDLER_H__
       
    28 
       
    29 #include <e32std.h>
       
    30 
       
    31 #include "msisuihandlers.h"
       
    32 #include "appinfo.h"
       
    33 #include "sislogo.h"
       
    34 
       
    35 namespace Swi
       
    36 {
       
    37 class CUissCmd;
       
    38 class CWriteStream;
       
    39 class CProgressBarValuePublisher;
       
    40 
       
    41 /**
       
    42  * RClass which is used to make calls to the UI Support server using
       
    43  * the client-server framework. The ExecuteL() method is passed a
       
    44  * command, in order to display the associated dialog box.
       
    45  */
       
    46 class RUiHandler : public RSessionBase
       
    47 	{
       
    48 public:
       
    49 	/** Open the connection to the UI Support Server*/
       
    50 	IMPORT_C TInt Connect();
       
    51 
       
    52 	/** Close the connection to the UI Support Server*/
       
    53 	IMPORT_C void Close();
       
    54 	
       
    55 	/**
       
    56 	 * Execute a command in order to display a dialog using the
       
    57 	 * UI Support Server.
       
    58 	 */
       
    59 	IMPORT_C void ExecuteL(CUissCmd& aCmd);
       
    60 
       
    61 	/**
       
    62 	 * Helper function to update progress bar
       
    63 	 */
       
    64 	IMPORT_C void UpdateProgressBarL(const TAppInfo& aAppInfo, TInt aAmount);
       
    65 	
       
    66 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
       
    67 	/** Sets a reference to the progress bar value publisher object. The ownership is NOT transferred. */
       
    68 	IMPORT_C void SetProgressBarValuePublisher(CProgressBarValuePublisher* aPublisher);
       
    69 private:
       
    70 	CProgressBarValuePublisher* iPublisher; // Owned by the state machine
       
    71 #endif
       
    72 	};
       
    73 
       
    74 /**
       
    75  * Base class used for client classes, which marshall the arguments in order to make 
       
    76  * a request to the server.  
       
    77  */
       
    78 class CUissCmd : public CBase
       
    79 	{
       
    80 protected:
       
    81 	/** Constructor */
       
    82 	IMPORT_C CUissCmd(TInt aMessage);
       
    83 
       
    84 public:
       
    85 	/** Destructor */
       
    86 	IMPORT_C ~CUissCmd();
       
    87 
       
    88 	/**
       
    89 	 * Override this function in order to unmarshall the arguments,
       
    90 	 * from a TIpcArgs object after the client-server call has
       
    91 	 * been completed.
       
    92 	 *
       
    93 	 */
       
    94 	IMPORT_C virtual void UnmarshallArgumentsL();	
       
    95 	
       
    96 	/**
       
    97 	 * Override this function in order to marshall the arguments,
       
    98 	 * into a TIpcArgs object to pass them to the server. This function will
       
    99 	 * only ever be called once per object instatiation.
       
   100 	 *
       
   101 	 * @param aArguments The IPC arguments for the client-server call. These will be
       
   102 	 *					 set up by this function.
       
   103 	 */
       
   104 	virtual void MarshallArgumentsL(TIpcArgs& aArguments)=0;
       
   105 	
       
   106 	/**
       
   107 	 * Returns the message number which identifies the client-server
       
   108 	 * message associated with this object.
       
   109 	 *
       
   110 	 * @return The message number for the client-server call.
       
   111 	 */
       
   112 	TInt Message() const;
       
   113 	
       
   114 	/**
       
   115 	 * This function is used to get the IPC arguments in order to make
       
   116 	 * the client-server framework call.
       
   117 	 *
       
   118 	 * @return The arguments for the client-server call.
       
   119 	 */
       
   120 	const TIpcArgs& IpcArgsL();
       
   121 private:
       
   122 	TInt iMessage;		///< The message number for the client-server call.
       
   123 	TIpcArgs iIpcArgs; ///< The IPC argumens for the client-server call
       
   124 	TBool iArgumentsMarshalled; ///< Whether the arguments have been marshalled
       
   125 
       
   126 protected:
       
   127 	CWriteStream* iStream; ///< Stream used to stream Ipc Arguments into
       
   128 	TPtrC8 iIpcInputPtr;   
       
   129 	};
       
   130 
       
   131 /** 
       
   132  * Class used to pass a command to shutdown the server to the UI Support
       
   133  * Server.
       
   134  */
       
   135 class CShutdownServer : public CUissCmd
       
   136 	{
       
   137 public:
       
   138 	IMPORT_C static CShutdownServer* NewL();
       
   139 	IMPORT_C static CShutdownServer* NewLC();
       
   140 
       
   141 	void MarshallArgumentsL(TIpcArgs& aArguments);
       
   142 private:
       
   143 	CShutdownServer();
       
   144 	void ConstructL();
       
   145 	};
       
   146 
       
   147 /** 
       
   148  * Class used to pass a command to handle an installation event, to 
       
   149  * the UI Support Server.
       
   150  */
       
   151 class CHandleInstallEvent : public CUissCmd
       
   152 	{
       
   153 public:
       
   154 	IMPORT_C static CHandleInstallEvent* NewL(const TAppInfo& aAppInfo, TInstallEvent aEvent, 
       
   155 						 TInt aValue, const TDesC& aDes);
       
   156 	IMPORT_C static CHandleInstallEvent* NewLC(const TAppInfo& aAppInfo, TInstallEvent aEvent, 
       
   157 						 TInt aValue, const TDesC& aDes);
       
   158 
       
   159 	IMPORT_C TBool ReturnResult() const;
       
   160 
       
   161 	void MarshallArgumentsL(TIpcArgs& aArguments);
       
   162 private:
       
   163 	CHandleInstallEvent(const TAppInfo& aAppInfo, TInstallEvent aEvent, 
       
   164 						 TInt aValue=0, const TDesC& aDes=KNullDesC);
       
   165 
       
   166 	const TAppInfo& iAppInfo;
       
   167 	TInstallEvent iEvent;
       
   168 	TInt iValue;
       
   169 	const TDesC& iDes;
       
   170 
       
   171 	TBool iResult;
       
   172 	TPckg<TBool> iResultPackage;
       
   173 	};
       
   174 
       
   175 /** 
       
   176  * Class used to pass a command to handle a cancellable installation 
       
   177  * event, to the UI Support Server. An example of such an event is a progress 
       
   178  * indication event during installation.
       
   179  */
       
   180 class CHandleCancellableInstallEvent : public CUissCmd
       
   181 	{
       
   182 public:
       
   183 	IMPORT_C static CHandleCancellableInstallEvent* NewL(
       
   184 		const TAppInfo& aAppInfo, TInstallCancellableEvent aEvent, TInt aValue,
       
   185 		const TDesC& aDes);
       
   186 	IMPORT_C static CHandleCancellableInstallEvent* NewLC(
       
   187 		const TAppInfo& aAppInfo, TInstallCancellableEvent aEvent, TInt aValue,
       
   188 		const TDesC& aDes);
       
   189 
       
   190 	void MarshallArgumentsL(TIpcArgs& aArguments);
       
   191 private:
       
   192 	CHandleCancellableInstallEvent(const TAppInfo& aAppInfo, 
       
   193 		TInstallCancellableEvent aEvent, TInt aValue=0, 
       
   194 		const TDesC& aDes=KNullDesC);
       
   195 
       
   196 	const TAppInfo& iAppInfo;
       
   197 	TInstallCancellableEvent iEvent;
       
   198 	TInt iValue;
       
   199 	const TDesC& iDes;
       
   200 	};
       
   201 
       
   202 /** 
       
   203  * Class used to pass a command to display an error dialog, to the UI Support
       
   204  * Server.
       
   205  */
       
   206 class CDisplayError : public CUissCmd
       
   207 	{
       
   208 public:
       
   209 	IMPORT_C static CDisplayError* NewL(const TAppInfo& aAppInfo,
       
   210 				   TErrorDialog aType, const TDesC& aParam);
       
   211 	IMPORT_C static CDisplayError* NewLC(const TAppInfo& aAppInfo,
       
   212 				   TErrorDialog aType, const TDesC& aParam);
       
   213 
       
   214 	void MarshallArgumentsL(TIpcArgs& aArguments);
       
   215 private:
       
   216 	CDisplayError(const TAppInfo& aAppInfo,
       
   217 				   TErrorDialog aType, const TDesC& aParam=KNullDesC);
       
   218 
       
   219 	const TAppInfo& iAppInfo;
       
   220 	TErrorDialog iType;
       
   221 	const TDesC& iParam;
       
   222 	};
       
   223 
       
   224 /** 
       
   225  * Convey that the application is not compatible with the device to the UI support server.
       
   226  */
       
   227 class CDisplayDeviceIncompatibility : public CUissCmd
       
   228 	{
       
   229 public:
       
   230 	IMPORT_C static CDisplayDeviceIncompatibility* NewL(const TAppInfo& aAppInfo);
       
   231 	IMPORT_C static CDisplayDeviceIncompatibility* NewLC(const TAppInfo& aAppInfo);
       
   232 
       
   233 	IMPORT_C TBool ReturnResult() const;
       
   234 
       
   235 	void MarshallArgumentsL(TIpcArgs& aArguments);
       
   236 private:
       
   237 	CDisplayDeviceIncompatibility(const TAppInfo& aAppInfo);
       
   238 
       
   239 	const TAppInfo& iAppInfo;
       
   240 
       
   241 	// return result
       
   242 	TBool iResult;
       
   243 	TPckg<TBool> iResultPackage;
       
   244 	};
       
   245 	
       
   246 /** 
       
   247  * Convey that the application has missing dependencies to the UI support server.
       
   248  */
       
   249 class CDisplayDependencyWarning : public CUissCmd
       
   250 	{
       
   251 public:
       
   252 	IMPORT_C static CDisplayDependencyWarning* NewL(
       
   253 		const TAppInfo& aAppInfo,	const TDesC& aDependencyName,
       
   254 		TBool aWantedFromValid,		const TVersion& aWantedFrom,
       
   255 		TBool aWantedToValid,		const TVersion& aWantedTo,
       
   256 		TBool aAvailableValid,		const TVersion& aAvailable);
       
   257 	IMPORT_C static CDisplayDependencyWarning* NewLC(
       
   258 		const TAppInfo& aAppInfo,	const TDesC& aDependencyName,
       
   259 		TBool aWantedFromValid,		const TVersion& aWantedFrom,
       
   260 		TBool aWantedToValid,		const TVersion& aWantedTo,
       
   261 		TBool aAvailableValid,		const TVersion& aAvailable);
       
   262 
       
   263 	IMPORT_C TBool ReturnResult() const;
       
   264 
       
   265 	void MarshallArgumentsL(TIpcArgs& aArguments);
       
   266 private:
       
   267 	CDisplayDependencyWarning(
       
   268 		const TAppInfo& aAppInfo,	const TDesC& aDependencyName,
       
   269 		TBool aWantedFromValid,		const TVersion& aWantedFrom,
       
   270 		TBool aWantedToValid,		const TVersion& aWantedTo,
       
   271 		TBool aAvailableValid,		const TVersion& aAvailable);
       
   272 
       
   273 	const TAppInfo& iAppInfo;
       
   274 	const TDesC&	iDependencyName;
       
   275 	const TBool		iWantedFromValid;
       
   276 	const TVersion& iWantedFrom;
       
   277 	const TBool		iWantedToValid;
       
   278 	const TVersion& iWantedTo;
       
   279 	const TBool		iAvailableValid;
       
   280 	const TVersion& iAvailable;
       
   281 
       
   282 	// return result
       
   283 	TBool iResult;
       
   284 	TPckg<TBool> iResultPackage;
       
   285 	};
       
   286 
       
   287 /** 
       
   288  * Class used to pass a command to display an error dialog, to the UI Support
       
   289  * Server.
       
   290  */
       
   291 class CDisplayCannotOverwriteFile : public CUissCmd
       
   292 	{
       
   293 public:
       
   294 	IMPORT_C static CDisplayCannotOverwriteFile* NewL(const TAppInfo& aAppInfo,
       
   295 						 const TAppInfo& aInstalledAppInfo,
       
   296 						 const TDesC& aFileName);
       
   297 	IMPORT_C static CDisplayCannotOverwriteFile* NewLC(const TAppInfo& aAppInfo,
       
   298 						 const TAppInfo& aInstalledAppInfo,
       
   299 						 const TDesC& aFileName);
       
   300 
       
   301 	IMPORT_C TBool ReturnResult() const;
       
   302 
       
   303 	void MarshallArgumentsL(TIpcArgs& aArguments);
       
   304 private:
       
   305 	CDisplayCannotOverwriteFile(const TAppInfo& aAppInfo,
       
   306 						 const TAppInfo& aInstalledAppInfo,
       
   307 						 const TDesC& aFileName);
       
   308 
       
   309 	const TAppInfo& iAppInfo;
       
   310 	const TAppInfo& iInstalledAppInfo;
       
   311 	const TDesC& iFileName;
       
   312 
       
   313 	// return result
       
   314 	TBool iResult;
       
   315 	TPckg<TBool> iResultPackage;
       
   316 	};
       
   317 
       
   318 /** 
       
   319  * Class used to pass a command to display a security warning dialog,
       
   320  * to the UI Support Server.
       
   321  */
       
   322 class CDisplaySecurityWarning : public CUissCmd
       
   323 	{
       
   324 public:
       
   325 	/**
       
   326 	 * Constructs a new command object to display security warning dialog
       
   327 	 *
       
   328 	 * @param aAppInfo             Application info from the SIS file
       
   329 	 * @param aSigValidationResult Validation result to pass to dialog
       
   330 	 * @param aPkixResults         Certificate chain validation results 
       
   331 	 * @param aCertificates        End certificates corresponding to the results
       
   332 	 * @param aInstallAnyway       Can the user override the warning?
       
   333 	 *
       
   334 	 * @return New command object
       
   335 	 */
       
   336 	IMPORT_C static CDisplaySecurityWarning* NewL(const TAppInfo& aAppInfo,
       
   337 					     TSignatureValidationResult aSigValidationResult,
       
   338 					     RPointerArray<CPKIXValidationResultBase>& aPkixResults,
       
   339 					     RPointerArray<CCertificateInfo>& aCertificates,
       
   340 					     TBool aInstallAnyway);
       
   341 						  
       
   342 	/**
       
   343 	 * Constructs a new command object to display security warning dialog and 
       
   344 	 * puts it on the cleanup stack 
       
   345 	 *
       
   346 	 * @param aAppInfo             [in] Application info from the SIS file
       
   347 	 * @param aSigValidationResult [in] Validation result to pass to dialog
       
   348 	 * @param aPkixResult          [in] Certificate chain validation result 
       
   349 	 *                             (optional)
       
   350 	 * @param aCertificate         [in] Offending end certificate or NULL
       
   351 	 * @param aInstallAnyway       [in] Can the user override the warning?
       
   352 	 *
       
   353 	 * @return New command object on the cleanup stack
       
   354 	 */
       
   355 	IMPORT_C static CDisplaySecurityWarning* NewLC(const TAppInfo& aAppInfo,
       
   356 					     TSignatureValidationResult aSigValidationResult,
       
   357 					     RPointerArray<CPKIXValidationResultBase>& aPkixResults,
       
   358 					     RPointerArray<CCertificateInfo>& aCertificates,
       
   359 					     TBool aInstallAnyway);
       
   360 
       
   361 	/**
       
   362 	 * Provides result of the dialog
       
   363 	 *
       
   364 	 * @return The result code of the dialog
       
   365 	 */
       
   366 	IMPORT_C TBool ReturnResult() const;
       
   367 
       
   368 	void MarshallArgumentsL(TIpcArgs& aArguments);
       
   369 private:
       
   370 	CDisplaySecurityWarning(const TAppInfo& aAppInfo,
       
   371 					     TSignatureValidationResult aSigValidationResult,
       
   372 					     RPointerArray<CPKIXValidationResultBase>& aPkixResults,
       
   373 					     RPointerArray<CCertificateInfo>& aCertificates,
       
   374 					     TBool aInstallAnyway);
       
   375 
       
   376 	const TAppInfo&                           iAppInfo;
       
   377 	TSignatureValidationResult                iSigValidationResult;
       
   378 	RPointerArray<CPKIXValidationResultBase>& iPkixResults;
       
   379 	RPointerArray<CCertificateInfo>&          iCertificates;
       
   380 	TBool                                     iInstallAnyway;
       
   381 
       
   382 	// return result
       
   383 	TBool        iResult;
       
   384 	TPckg<TBool> iResultPackage;
       
   385 	};
       
   386 
       
   387 /** 
       
   388  * Class used to pass a command to display the initial install dialog,
       
   389  * to the UI Support Server.
       
   390  */
       
   391 class CDisplayInstall : public CUissCmd
       
   392 	{
       
   393 public:
       
   394 	/**
       
   395 	 * Constructs a new command to display the Install dialog.
       
   396 	 *
       
   397 	 * @param aAppInfo      Application info object
       
   398 	 * @param aFs           File sesson that has the logo file open.
       
   399 	 * @param aLogoFile     Logo file handle (can be NULL).
       
   400 	 * @param aCertificates Certificates in the SIS file (the array can be empty
       
   401 	 *                      if the SIS file was not signed)
       
   402 	 *
       
   403 	 * @return New command object to display the Install dialog
       
   404 	 */
       
   405 	IMPORT_C static CDisplayInstall* NewL(const TAppInfo& aAppInfo,
       
   406 		RFs& aFs, RFile* aLogoFile,
       
   407 		const RPointerArray<CCertificateInfo>& aCertificates);
       
   408 				
       
   409 	/**
       
   410 	 * Constructs a new command to display the Install dialog and puts it on the 
       
   411 	 * cleanup stack. 
       
   412 	 *
       
   413 	 * @param aAppInfo      Application info object
       
   414 	 * @param aFs           File sesson that has the logo file open.
       
   415 	 * @param aLogoFile     Optional logo file handle.
       
   416 	 * @param aCertificates Certificates in the SIS file (the array can be empty
       
   417 	 *                      if the SIS file was not signed)
       
   418 	 *
       
   419 	 * @return New command object to display the Install dialog on the 
       
   420 	 *         cleanup stack.
       
   421 	 */
       
   422 	IMPORT_C static CDisplayInstall* NewLC(const TAppInfo& aAppInfo,
       
   423 		RFs& aFs, RFile* aLogoFile,
       
   424 		const RPointerArray<CCertificateInfo>& aCertificates);
       
   425 
       
   426 	IMPORT_C TBool ReturnResult() const;
       
   427 
       
   428 	void MarshallArgumentsL(TIpcArgs& aArguments);
       
   429 	
       
   430 private:
       
   431 	CDisplayInstall(const TAppInfo& aAppInfo, RFs& aFs, RFile* aLogoFile,
       
   432 		const RPointerArray<CCertificateInfo>& aCertificates);
       
   433 
       
   434 	const TAppInfo& iAppInfo; ///< Application information.
       
   435 	RFs& iFs; ///< File session that has the logo file open.
       
   436 	RFile* iLogoFile; ///< Logo data file handle, can be NULL if no logo.
       
   437 	/// End-entity certificates.
       
   438 	const RPointerArray<CCertificateInfo>& iCertificates;
       
   439 	/// Return result.
       
   440 	TBool iResult;
       
   441 	/// Packaged return result.
       
   442 	TPckg<TBool> iResultPackage;
       
   443 	};
       
   444 
       
   445 /** 
       
   446  * Class used to pass a command to display the grant capabilities
       
   447  * dialog, to the UI Support Server.
       
   448  */
       
   449 class CDisplayGrantCapabilities : public CUissCmd
       
   450 	{
       
   451 public:
       
   452 	IMPORT_C static CDisplayGrantCapabilities* NewL(const TAppInfo& aAppInfo, 
       
   453 							const TCapabilitySet& aCapabilitySet);
       
   454 	IMPORT_C static CDisplayGrantCapabilities* NewLC(const TAppInfo& aAppInfo, 
       
   455 							const TCapabilitySet& aCapabilitySet);
       
   456 
       
   457 	IMPORT_C TBool ReturnResult() const;
       
   458 
       
   459 	void MarshallArgumentsL(TIpcArgs& aArguments);
       
   460 private:
       
   461 	CDisplayGrantCapabilities(const TAppInfo& aAppInfo, 
       
   462 							const TCapabilitySet& aCapabilitySet);
       
   463 
       
   464 	const TAppInfo& iAppInfo;
       
   465 	const TCapabilitySet& iCapabilitySet;
       
   466 
       
   467 	// return result
       
   468 	TBool iResult;
       
   469 	TPckg<TBool> iResultPackage;
       
   470 	};
       
   471 	
       
   472 /** 
       
   473  * Class used to pass a command to display the language selection
       
   474  * dialog, to the UI Support Server.
       
   475  */
       
   476 class CDisplayLanguage : public CUissCmd
       
   477 	{
       
   478 public:
       
   479 	IMPORT_C static CDisplayLanguage* NewL(const TAppInfo& aAppInfo, 
       
   480 					      const RArray<TLanguage>& aLanguages);
       
   481 	IMPORT_C static CDisplayLanguage* NewLC(const TAppInfo& aAppInfo, 
       
   482 					      const RArray<TLanguage>& aLanguages);
       
   483 
       
   484 	IMPORT_C TInt ReturnResult() const;
       
   485 
       
   486 	void MarshallArgumentsL(TIpcArgs& aArguments);
       
   487 private:
       
   488 	CDisplayLanguage(const TAppInfo& aAppInfo, 
       
   489 					      const RArray<TLanguage>& aLanguages);
       
   490 
       
   491 	const TAppInfo& iAppInfo;
       
   492 	const RArray<TLanguage>& iLanguages;
       
   493 					      
       
   494 	// return result
       
   495 	TInt iResult;
       
   496 	TPckg<TInt> iResultPackage;
       
   497 	};	
       
   498 
       
   499 /** 
       
   500  * Class used to pass a command to display the drive selection
       
   501  * dialog, to the UI Support Server.
       
   502  */
       
   503 class CDisplayDrive : public CUissCmd
       
   504 	{
       
   505 public:
       
   506 	IMPORT_C static CDisplayDrive* NewL(const TAppInfo& aAppInfo, 
       
   507 					    TInt64 aSize,
       
   508 					    const RArray<TChar>& aDriveLetters,
       
   509 					    const RArray<TInt64>& aDriveSpaces);
       
   510 	IMPORT_C static CDisplayDrive* NewLC(const TAppInfo& aAppInfo, 
       
   511 					    TInt64 aSize,
       
   512 					    const RArray<TChar>& aDriveLetters,
       
   513 					    const RArray<TInt64>& aDriveSpaces);
       
   514 
       
   515 	IMPORT_C TInt ReturnResult() const;
       
   516 
       
   517 	void MarshallArgumentsL(TIpcArgs& aArguments);
       
   518 private:
       
   519 	CDisplayDrive(const TAppInfo& aAppInfo, 
       
   520 					    TInt64 aSize,
       
   521 					    const RArray<TChar>& aDriveLetters,
       
   522 					    const RArray<TInt64>& aDriveSpaces);
       
   523 
       
   524 	const TAppInfo& iAppInfo;
       
   525 	TInt64 iSize;
       
   526 	const RArray<TChar>& iDriveLetters;
       
   527 	const RArray<TInt64>& iDriveSpaces;					      
       
   528 
       
   529 	// return result
       
   530 	TInt iResult;
       
   531 	TPckg<TInt> iResultPackage;
       
   532 	};
       
   533 
       
   534 /** 
       
   535  * Class used to pass a command to display the upgrade dialog,
       
   536  * to the UI Support Server.
       
   537  */
       
   538 class CDisplayUpgrade : public CUissCmd
       
   539 	{
       
   540 public:
       
   541 	IMPORT_C static CDisplayUpgrade* NewL(const TAppInfo& aAppInfo, 
       
   542 					      const TAppInfo& aExistingAppInfo);
       
   543 	IMPORT_C static CDisplayUpgrade* NewLC(const TAppInfo& aAppInfo, 
       
   544 					      const TAppInfo& aExistingAppInfo);
       
   545 
       
   546 	IMPORT_C TBool ReturnResult() const;
       
   547 
       
   548 	void MarshallArgumentsL(TIpcArgs& aArguments);
       
   549 private:
       
   550 	CDisplayUpgrade(const TAppInfo& aAppInfo, 
       
   551 					      const TAppInfo& aExistingAppInfo);
       
   552 
       
   553 	const TAppInfo& iAppInfo;
       
   554 	const TAppInfo& iExistingAppInfo;
       
   555 	
       
   556 	// return result
       
   557 	TBool iResult;
       
   558 	TPckg<TBool> iResultPackage;
       
   559 	};
       
   560 
       
   561 /** 
       
   562  * Class used to pass a command to display a generic question
       
   563  * dialog, to the UI Support Server.
       
   564  */
       
   565 class CDisplayQuestion : public CUissCmd
       
   566 	{
       
   567 public:
       
   568 	IMPORT_C static CDisplayQuestion* NewL(const TAppInfo& aAppInfo, TQuestionDialog aQuestion,
       
   569 										   const TDesC& aDes = KNullDesC);
       
   570 	IMPORT_C static CDisplayQuestion* NewLC(const TAppInfo& aAppInfo, TQuestionDialog aQuestion,
       
   571 										   const TDesC& aDes = KNullDesC);
       
   572 
       
   573 	IMPORT_C TBool ReturnResult() const;
       
   574 
       
   575 	void MarshallArgumentsL(TIpcArgs& aArguments);
       
   576 private:
       
   577 	CDisplayQuestion(const TAppInfo& aAppInfo, TQuestionDialog aQuestion,
       
   578 					 const TDesC& aDes);
       
   579 
       
   580 	const TAppInfo& iAppInfo;
       
   581 	TQuestionDialog iQuestion;
       
   582 	const TDesC& iDes;
       
   583 	
       
   584 	// return result
       
   585 	TBool iResult;
       
   586 	TPckg<TBool> iResultPackage;
       
   587 	};
       
   588 
       
   589 /** 
       
   590  * Class used to pass a command to display the option selection
       
   591  * dialog, to the UI Support Server.
       
   592  */
       
   593 class CDisplayOptions : public CUissCmd
       
   594 	{
       
   595 public:
       
   596 	IMPORT_C static CDisplayOptions* NewL(const TAppInfo& aAppInfo,
       
   597 					      const RPointerArray<TDesC>& aOptions,
       
   598 					      RArray<TBool>& aSelections);
       
   599 	IMPORT_C static CDisplayOptions* NewLC(const TAppInfo& aAppInfo,
       
   600 					      const RPointerArray<TDesC>& aOptions,
       
   601 					      RArray<TBool>& aSelections);
       
   602 
       
   603 	IMPORT_C TBool ReturnResult() const;
       
   604 
       
   605 	void MarshallArgumentsL(TIpcArgs& aArguments);
       
   606 	void UnmarshallArgumentsL();	
       
   607 
       
   608 	~CDisplayOptions();
       
   609 private:
       
   610 	CDisplayOptions(const TAppInfo& aAppInfo,
       
   611 					const RPointerArray<TDesC>& aOptions,
       
   612 					RArray<TBool>& aSelections);
       
   613 
       
   614 	const TAppInfo& iAppInfo;
       
   615 	const RPointerArray<TDesC>& iOptions;
       
   616 	RArray<TBool>& iSelections;
       
   617 	
       
   618 	// vars needed to marshall user selections 
       
   619 	HBufC8* iSelectionsBuffer;
       
   620 	TPtr8*  iSelectionsBufferPtr;
       
   621 					      	
       
   622 	// return result
       
   623 	TBool iResult;
       
   624 	TPckg<TBool> iResultPackage;
       
   625 	};
       
   626 
       
   627 /** 
       
   628  * Class used to pass a command to display the OCSP result dialog to the UI 
       
   629  * Support Server.
       
   630  */
       
   631 class CDisplayOcspResult : public CUissCmd
       
   632 	{
       
   633 public:
       
   634 	/**
       
   635 	 * Constructs a new command object to display OCSP result dialog
       
   636 	 *
       
   637 	 * @param aAppInfo      [in] Application info from SIS file
       
   638 	 * @param aMessage      [in] Dialog message code (see
       
   639 	 *                      TRevocationDialogMessage enum)
       
   640 	 * @param aOutcomes     [in] OCSP outcomes
       
   641 	 * @param aCertificates [in] End certificates
       
   642 	 * @param aWarningOnly  [in] Can the user override the warning and continue?
       
   643 	 *
       
   644 	 * @return A new command object
       
   645 	 */
       
   646 	IMPORT_C static CDisplayOcspResult* NewL(const TAppInfo& aAppInfo,
       
   647 						 TRevocationDialogMessage aMessage, 
       
   648 						 RPointerArray<TOCSPOutcome>& aOutcomes,
       
   649 						 RPointerArray<CCertificateInfo>& aCertificates,
       
   650 						 TBool aWarningOnly);
       
   651 	
       
   652 	/**
       
   653 	 * Constructs a new command object to display OCSP result dialog and puts 
       
   654 	 * it on the cleanup stack
       
   655 	 *
       
   656 	 * @param aAppInfo      [in] Application info from SIS file
       
   657 	 * @param aMessage      [in] Dialog message code (see
       
   658 	 *                      TRevocationDialogMessage enum)
       
   659 	 * @param aOutcomes     [in] OCSP outcomes
       
   660 	 * @param aCertificates [in] End certificates
       
   661 	 * @param aWarningOnly  [in] Can the user override the warning and continue?
       
   662 	 *
       
   663 	 * @return A new command object on the cleanup stack
       
   664 	 */
       
   665 	IMPORT_C static CDisplayOcspResult* NewLC(const TAppInfo& aAppInfo,
       
   666 						 TRevocationDialogMessage aMessage, 
       
   667 						 RPointerArray<TOCSPOutcome>& aOutcomes,
       
   668 						 RPointerArray<CCertificateInfo>& aCertificates,
       
   669 						 TBool aWarningOnly);
       
   670 
       
   671 	/**
       
   672 	 * Provides result of the dialog
       
   673 	 *
       
   674 	 * @return The result code of the dialog
       
   675 	 */
       
   676 	IMPORT_C TBool ReturnResult() const;
       
   677 
       
   678 	void MarshallArgumentsL(TIpcArgs& aArguments);
       
   679 private:
       
   680 	CDisplayOcspResult(const TAppInfo& aAppInfo,
       
   681 						 TRevocationDialogMessage aMessage, 
       
   682 						 RPointerArray<TOCSPOutcome>& aOutcomes,
       
   683 						 RPointerArray<CCertificateInfo>& aCertificates,
       
   684 						 TBool aWarningOnly);
       
   685 
       
   686 	const TAppInfo&                  iAppInfo;
       
   687 	TRevocationDialogMessage         iMessage;
       
   688 	RPointerArray<TOCSPOutcome>&     iOutcomes;
       
   689 	RPointerArray<CCertificateInfo>& iCertificates;
       
   690 	TBool                            iWarningOnly;					      	
       
   691 	
       
   692 	// return result
       
   693 	TBool        iResult;
       
   694 	TPckg<TBool> iResultPackage;
       
   695 	};
       
   696 
       
   697 /** 
       
   698  * Class used to pass a command to display the uninstall
       
   699  * dialog, to the UI Support Server.
       
   700  */
       
   701 class CDisplayUninstall : public CUissCmd
       
   702 	{
       
   703 public:
       
   704 	IMPORT_C static CDisplayUninstall* NewL(const TAppInfo& aAppInfo);
       
   705 	IMPORT_C static CDisplayUninstall* NewLC(const TAppInfo& aAppInfo);
       
   706 
       
   707 	IMPORT_C TBool ReturnResult() const;
       
   708 
       
   709 	void MarshallArgumentsL(TIpcArgs& aArguments);
       
   710 private:
       
   711 	CDisplayUninstall(const TAppInfo& aAppInfo);
       
   712 
       
   713 	const TAppInfo& iAppInfo;
       
   714 	
       
   715 	// return result
       
   716 	TBool iResult;
       
   717 	TPckg<TBool> iResultPackage;
       
   718 	};
       
   719 
       
   720 /** 
       
   721  * Class used to pass a command to display the text
       
   722  * dialog, to the UI Support Server.
       
   723  */
       
   724 class CDisplayText : public CUissCmd
       
   725 	{
       
   726 public:
       
   727 	IMPORT_C static CDisplayText* NewL(const TAppInfo& aAppInfo, 
       
   728 				    TFileTextOption aOption,
       
   729 				    const TDesC8& aText);
       
   730 	IMPORT_C static CDisplayText* NewLC(const TAppInfo& aAppInfo, 
       
   731 				    TFileTextOption aOption,
       
   732 				    const TDesC8& aText);
       
   733 
       
   734 	IMPORT_C TBool ReturnResult() const;
       
   735 
       
   736 	void MarshallArgumentsL(TIpcArgs& aArguments);
       
   737 private:
       
   738 	CDisplayText(const TAppInfo& aAppInfo, 
       
   739 				    TFileTextOption aOption,
       
   740 				    const TDesC8& aText);
       
   741 
       
   742 	const TAppInfo& iAppInfo;
       
   743 	TFileTextOption iOption;
       
   744 	const TDesC8& iText;
       
   745 	
       
   746 	// return result
       
   747 	TBool iResult;
       
   748 	TPckg<TBool> iResultPackage;
       
   749 	};
       
   750 
       
   751 /** 
       
   752  * Class used to pass a command to display the text
       
   753  * dialog, to the UI Support Server.
       
   754  */
       
   755 class CDisplayDependencyBreak : public CUissCmd
       
   756 	{
       
   757 public:
       
   758 	IMPORT_C static CDisplayDependencyBreak* NewL(const TAppInfo& aAppInfo,
       
   759 					      const RPointerArray<TDesC>& aComponents);
       
   760 	IMPORT_C static CDisplayDependencyBreak* NewLC(const TAppInfo& aAppInfo,
       
   761 					      const RPointerArray<TDesC>& aComponents);
       
   762 
       
   763 	IMPORT_C TBool ReturnResult() const;
       
   764 
       
   765 	void MarshallArgumentsL(TIpcArgs& aArguments);
       
   766 private:
       
   767 	CDisplayDependencyBreak(const TAppInfo& aAppInfo,
       
   768 					      const RPointerArray<TDesC>& aComponents);
       
   769 
       
   770 	const TAppInfo& iAppInfo;
       
   771 	const RPointerArray<TDesC>& iComponents;
       
   772 
       
   773 	// return result
       
   774 	TBool iResult;
       
   775 	TPckg<TBool> iResultPackage;
       
   776 	};
       
   777 
       
   778 /** 
       
   779  * Class used to pass a command to display the text
       
   780  * dialog, to the UI Support Server.
       
   781  */
       
   782 class CDisplayApplicationsInUse : public CUissCmd
       
   783 	{
       
   784 public:
       
   785 	IMPORT_C static CDisplayApplicationsInUse* NewL(const TAppInfo& aAppInfo,
       
   786 							  const RPointerArray<TDesC>& aAppNames);
       
   787 	IMPORT_C static CDisplayApplicationsInUse* NewLC(const TAppInfo& aAppInfo,
       
   788 							  const RPointerArray<TDesC>& aAppNames);
       
   789 
       
   790 	IMPORT_C TBool ReturnResult() const;
       
   791 
       
   792 	void MarshallArgumentsL(TIpcArgs& aArguments);
       
   793 private:
       
   794 	CDisplayApplicationsInUse(const TAppInfo& aAppInfo,
       
   795 							  const RPointerArray<TDesC>& aAppNames);
       
   796 
       
   797 	const TAppInfo& iAppInfo;
       
   798 	const RPointerArray<TDesC>& iAppNames;
       
   799 
       
   800 	// return result
       
   801 	TBool iResult;
       
   802 	TPckg<TBool> iResultPackage;
       
   803 	};
       
   804 
       
   805 
       
   806 // inline functions from TAppInfo
       
   807 
       
   808 inline const TDesC& TAppInfo::AppName() const
       
   809 	{
       
   810 	return iAppName ? *iAppName : KNullDesC;
       
   811 	}
       
   812 
       
   813 inline const TDesC& TAppInfo::AppVendor() const
       
   814 	{
       
   815 	return iAppVendor ? *iAppVendor : KNullDesC;
       
   816 	}
       
   817 
       
   818 inline const TVersion& TAppInfo::AppVersion() const
       
   819 	{
       
   820 	return iAppVersion;
       
   821 	}
       
   822 
       
   823 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
       
   824 	NONSHARABLE_CLASS(CProgressBarValuePublisher) : public CBase
       
   825 	/**
       
   826 	 * This class is used to publish the percentage value of the installation progress bar.
       
   827 	 * The progress bar value is published by using a publish&subscribe property. @see Swi::KUidSwiProgressBarValueKey.
       
   828 	 */
       
   829 		{
       
   830 	public:
       
   831 		IMPORT_C static CProgressBarValuePublisher* NewL();
       
   832 		~CProgressBarValuePublisher();
       
   833 		
       
   834 		/** Sets the final value of the installation progress bar. */
       
   835 		IMPORT_C void SetFinalProgressBarValue(TInt aValue);
       
   836 		
       
   837 		/** Updates the value of the progress bar value property by adding the given value to the current value. */
       
   838 		IMPORT_C void UpdateProgressBarValueL(TInt aValue);
       
   839 	
       
   840 	private:
       
   841 		CProgressBarValuePublisher();
       
   842 		void ConstructL();
       
   843 		
       
   844 	private:
       
   845 		TInt iCurrentProgressValue;
       
   846 		TInt iFinalProgressValue;
       
   847 		};
       
   848 #endif
       
   849 
       
   850 } // namespace Swi
       
   851 
       
   852 #endif // #ifndef __SISUIHANDLER_H__