installationservices/refswinstallationplugin/inc/sifrefinstallerclient.h
branchRCL_3
changeset 25 7333d7932ef7
equal deleted inserted replaced
24:5cc91383ab1e 25:7333d7932ef7
       
     1 /*
       
     2 * Copyright (c) 2008-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 * siftransportclient.h
       
    16 * This file defines the client side of the Reference Installer.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 /**
       
    22  @file
       
    23  @internalComponent
       
    24  exampleCode
       
    25 */
       
    26 
       
    27 #ifndef SIFREFINSTALLERCLIENT_H
       
    28 #define SIFREFINSTALLERCLIENT_H
       
    29 
       
    30 #include <usif/sif/siftransportclient.h>
       
    31 
       
    32 namespace Usif
       
    33 	{
       
    34 	/**
       
    35 	The client side of the Reference Installer. This class uses the SIF Transport to send
       
    36 	software management requests to the Reference Installer Server that resides in a separate
       
    37 	process. The Reference SIF Plug-in is a client of the Reference Installer Server so it
       
    38 	uses this class to connect to the Server process and send SIF requests .
       
    39 	 */
       
    40 	class RSifRefInstallerClient
       
    41 		{
       
    42 	public:
       
    43 		RSifRefInstallerClient();
       
    44 
       
    45 		/**
       
    46 		Connects a client to the Reference Installer Server.
       
    47 		 
       
    48 		@return	Symbian OS error code where KErrNone indicates
       
    49 				success and any other value indicates failure.
       
    50 		*/
       
    51 		TInt Connect();
       
    52 
       
    53 		/**
       
    54 		Disconnects a client from the Reference Installer Server.
       
    55 		*/
       
    56 		void Close();
       
    57 
       
    58 		/**
       
    59 		Returns the details of a component to be installed by file name
       
    60 		
       
    61 		@param aFileName, The file name of a component to be queried
       
    62 		@param aComponentInfo On return, contains the details of a component
       
    63 		@param aStatus The request status. KErrNone, if successful, otherwise
       
    64 		one of the other system-wide or SIF error codes defined in usiferror.h.
       
    65 		*/
       
    66 		void GetComponentInfo(const TDesC& aFileName, CComponentInfo& aComponentInfo, TRequestStatus& aStatus);
       
    67 
       
    68 		/**
       
    69 		Returns the details of a component to be installed by file handle
       
    70 		
       
    71 		@param aFileHandle, The file handle of a component to be queried
       
    72 		@param aComponentInfo On return, contains the details of a component
       
    73 		@param aStatus The request status. KErrNone, if successful, otherwise
       
    74 		one of the other system-wide or SIF error codes defined in usiferror.h.
       
    75 		*/
       
    76 		void GetComponentInfo(RFile& aFileHandle, CComponentInfo& aComponentInfo, TRequestStatus& aStatus);
       
    77 
       
    78 		/**
       
    79 		Installs a component by file name
       
    80 		
       
    81 		@param aFileName The file name of a component to be installed
       
    82 		@param aArguments The array of opaque params for the Reference Installer Server.
       
    83 		An empty array may be passed. The following param is defined for the "SCOMO
       
    84 		Install Inactive" operation:
       
    85 		Name: InstallInactive, Type: Int, Value: ETrue
       
    86 		@param aResults The array of opaque params returned from the Reference Installer
       
    87 		Server.
       
    88 		The following return param is defined for the id of an installed component:
       
    89 		Name: ComponentId, Type: Int
       
    90 		For packages containing embedded components, the returned param contains
       
    91 		the id of the last/most embedded component.
       
    92 		@param aStatus The request status. KErrNone, if successful, otherwise
       
    93 		one of the other system-wide or SIF error codes defined in usiferror.h.
       
    94 		*/
       
    95 		void Install(const TDesC& aFileName, const COpaqueNamedParams& aArguments,
       
    96 								COpaqueNamedParams& aResults, TRequestStatus& aStatus);
       
    97 
       
    98 		/**
       
    99 		Installs a component by file handle
       
   100 		
       
   101 		@param aFileHandle The file handle of a component to be installed
       
   102 		@param aArguments The array of opaque params for the Reference Installer Server.
       
   103 		An empty array may be passed.  The following param is defined for the "SCOMO
       
   104 		Install Inactive" operation:
       
   105 		Name: InstallInactive, Type: Int, Value: ETrue
       
   106 		@param aResults The array of opaque params returned from the Reference Installer
       
   107 		Server.
       
   108 		The following return param is defined for the id of an installed component:
       
   109 		Name: ComponentId, Type: Int
       
   110 		For packages containing embedded components, the returned param contains
       
   111 		the id of the last/most embedded component.
       
   112 		@param aStatus The request status. KErrNone, if successful, otherwise
       
   113 		one of the other system-wide or SIF error codes defined in usiferror.h.
       
   114 		*/
       
   115 		void Install(RFile& aFileHandle, const COpaqueNamedParams& aArguments,
       
   116 								COpaqueNamedParams& aResults, TRequestStatus& aStatus);
       
   117 
       
   118 		/**
       
   119 		Uninstalls a component
       
   120 		
       
   121 		@param aComponentId The id of a component to be uninstalled
       
   122 		@param aArguments The array of opaque params for the Reference Installer
       
   123 		Server. An empty array may be passed.
       
   124 		@param aResults The array of opaque results returned from a SIF plug-in.
       
   125 		@param aStatus The request status. KErrNone, if successful, otherwise
       
   126 		one of the other system-wide or SIF error codes defined in usiferror.h.
       
   127 		*/
       
   128 		void Uninstall(TComponentId aComponentId, const COpaqueNamedParams& aArguments,
       
   129 								COpaqueNamedParams& aResults, TRequestStatus& aStatus);
       
   130 
       
   131 		/**
       
   132 		Activates a component
       
   133 		
       
   134 		@param aComponentId The id of a component to be activated
       
   135 		@param aStatus The request status. KErrNone, if successful, otherwise
       
   136 		one of the other system-wide or SIF error codes defined in usiferror.h.
       
   137 		*/
       
   138 		void Activate(TComponentId aComponentId, TRequestStatus& aStatus);
       
   139 
       
   140 		/**
       
   141 		Deactivates a component
       
   142 		
       
   143 		@param aComponentId The id of a component to be deactivated
       
   144 		@param aStatus The request status. KErrNone, if successful, otherwise
       
   145 		one of the other system-wide or SIF error codes defined in usiferror.h.
       
   146 		*/
       
   147 		void Deactivate(TComponentId aComponentId, TRequestStatus& aStatus);
       
   148 
       
   149 		/**
       
   150 		Cancels an ongoing asynchronous request
       
   151 		
       
   152 		This is a synchronous call. When it returns the original asynchronous call is completed.
       
   153 		*/
       
   154 		void CancelOperation();
       
   155 
       
   156 	private:
       
   157 		RSifRefInstallerClient(const RSifRefInstallerClient&);
       
   158 		RSifRefInstallerClient& operator=(const RSifRefInstallerClient&);
       
   159 
       
   160 		RSifTransportClient iTransporter;
       
   161 		};
       
   162 
       
   163 	} // namespace Usif
       
   164 
       
   165 #endif // SIFREFINSTALLERCLIENT_H