applicationmanagement/inc/ApplicationManagementClient.h
changeset 47 d316aecb87fd
equal deleted inserted replaced
46:b9b00b134b0d 47:d316aecb87fd
       
     1 /*
       
     2 * Copyright (c) 2000 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: Implementation of applicationmanagement components
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __APPLICATIONMANAGEMENTCLIENT_H__
       
    20 #define __APPLICATIONMANAGEMENTCLIENT_H__
       
    21 
       
    22 // INCLUDES
       
    23 
       
    24 #include <e32std.h>
       
    25 #include "ApplicationManagementCommon.h"
       
    26 #include "ApplicationManagementClientServer.h"
       
    27 #include "ApplicationManagementConst.h"
       
    28 #include <ssl.h>
       
    29 #include <f32file.h>
       
    30 //#include <AknServerApp.h>
       
    31 typedef RArray<TUint32> RElementIdArray;
       
    32 
       
    33 namespace NApplicationManagement
       
    34 	{
       
    35 
       
    36 // CLASS DECLARATION
       
    37 
       
    38 /**
       
    39 *  RApplicationManagement class to establish ApplicationManagement server connection
       
    40 */
       
    41 class RAMTC : public RSessionBase
       
    42 	{
       
    43 		public:
       
    44     /**
       
    45 	* Connect Connects client side to application management server
       
    46     * @return KErrNone Symbian error code
       
    47     */
       
    48 	IMPORT_C TInt Connect();
       
    49 	
       
    50 	
       
    51     /**
       
    52 	* Close Close server connection
       
    53     */
       
    54 	IMPORT_C void Close();
       
    55 
       
    56 	/**
       
    57 	* GetApplicationUidL finds uid for given deployment component.
       
    58 	* @param aInternalId Id of the deployment component, whose uid is wished
       
    59 	* @param aUid	After successful call, will hold the uid
       
    60 	*/	
       
    61 	IMPORT_C void GetApplicationUidL( TInt aInternalId, TUid &aUid );
       
    62 	};
       
    63 	
       
    64 
       
    65 
       
    66 class RApplicationManagement : public RSessionBase
       
    67 	{
       
    68 	public:
       
    69 	    /**
       
    70 		* Connect Connects client side to application management server
       
    71 	    * @return KErrNone Symbian error code
       
    72         */
       
    73 		IMPORT_C TInt Connect( const TCertInfo &aCertInfo );
       
    74 		IMPORT_C TInt Connect( );
       
    75 		
       
    76 	    /**
       
    77 		* Close Close server connection
       
    78         */
       
    79 		IMPORT_C void Close();
       
    80 		
       
    81 	
       
    82 //Session management		
       
    83 	    /**
       
    84 		* DeliverL Add deployment component to the system. At least some parameter
       
    85 		* (in the aInfo or aData) must not be empty.
       
    86 		*
       
    87 		* @param aInfo  TDeploymentComponentInfo containing the essentials of component
       
    88 		* @param aData The Delivery deployment component Data
       
    89 		* @param aInstallOpts Optional install options
       
    90 		* @param aMetaData Optional meta data for install operation
       
    91 	    * @return Created Internal Id for the deployment component
       
    92         */
       
    93 	
       
    94 		/**
       
    95 		* DownloadL Adds deployment component with EDCSDownload to the system. 
       
    96 		* @param aUserId The user id of the component
       
    97 	    * @return Created Internal Id for the deployment component
       
    98         */
       
    99 		IMPORT_C TUint32 DownloadL( const TDCUserId &aUserId ) const;
       
   100 			
       
   101 		IMPORT_C TUint32 DeliverL( const TDCUserId &aUserId ) const;
       
   102 		/**
       
   103 		* DeploymentComponent Returns the deployment component having the given Id.
       
   104 		* If there's no such deployment component, method returns
       
   105 		* KErrNotFound. 
       
   106 		
       
   107 		* @param aId Id of the component to be found
       
   108 	    * @return KErrNone  Symbian error code (KErrNotFound if not found)
       
   109 		*/
       
   110 		IMPORT_C TInt DeploymentComponent( 
       
   111 			TUint32 aInternalId, TDeploymentComponent &aReturnValue ) const;
       
   112 			
       
   113 		/**
       
   114 		* DeploymentComponentUserId Returns the user id of deployment component 
       
   115 		* having the given internal Id.
       
   116 		* @param aId Id of the component to be found
       
   117 		* @param aResponse The buffer in which the user id will be placed
       
   118 	    * @return KErrNone  Symbian error code (KErrNotFound if not found)
       
   119 		*/
       
   120 		IMPORT_C void DeploymentComponentUserIdL( 
       
   121 			TUint32 aInternalId, TDCUserId &aResponse ) const;
       
   122 	
       
   123 		/**
       
   124 		* DeploymentComponentDataL Fetches data for component that's in EDCSDelivered state.
       
   125 		* @param aInternalId Id of the component to be found
       
   126 		* @param aDataType Type of the data to be found. Must be one of EDCInstallOptions
       
   127 		*		EDCMetaData, EDCData, 
       
   128 		* @param aBuffer The buffer that will be filled with the data
       
   129 	    * @return 
       
   130 		*/
       
   131 		IMPORT_C void DeploymentComponentDataL( 
       
   132 			TUint32 aInternalId, TDeplCompAttrType aDataType, CBufBase &aBuffer ) const;
       
   133 			
       
   134 		
       
   135 		/**
       
   136 		* UpdateDeploymentComponentL Updates deployment component.
       
   137 		* @param aInternalId Id of the component to be updated
       
   138 		* @param aItem Type of the data to be updated.
       
   139 		* @param aItemData The data
       
   140 	    * @leave The deployment component, or NULL if there's not one
       
   141 		*/
       
   142 		IMPORT_C void UpdateDeploymentComponentL( TUint32 aInternalId,
       
   143 			TDeplCompAttrType aItem, const TDesC8 &aItemData ) const;
       
   144 		
       
   145 		/**
       
   146 		* UpdateDeploymentComponentL Updates deployment component with mime type too.
       
   147 		* @param aInternalId Id of the component to be updated
       
   148 		* @param aItem Type of the data to be updated. This must be 
       
   149 		*	EDCMetaData or EDCData for call to be successful
       
   150 		* @param aItemData The data
       
   151 		* @param aDataMime The data mime type
       
   152 	    * @leave The deployment component, or NULL if there's not one
       
   153 		*/	
       
   154 		IMPORT_C void UpdateDeploymentComponentDataL( 
       
   155 			TUint32 aInternalId, TDeplCompAttrType aItem, 
       
   156 			const TDesC8 &aItemData, const TDesC8 &aDataMime ) const; 
       
   157 
       
   158 		/**
       
   159 		* UpdateDeploymentComponentStreamedDataL Updates deployment component with mime type too.
       
   160 		* @param aInternalId Id of the component to be updated
       
   161 		* @param aItem Type of the data to be updated. This must be 
       
   162 		*	EDCMetaData or EDCData for call to be successful
       
   163 		* @param aDataMime The data mime type
       
   164 	    * @leave The deployment component, or NULL if there's not one
       
   165 		*/	
       
   166 		IMPORT_C void UpdateDeploymentComponentStreamedDataL( 
       
   167 			TUint32 aInternalId, TDeplCompAttrType aItem, const TDesC8 &aDataMime ) const; 
       
   168 		
       
   169 		/**
       
   170 		* DeploymentComponentIds Returns array of the deployment component Ids, that exist in the
       
   171 		* system. Optionally one can give a TDeploymentComponentState flag to restrict
       
   172 		* resulted ids to those components that has the given state.
       
   173 		* @param aArray Will hold the response
       
   174 		* @param aState Optional state of the wished deployment components
       
   175 	    * @return KErrNone Symbian error code
       
   176 		*/
       
   177 		IMPORT_C TInt DeploymentComponentIdsL(
       
   178 			RElementIdArray &aArray, 
       
   179 			const TDeploymentComponentState aState = EDCSNone  ) const;
       
   180 			
       
   181 		/**
       
   182 		* InstallL Installs given deployment component.
       
   183 		* @param aInternalId The id of deployment component to be installed
       
   184 	    * @param aTargetState Will the installed component be actibve or inactive (default active)
       
   185 		* @return KErrNone Symbian error code
       
   186 		*/
       
   187 		IMPORT_C void InstallL( TUint32 aInternalId , 
       
   188 			TDeploymentComponentState aTargetState = EDCSActive) const;
       
   189 
       
   190 		/**
       
   191 		* RemoveL Removes given deployment component.
       
   192 		* @param aInternalId The id of the component to be removed
       
   193 	    * @return 
       
   194 		*/
       
   195 		IMPORT_C void RemoveL( TUint32 aInternalId ) const;
       
   196 		
       
   197 		/**
       
   198 		* UpdateL Updates the given deployment
       
   199 		* @param aSourceInternalId The id of the component that is source of update
       
   200 		* @param aTargetInternalId The id of the component that is target of update
       
   201 	    * @leave 
       
   202 		*/
       
   203 		IMPORT_C void UpdateL( TUint32 aSourceInternalId, TUint32 aTargetInternalId ) const;
       
   204 		
       
   205 		/**
       
   206 		* StartDownloadL Starts download of deployment component.
       
   207 		* @param aInternalId The id of the component to be downloaded
       
   208 		* @param aTargetState The target state of download (
       
   209 	    * @return 
       
   210 		*/
       
   211 		IMPORT_C void StartDownloadL( TUint32 aInternalId, 
       
   212 			const TDownloadTarget aTarget= EDeliver  ) const;
       
   213 		
       
   214 		
       
   215 	 	/**
       
   216 		* StateChangingDCIds Returns array of the deployment component Ids, that are
       
   217 		* in the state changing list. Currently they are those that are being downloaded.
       
   218 		* @param aArray Will hold the response
       
   219 		
       
   220 	    * @return KErrNone Symbian error code
       
   221 		*/
       
   222 		IMPORT_C TInt StateChangingDCIdsL( RElementIdArray &aArray ) const;
       
   223 		
       
   224 		/**
       
   225 		* StateChangeComplete Informs server that the state of component is updated in the
       
   226 		*	adapter, and that it thus can be removed from the list of state changing objects.
       
   227 		* @param aInternalId The id of the component to be removed from list
       
   228 		*
       
   229 	    * @return KErrNone Symbian error code
       
   230 		*/
       
   231 		IMPORT_C TInt StateChangeComplete( TUint32 aInternalId ) const;
       
   232 		
       
   233 		/**
       
   234 		* ActivateL Tries to activate given deployment component
       
   235 		*	
       
   236 		* @param aInternalId The id of the component to be activated
       
   237 		*/
       
   238 		IMPORT_C void ActivateL( TUint32 aInternalId ) const;
       
   239 		
       
   240 		/**
       
   241 		* DeactivateL Tries to deactivate given deployment component
       
   242 		*	
       
   243 		* @param aInternalId The id of the component to be deactivated
       
   244 		*/
       
   245 		IMPORT_C void DeactivateL( TUint32 aInternalId ) const;
       
   246 		
       
   247 		/**
       
   248 		* DeploymentComponentDataSizeL Get deployment component attribute size
       
   249 		*	
       
   250 		* @param aInternalId The id of the component 
       
   251 		* @param aItem The type of attribute whose size is to be got
       
   252 		* @return The size
       
   253 		*/
       
   254 		IMPORT_C TInt DeploymentComponentDataSizeL( TUint32 aInternalId, 
       
   255 			const TDeplCompAttrType &aItem ) const;
       
   256 
       
   257 		/**
       
   258 		* DeploymentComponentTempInstFile ask file handle from server to be used
       
   259 		*	
       
   260 		* @param aTempFile temporary file handle 
       
   261 		* @param aItem The type of attribute whose type of temporary file to get
       
   262 	    * @return KErrNone Symbian error code
       
   263 		*/
       
   264 		IMPORT_C void DeploymentComponentTempInstFileL( TUint32 aInternalId, RFile& aTempFile, const TDeplCompAttrType &aItem ) const;
       
   265 
       
   266 		/**
       
   267 		 * GetFinalResultsForGAL ask results from AM Server. In response AM 
       
   268          * server returns final result and target URI of node
       
   269          *	
       
   270          * @param aInternalId The id of the component 
       
   271          * @param aFinalResult Final result of deployment component
       
   272          * @param aTargetURI Target URI of deployment component
       
   273          * @return void
       
   274          */
       
   275 		IMPORT_C void GetFinalResultsForGAL(TUint32 aInternalId, TInt& aFinalResult,  TDes8& aTargetURI) const;
       
   276 		
       
   277 		IMPORT_C void GenericAlertSentL(TUint32 aInternalId) const;
       
   278 		
       
   279 		/**
       
   280 		* Implementation of Service UID() from base class. Returns AM service UID 
       
   281 		* to framework
       
   282 		*	
       
   283 		* @return uid of AM service UID
       
   284 		*/	
       
   285 		TUid ServiceUid() const;  
       
   286         /**
       
   287          * CheckStatusNodes Checks all deployed,delivered and download component's status node values
       
   288          * and set the state accordingly. For ex, on first SCOMO session if status node = Download progress
       
   289          * which means that download operation is failed in previous sessiona and hence we need to set the
       
   290          * value of status node to Download failed.
       
   291          *   
       
   292          */
       
   293         IMPORT_C void CheckStatusNodesL( ) const;
       
   294 		  
       
   295 	private:	
       
   296 	};
       
   297 
       
   298 
       
   299 	}
       
   300 
       
   301 #endif //__APPLICATIONMANAGEMENTCLIENT_H__
       
   302 
       
   303 
       
   304 //  End of File