installationservices/swinstallationfw/inc/sifcommon.h
branchRCL_3
changeset 66 8b7f4e561641
parent 65 7333d7932ef7
child 70 e8965914fac7
equal deleted inserted replaced
65:7333d7932ef7 66:8b7f4e561641
     1 /*
       
     2 * Copyright (c) 2008-2010 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 * This file defines common types for the SIF APIs.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 /**
       
    21  @file
       
    22  @publishedAll
       
    23  @released
       
    24 */
       
    25 
       
    26 #ifndef SIFCOMMON_H
       
    27 #define SIFCOMMON_H
       
    28 
       
    29 #include <ct/rcpointerarray.h>
       
    30 #include <s32strm.h>
       
    31 #include <usif/usifcommon.h>
       
    32 
       
    33 namespace Usif
       
    34     {
       
    35     class MOpaqueParam;
       
    36 
       
    37     /**
       
    38         This enumeration defines the possible values of the status of an installation package. This status
       
    39         can be obtained from a @see CComponentInfo object using the @see CComponentInfo::InstallStatusL()
       
    40         method.
       
    41      */
       
    42     enum TInstallStatus
       
    43         {
       
    44         ENewComponent,                  ///< New installation; the component is not present in the system
       
    45         EUpgrade,                       ///< This is a valid upgrade of an existing component
       
    46         EAlreadyInstalled,              ///< Component with the same version is already installed
       
    47         ENewerVersionAlreadyInstalled,  ///< A newer version of the component is already installed
       
    48         EInvalid                        ///< Package is not valid and cannot be installed, for example,
       
    49                                         ///< it may be an upgrade of an uninstalled component or the
       
    50                                         ///< package may be corrupt
       
    51         };
       
    52 
       
    53     /**
       
    54         This enumeration defines the possible values of the authenticity of an installation package. This authenticity
       
    55         can be obtained from a @see CComponentInfo object using the @see CComponentInfo::Authenticity()
       
    56         method.
       
    57      */
       
    58     enum TAuthenticity
       
    59         {
       
    60         ENotAuthenticated,          ///< Component could not be authenticated by the installer, e.g. unsigned or self-signed
       
    61         EAuthenticated,             ///< Component is authenticated
       
    62         };
       
    63 
       
    64     /**
       
    65         The TSecurityContext class allows SIF plug-ins to verify the capabilities and secure Ids of SIF clients.
       
    66         For example, when a SIF client requests silent installation a SIF plug-in may verify that that the client
       
    67         has the TrustedUI capability.
       
    68      */
       
    69     class TSecurityContext
       
    70         {
       
    71     public:
       
    72         /**
       
    73             Checks if the SIF client has a given capability.
       
    74 
       
    75             @param aCapability The capability to test.
       
    76             @return ETrue if the SIF client has the capability, EFalse otherwise.
       
    77         */
       
    78         IMPORT_C TBool HasCapability(TCapability aCapability) const;
       
    79 
       
    80         /**
       
    81             Checks if the SIF client has a given capability.
       
    82 
       
    83             @param aCapability The capability to test.
       
    84             @leave KErrPermissionDenied If the SIF client does not have the capability.
       
    85         */
       
    86         IMPORT_C void HasCapabilityL(TCapability aCapability) const;
       
    87 
       
    88         /**
       
    89             Returns the secure Id of a SIF client.
       
    90         */
       
    91         IMPORT_C TSecureId SecureId() const;
       
    92 
       
    93     private:
       
    94         friend class CSifTransportRequest;
       
    95         IMPORT_C TSecurityContext(const RMessage2& aMessage);
       
    96 
       
    97         const RMessagePtr2 iMsg;
       
    98         };
       
    99 
       
   100     /**
       
   101         This class provides information about a software package. Returned by RSoftwareInstall::GetComponentInfo()."
       
   102      */
       
   103     class CComponentInfo : public CBase
       
   104         {
       
   105     public:
       
   106 
       
   107         class CApplicationInfo : public CBase
       
   108             {
       
   109         public:
       
   110             IMPORT_C static CApplicationInfo* NewLC(const TUid& aAppUid, const TDesC& aName, const TDesC& aGroupName, const TDesC& aIconFileName);
       
   111             static CApplicationInfo* NewL(RReadStream& aStream);
       
   112             void ExternalizeL(RWriteStream& aStream) const;
       
   113                         
       
   114             IMPORT_C const TUid& AppUid() const;
       
   115             IMPORT_C const TDesC& Name() const;
       
   116             IMPORT_C const TDesC& GroupName() const;
       
   117             IMPORT_C const TDesC& IconFileName() const;                       
       
   118             IMPORT_C virtual ~CApplicationInfo();
       
   119                         
       
   120         private:                  
       
   121             CApplicationInfo();           
       
   122             
       
   123             TUid iAppUid; // Application UID
       
   124             HBufC* iName; // Name of the application
       
   125             HBufC* iGroupName; // Group folder name where the application will be present
       
   126             HBufC* iIconFileName; // Full path of the icon file
       
   127             };
       
   128                
       
   129         class CNode : public CBase
       
   130             {
       
   131         public:
       
   132             /**
       
   133                 Initializes the object with the details of a component.
       
   134 
       
   135                 @param aSoftwareTypeName The name of the software type of a component.
       
   136                 @param aComponentName The name of a component.
       
   137                 @param aVersion The version of a component.
       
   138                 @param aVendor The name of a component vendor.
       
   139                 @param aScomoState The SCOMO state of a component.
       
   140                 @param TInstallStatus The installation status of a component.
       
   141                 @param aComponentId The Id of a component.
       
   142                 @param aGlobalComponentId The global Id of a component.
       
   143                 @param aAuthenticity The authenticity of a component.
       
   144                 @param aUserGrantableCaps User grantable capabilities of a component.
       
   145                 @param aHasExe Whether component has an executable.
       
   146                 @param aIsDriveSelectionRequired Whether drive selection is required or not.
       
   147                 @param aApplications Information of the applications in the package.
       
   148                 @param aChildren Child nodes describing embedded components of a component. This method
       
   149                         passes the ownership of the child nodes to this new node and empties the aChildren array.
       
   150                 However, if the leave occurs the caller must delete the child nodes in the array.
       
   151                 @leave KErrOverflow it the total length of aName, aVersion and aVendor exceeds 512 characters.
       
   152                 @leave Or other system wide error code
       
   153             */
       
   154             IMPORT_C static CNode* NewLC(const TDesC& aSoftwareTypeName, const TDesC& aComponentName,
       
   155                                 const TDesC& aVersion, const TDesC& aVendor, TScomoState aScomoState,
       
   156                                 TInstallStatus aInstallStatus, TComponentId aComponentId,
       
   157                                 const TDesC& aGlobalComponentId, TAuthenticity aAuthenticity,
       
   158                                 const TCapabilitySet& aUserGrantableCaps, TInt aMaxInstalledSize,
       
   159                                 TBool aHasExe, TBool aIsDriveSelectionRequired, 
       
   160                                 RPointerArray<CApplicationInfo>* aApplications = NULL, 
       
   161                                 RPointerArray<CNode>* aChildren = NULL);
       
   162 
       
   163             /**
       
   164                 Adds a child node to this node. This method passes the ownership of the child node
       
   165                 to this node so the caller must pop it from the cleanup stack but not delete.
       
   166 
       
   167                 @return The pointer to the child node to be added.
       
   168                 @leave System wide error code
       
   169             */
       
   170             IMPORT_C void AddChildL(CNode* aChild);
       
   171 
       
   172             /**
       
   173                 Returns the name of software type of a component.
       
   174 
       
   175                 @return The name of the software type of a component.
       
   176                 @leave System wide error code
       
   177             */
       
   178             IMPORT_C const TDesC& SoftwareTypeName() const;
       
   179 
       
   180             /**
       
   181                 Returns the name of a component.
       
   182 
       
   183                 @return The name of a component.
       
   184                 @leave System wide error code
       
   185             */
       
   186             IMPORT_C const TDesC& ComponentName() const;
       
   187 
       
   188             /**
       
   189                 Returns the version of a component.
       
   190 
       
   191                 @return The version of a component.
       
   192                 @leave System wide error code
       
   193             */
       
   194             IMPORT_C const TDesC& Version() const;
       
   195 
       
   196             /**
       
   197                 Returns the name of the component vendor.
       
   198 
       
   199                 @return The name of the component vendor.
       
   200                 @leave System wide error code
       
   201             */
       
   202             IMPORT_C const TDesC& Vendor() const;
       
   203 
       
   204             /**
       
   205                 Returns the SCOMO state of a component. This has meaning only if the installStatus of the component
       
   206                 is not EInvalid or ENewComponent.
       
   207 
       
   208                 @return The SCOMO state of a component.
       
   209                 @leave System wide error code
       
   210             */
       
   211             IMPORT_C TScomoState ScomoState() const;
       
   212 
       
   213             /**
       
   214                 Returns the installation status of a component.
       
   215 
       
   216                 @return The installation status of a component.
       
   217                 @leave System wide error code
       
   218             */
       
   219             IMPORT_C TInstallStatus InstallStatus() const;
       
   220 
       
   221             /**
       
   222                 Returns the Id of a component.
       
   223 
       
   224                 @return The Id of a component.
       
   225                 @leave System wide error code
       
   226             */
       
   227             IMPORT_C TComponentId ComponentId() const;
       
   228 
       
   229             /**
       
   230                 Returns the global Id of a component.
       
   231 
       
   232                 @return The global Id of a component.
       
   233                 @leave System wide error code
       
   234             */
       
   235             IMPORT_C const TDesC& GlobalComponentId() const;
       
   236 
       
   237             /**
       
   238                 Returns the authenticity of a component.
       
   239 
       
   240                 @return The authenticity of a component.
       
   241                 @leave System wide error code
       
   242             */
       
   243             IMPORT_C TAuthenticity Authenticity() const;
       
   244 
       
   245             /**
       
   246                 Returns user capabilities required by a component.
       
   247 
       
   248                 @return The user grantable capabilities.
       
   249                 @leave System wide error code
       
   250             */
       
   251             IMPORT_C const TCapabilitySet& UserGrantableCaps() const;
       
   252 
       
   253             /**
       
   254                 Returns the maximum size of a component after installation.
       
   255 
       
   256                 @return The maximum size of a component.
       
   257                 @leave System wide error code
       
   258             */
       
   259             IMPORT_C TInt MaxInstalledSize() const;
       
   260 
       
   261             /**
       
   262                 Returns the array of CComponentInfo objects for the components embedded
       
   263                 in the component being queried.
       
   264 
       
   265                 @return The array of the embedded CComponentInfo objects.
       
   266                 @leave System wide error code
       
   267             */
       
   268             IMPORT_C const RPointerArray<CNode>& Children() const;
       
   269 
       
   270             /**
       
   271                 Destructor.
       
   272             */
       
   273             IMPORT_C virtual ~CNode();
       
   274             /**
       
   275                 Returns the HasExecutable Flag which indicates whether the
       
   276                 component has an executable.
       
   277 
       
   278                 @return The HasExecutable TBool Flag .
       
   279             */
       
   280             IMPORT_C TBool HasExecutable() const;
       
   281             
       
   282             /**
       
   283             Returns the IsDriveSelectionRequired Flag which indicates whether the
       
   284             drive selection is required or not.
       
   285 
       
   286             @return The IsDriveSelectionRequired TBool Flag .
       
   287             */
       
   288             IMPORT_C TBool DriveSeletionRequired() const;
       
   289             
       
   290             /**
       
   291             Returns the applications in the component being queried.
       
   292 
       
   293             @return The array of the CApplicationInfo objects.
       
   294             @leave System wide error code
       
   295             */
       
   296             IMPORT_C const RPointerArray<CApplicationInfo>& Applications() const;
       
   297 
       
   298         private:
       
   299             friend class CComponentInfo;
       
   300 
       
   301             CNode();
       
   302             CNode& operator=(const CNode& other);
       
   303             CNode(const CNode& other);
       
   304 
       
   305             static CNode* NewL(RReadStream& aStream);
       
   306             void ExternalizeL(RWriteStream& aStream) const;
       
   307 
       
   308             HBufC* iSoftwareTypeName;                           ///< The name of software type of the component
       
   309             HBufC* iComponentName;                              ///< The name of the software component
       
   310             HBufC* iVersion;                                    ///< The Version of the software component 
       
   311             HBufC* iVendor;                                     ///< The of the vendor of the software component
       
   312             HBufC* iGlobalComponentId;                          ///< The global id of the component if already installed
       
   313             TScomoState iScomoState;                            ///< The SCOMO status of the component
       
   314             TInstallStatus iInstallStatus;                      ///< Informs whether the component is already installed or upgradeable
       
   315             TComponentId iComponentId;                          ///< The unique id of the component if already installed
       
   316             TAuthenticity iAuthenticity;                        ///< The authenticity of the component
       
   317             TCapabilitySet iUserGrantableCaps;                  ///< User grantable capabilities required be the component
       
   318             TInt iMaxInstalledSize;                             ///< The maximum size of the component after installation
       
   319             TBool iHasExe;                                      ///< Indicates Whether the component has an executable
       
   320             TBool iIsDriveSelectionRequired;                    ///< Indicates Whether drive selection is required or not.
       
   321             RCPointerArray<CApplicationInfo> iApplications;     ///< The array of application info of the component being queried
       
   322             RCPointerArray<CNode> iChildren;                    ///< The array of components embedded in the component being queried            
       
   323             };
       
   324 
       
   325     public:
       
   326 
       
   327         /**
       
   328             Creates a new instance of the CComponentInfo class.
       
   329 
       
   330             @leave System wide error code
       
   331          */
       
   332         IMPORT_C static CComponentInfo* NewL();
       
   333 
       
   334         /**
       
   335             Creates a new instance of the CComponentInfo class.
       
   336 
       
   337             @leave System wide error code
       
   338          */
       
   339         IMPORT_C static CComponentInfo* NewLC();
       
   340 
       
   341         /**
       
   342             Returns the root node of this CComponentInfo object.
       
   343 
       
   344             @return The root node of this CComponentInfo object.
       
   345             @leave System wide error code
       
   346          */
       
   347         IMPORT_C const CNode& RootNodeL() const;
       
   348 
       
   349         /**
       
   350             Sets a node as the root node of this component info. This method passes the
       
   351             ownership of the root node to this object so the caller must pop it from the
       
   352             cleanup stack but not delete.
       
   353             
       
   354             @return The pointer to the root node to be set.
       
   355             @leave System wide error code
       
   356          */
       
   357         IMPORT_C void SetRootNodeL(CNode* aRootNode);
       
   358 
       
   359         /**
       
   360             Returns the pointer to the root node of this object. The caller takes the ownership
       
   361             of this node and must delete it when no longer needed. After this call the CComponentInfo
       
   362             object doesn't contain a root node. Hence, calling RootNodeL() results in the leave with
       
   363              KErrNotFound.
       
   364             
       
   365             @return The pointer to the root node.
       
   366             @leave System wide error code
       
   367          */
       
   368         IMPORT_C void SetRootNodeAsChildL(CNode& aParentNode);
       
   369 
       
   370         /**
       
   371             Externalises an object of this class to a write stream.
       
   372 
       
   373             @param aStream Stream to which the object should be externalised.
       
   374             @leave System wide error code
       
   375          */
       
   376         IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
       
   377 
       
   378         /**
       
   379             Allocates a buffer for serialized CComponentInfo and registers it in the @see TIpcArgs class.
       
   380             The SIF server serializes a @see CComponentInfo object into this buffer.
       
   381 
       
   382             @param aIpcArgs Arguments to be sent to the SIF Server.
       
   383             @param aIndex An index value that identifies the slot in the array of arguments into which
       
   384             the argument value is to be placed. This must be a value in the range 0 to 3.
       
   385             @leave System wide error code
       
   386         */
       
   387         IMPORT_C void PrepareForIpcL(TIpcArgs& aIpcArgs, TInt aIndex);
       
   388 
       
   389         /**
       
   390             Destructor.
       
   391         */
       
   392         IMPORT_C virtual ~CComponentInfo();
       
   393 
       
   394     private:
       
   395         CComponentInfo();
       
   396         CComponentInfo& operator=(const CComponentInfo& other);
       
   397         CComponentInfo(const CComponentInfo& other);
       
   398 
       
   399         void InternalizeFromExternalBufferL() const;
       
   400         void ConstInternalizeL(RReadStream& aStream) const;
       
   401         void CleanupExternalBuffer() const;
       
   402 
       
   403         CNode* iRootNode;
       
   404 
       
   405         mutable HBufC8* iExternalBuffer;
       
   406         mutable TPtr8 iExternalBufferPtr;
       
   407         mutable TBool iDeferredInternalization;
       
   408 
       
   409         enum
       
   410             {
       
   411             // An arbitrary limit for the length of a single descriptor, for example aComponentName, aVersion or aVendor.
       
   412             KMaxDescriptorLength = 256,
       
   413             // An arbitrary limit for the total length of iSoftwareTypeName, iComponentName, iVersion, iVendor and iGlobalComponentId.
       
   414             KMaxHeapBufLength = 2048,
       
   415             // An arbitrary size of the internal buffer for sending the component info across the process boundary
       
   416             KMaxComponentInfoStreamedSize = 2*KMaxHeapBufLength+6*sizeof(TInt)+sizeof(TInt8),
       
   417             };
       
   418         };
       
   419 
       
   420 
       
   421     /**
       
   422         The COpaqueNamedParams class is a container for integer and string values identified by name.
       
   423 
       
   424         This class is designed for sending opaque params across the process boundary. For example, a SIF
       
   425         client may use it to send custom arguments to the SIF server or receive custom results.
       
   426     */
       
   427     NONSHARABLE_CLASS(COpaqueNamedParams) : public CBase
       
   428         {
       
   429     public:
       
   430         /**
       
   431             Creates a new instance of the COpaqueNamedParams class.
       
   432 
       
   433             @leave System wide error code
       
   434          */
       
   435         IMPORT_C static COpaqueNamedParams* NewL();
       
   436 
       
   437         /**
       
   438             Creates a new instance of the COpaqueNamedParams class.
       
   439 
       
   440             @leave System wide error code
       
   441          */
       
   442         IMPORT_C static COpaqueNamedParams* NewLC();
       
   443 
       
   444         /**
       
   445             Externalises an object of this class to a write stream.
       
   446 
       
   447             @param aStream Stream to which the object should be externalised.
       
   448             @leave System wide error code
       
   449          */
       
   450         IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
       
   451 
       
   452         /**
       
   453             Internalises an object of this class from a read stream.
       
   454 
       
   455             @param aStream Stream from which the object should be internalised.
       
   456             @leave System wide error code
       
   457          */
       
   458         IMPORT_C void InternalizeL(RReadStream& aStream);
       
   459 
       
   460         /**
       
   461             Allocates a buffer and serializes the params of this object into it. The buffer is registered
       
   462             in the @see TIpcArgs class in order to be sent to the SIF Server.
       
   463 
       
   464             @param aIpcArgs Ipc arguments to be sent to the SIF Server.
       
   465             @param aIndex An index value that identifies the slot in the array of arguments into which
       
   466             the argument value is to be placed. This must be a value in the range 0 to 3.
       
   467             @leave System wide error code
       
   468         */
       
   469         IMPORT_C void PrepareArgumentsForIpcL(TIpcArgs& aIpcArgs, TInt aIndex) const;
       
   470 
       
   471         /**
       
   472             Allocates a buffer for serialized opaque results and registers it in the TIpcArgs class.
       
   473             The SIF server serializes opaque results into this buffer.
       
   474 
       
   475             @param aIpcArgs Arguments to be sent to the SIF Server.
       
   476             @param aIndex An index value that identifies the slot in the array of arguments into which
       
   477             the argument value is to be placed. This must be a value in the range 0 to 3.
       
   478             @leave System wide error code
       
   479         */
       
   480         IMPORT_C void PrepareResultsForIpcL(TIpcArgs& aIpcArgs, TInt aIndex);
       
   481 
       
   482         /**
       
   483             Returns the number of the opaque params added to this object.
       
   484             @leave System wide error code
       
   485         */
       
   486         IMPORT_C TInt CountL() const;
       
   487 
       
   488         /**
       
   489             Adds a string param to this object. If a param with the same name already exists it gets overwritten.
       
   490 
       
   491             @param aName The name of the string param to be added.
       
   492             @param aValue The value of the string param to be added.
       
   493             @leave KErrOverflow if the size of the name or value of the string param being added exceeds 128 bytes or
       
   494             the memory allocated for all the params added to this container exceeds 512 bytes.
       
   495             @leave System wide error code
       
   496         */
       
   497         IMPORT_C void AddStringL(const TDesC& aName, const TDesC& aValue);
       
   498         
       
   499         /**
       
   500             Adds a string array param to this object. If a param with the same name already exists it gets overwritten.
       
   501 
       
   502             @param aName The name of the string param to be added.
       
   503             @param aValueArray The array of value string params to be added.
       
   504             @leave KErrOverflow if the size of the name or any value in the string array being added exceeds 128 bytes or
       
   505             the memory allocated for all the params added to this container exceeds 512 bytes.
       
   506             @leave System wide error code.
       
   507         */
       
   508         IMPORT_C void AddStringArrayL(const TDesC& aName, const RPointerArray<HBufC>& aValueArray);        
       
   509 
       
   510         /**
       
   511             Adds an integer param to this object. If a param with the same name already exists it gets overwritten.
       
   512 
       
   513             @param aName The name of the integer param to be added.
       
   514             @param aValue The value of the integer param to be added.
       
   515             @leave KErrOverflow if the size of the name being added exceeds 128 bytes or
       
   516             the memory allocated for all the params added to this container exceeds 512 bytes.
       
   517             @leave System wide error code
       
   518         */
       
   519         IMPORT_C void AddIntL(const TDesC& aName, TInt aValue);
       
   520         
       
   521         /**
       
   522             Adds an integer array param to this object. If a param with the same name already exists it gets overwritten.
       
   523 
       
   524             @param aName The name of the integer param to be added.
       
   525             @param aValueArray The array of value integer params to be added.
       
   526             @leave KErrOverflow if the size of the name being added exceeds 128 bytes or
       
   527             the memory allocated for all the params added to this container exceeds 512 bytes.
       
   528             @leave System wide error code.
       
   529         */
       
   530         IMPORT_C void AddIntArrayL(const TDesC& aName, const RArray<TInt>& aValueArray);
       
   531         
       
   532 
       
   533         /**
       
   534             Returns the list of the names of params added to the object.
       
   535 
       
   536             @param aNames The list of the names of params. The caller is responsible for the instantiation
       
   537             and cleanup of RPointerArray<HBufC>. The caller must also destroy all the elements of aNames added
       
   538             by this method.
       
   539             @leave System wide error code
       
   540         */
       
   541         IMPORT_C void GetNamesL(RPointerArray<HBufC>& aNames) const; 
       
   542 
       
   543         /**
       
   544             Gets a reference to the string param identified by aName.
       
   545 
       
   546             @param aName The name of the string param to be obtained.
       
   547             @return The value of the string param or KNullDesC if not found.
       
   548             @leave System wide error code
       
   549         */
       
   550         IMPORT_C const TDesC& StringByNameL(const TDesC& aName) const;
       
   551         
       
   552         /**
       
   553             Gets a reference to the string array param identified by aName.
       
   554 
       
   555             @param aName The name of the string param to be obtained.
       
   556             @return The string array param.
       
   557             @leave KErrNotFound if aName is not found.
       
   558 			@leave System wide error code.
       
   559         */
       
   560         IMPORT_C const RPointerArray<HBufC>& StringArrayByNameL(const TDesC& aName) const;        
       
   561 
       
   562         /**
       
   563             Returns the integer param identified by aName.
       
   564 
       
   565             @param aName The name of the integer param to be obtained.
       
   566             @param aValue The value of the integer param returned by this method.
       
   567             @return Indicates if the requested param has been found.
       
   568             @leave System wide error code
       
   569         */
       
   570         IMPORT_C TBool GetIntByNameL(const TDesC& aName, TInt& aValue) const;
       
   571 
       
   572         /**
       
   573             Returns the integer param identified by aName.
       
   574 
       
   575             @param aName The name of the integer param to be obtained.
       
   576             @return The value of the integer param.
       
   577             @leave KErrNotFound if not found
       
   578             @leave Or other system-wide error code.
       
   579         */
       
   580         IMPORT_C TInt IntByNameL(const TDesC& aName) const;
       
   581         
       
   582         /**
       
   583             Returns the integer array param identified by aName.
       
   584 
       
   585             @param aName The name of the integer param to be obtained.
       
   586             @return The integer array param.
       
   587             @leave KErrNotFound if aName is not found.
       
   588             @leave Or other system-wide error code.
       
   589         */
       
   590         IMPORT_C const RArray<TInt>& IntArrayByNameL(const TDesC& aName) const;        
       
   591 
       
   592         /**
       
   593             Empties the container and frees all memory allocated to the params.
       
   594         */
       
   595         IMPORT_C void Cleanup();
       
   596 
       
   597         /**
       
   598             Destructor.
       
   599         */
       
   600         IMPORT_C virtual ~COpaqueNamedParams();
       
   601 
       
   602     private:
       
   603         COpaqueNamedParams();
       
   604         COpaqueNamedParams& operator=(const COpaqueNamedParams& other);
       
   605         COpaqueNamedParams(const COpaqueNamedParams& other);
       
   606         
       
   607         void InternalizeFromExternalBufferL() const;
       
   608         void ConstInternalizeL(RReadStream& aStream) const;
       
   609         void ConstCleanup() const;
       
   610         void CleanupExternalBuffer() const;
       
   611         void VerifyExternalizedSizeForNewParamArrayL(TInt aNameSize, TInt aValueSize) const;
       
   612         void VerifyExternalizedSizeForExistingParamArrayL(TInt aOldValueSize, TInt aNewValueSize) const;
       
   613         void AddOpaqueParamL(MOpaqueParam* aItemBase);
       
   614 private:
       
   615         RPointerArray<MOpaqueParam> iParams;
       
   616         
       
   617         mutable HBufC8* iExternalBuffer;
       
   618         mutable TPtr8 iExternalBufferPtr;
       
   619         mutable TBool iDeferredInternalization;
       
   620         mutable TInt iExternalizedSize;
       
   621 
       
   622         };
       
   623 
       
   624 	/**
       
   625         Input Opaque Parameters:
       
   626 
       
   627 		Pre-defined opaque arguments and results:
       
   628 		"InstallInactive" - Yes/No 
       
   629 		If provided in the opaque installation parameters, requests the installation of
       
   630 		a component without activating it. Otherwise, components are activeted after installation by default.
       
   631 		
       
   632 		"InstallSilently" - Yes/No 
       
   633 		If provided in the opaque installation parameters, requests a silent installation,
       
   634 		i.e. one which avoids interaction with the user whenever possible. Please note that this may involve
       
   635 		additional security checks, and is not necessarily supported by all installers.
       
   636 
       
   637 		"Drive" -  Array of TUInt 
       
   638 		Preffered drive in the order of priority with zero index being the highest priority
       
   639 		
       
   640 		"Languages" - Array of TLanguage
       
   641 		List of languages to use
       
   642 		
       
   643 		"OCSPUrl" - TDesC
       
   644 		The OSCP responder's URL
       
   645 
       
   646 		"PerformOCSP" - TSifPolicy
       
   647 		Whether OCSP should be performed or not or Request user
       
   648 
       
   649 		"IgnoreOCSPWarnings" - TSifPolicy
       
   650 		Action in case of OCSP warnings 
       
   651 
       
   652 		"AllowUpgrade" - TSifPolicy
       
   653 		Allow an upgrade (if yes, upgrade of the application) 
       
   654 
       
   655 		"AllowUpgradeData" - TSifPolicy
       
   656 		Whether private data of the application to be retained or removed during the upgrade
       
   657 
       
   658 		"InstallOptionalItems" - TSifPolicy
       
   659 		Install optional items in package 
       
   660 
       
   661 		"AllowUntrusted" - TSifPolicy
       
   662 		Check if installation of untrusted (uncertified) package is allowed 
       
   663 
       
   664 		"GrantCapabilities" - TSifPolicy
       
   665 		Whether to grant user capabilities 
       
   666 
       
   667 		"AllowAppShutdown" - TSifPolicy
       
   668 		Should we silently kill an application if needed 
       
   669 
       
   670 		"AllowAppBreakDependency" - TSifPolicy
       
   671 		Allow uninstall of dependent packages 
       
   672 
       
   673 		"AllowOverwrite" - TSifPolicy
       
   674 		Can files be overwritten 
       
   675 
       
   676 		"PackageInfo" - TSifPolicy
       
   677 		Whether to skip infos 
       
   678 
       
   679 		"AllowDownload" - TSifPolicy
       
   680 		Is it ok to download 
       
   681 
       
   682 		"UserName" - TDesC
       
   683 		UserName for Download request
       
   684 
       
   685 		"Password" - TDesC
       
   686 		Password for Download request
       
   687 
       
   688 		"SourceUrl" - TDesC
       
   689 		SourceUrl or Directory
       
   690 
       
   691 		"IAP" - TInt
       
   692 		Internet Access Point
       
   693 
       
   694 		"SNAP" -  TInt
       
   695 		Service Network Access Point, alternative to passing iap 
       
   696 
       
   697   		"MimeType" -  TDesC
       
   698 		Represents MIME Type to be used during HTTP download
       
   699 
       
   700   		"Charset" -  TDesC
       
   701 		Represents charset to be used during HTTP download 
       
   702 
       
   703 		"AllowIncompatible" -  TSifPolicy
       
   704 		Check if installation of incompatible packages is allowed 
       
   705 
       
   706         
       
   707 
       
   708 		Output Opaque parameters:
       
   709 
       
   710 		"ComponentId" - Array of TUInt
       
   711 		If returned in the custom results, provides the id's of the newly added components
       
   712 		after an install. Please note that not all installers (i.e. SIF Plugins) may support this.
       
   713 		Eg: Includes embedded sis packages component ID's as well for native installer
       
   714 
       
   715 		"ErrCategory" - TInt
       
   716 		If returned in the custom results gives the error category, that is defined by USIF
       
   717 
       
   718 		"ErrCode" - TInt
       
   719 		If returned in the custom results gives one of the USIF error code.
       
   720 		
       
   721 		"ExtendedErrCode" - TInt
       
   722 		If returned in the custom results gives the extended error information, that is specific to 
       
   723 		a software component type.
       
   724 
       
   725 		"ErrMessage" - TDesC
       
   726 		If returned in the custom results gives the localized error message
       
   727 
       
   728 		"ErrMessageDetails" - TDesC
       
   729 		If returned in the custom results gives the localized error message details about error
       
   730 
       
   731 	*/
       
   732 	_LIT(KSifInParam_InstallInactive, "InstallInactive");
       
   733 	_LIT(KSifInParam_InstallSilently, "InstallSilently");
       
   734 	_LIT(KSifInParam_Drive, "Drive");
       
   735 	_LIT(KSifInParam_Languages, "Languages");
       
   736 	_LIT(KSifInParam_OCSPUrl, "OCSPUrl");
       
   737 	_LIT(KSifInParam_PerformOCSP, "PerformOCSP");
       
   738 	_LIT(KSifInParam_IgnoreOCSPWarnings, "IgnoreOCSPWarnings");
       
   739 	_LIT(KSifInParam_AllowUpgrade, "AllowUpgrade");
       
   740 	_LIT(KSifInParam_AllowUpgradeData, "AllowUpgradeData");
       
   741 	_LIT(KSifInParam_InstallOptionalItems, "InstallOptionalItems");
       
   742 	_LIT(KSifInParam_AllowUntrusted, "AllowUntrusted");
       
   743 	_LIT(KSifInParam_GrantCapabilities, "GrantCapabilities");
       
   744 	_LIT(KSifInParam_AllowAppShutdown, "AllowAppShutdown");
       
   745 	_LIT(KSifInParam_AllowAppBreakDependency, "AllowAppBreakDependency");
       
   746 	_LIT(KSifInParam_AllowOverwrite, "AllowOverwrite");
       
   747 	_LIT(KSifInParam_PackageInfo, "PackageInfo");
       
   748 	_LIT(KSifInParam_AllowDownload, "AllowDownload");
       
   749 	_LIT(KSifInParam_UserName, "UserName");
       
   750 	_LIT(KSifInParam_Password, "Password");
       
   751 	_LIT(KSifInParam_SourceUrl, "SourceUrl");
       
   752 	_LIT(KSifInParam_IAP, "IAP");
       
   753 	_LIT(KSifInParam_SNAP, "SNAP");
       
   754 	_LIT(KSifInParam_MimeType, "MimeType");
       
   755 	_LIT(KSifInParam_Charset, "Charset");
       
   756 	_LIT(KSifInParam_AllowIncompatible, "AllowIncompatible");
       
   757 
       
   758 	_LIT(KSifOutParam_ComponentId, "ComponentId");
       
   759 	_LIT(KSifOutParam_ErrCategory, "ErrCategory");
       
   760 	_LIT(KSifOutParam_ErrCode, "ErrCode");
       
   761 	_LIT(KSifOutParam_ExtendedErrCode, "ExtendedErrCode");
       
   762 	_LIT(KSifOutParam_ErrMessage, "ErrMessage");
       
   763 	_LIT(KSifOutParam_ErrMessageDetails, "ErrMessageDetails");
       
   764 
       
   765     /**
       
   766         SIF Server Secure ID
       
   767     
       
   768         Installers should use this id to verify that installation requests come from the SIF Server.
       
   769     */
       
   770     _LIT_SECURE_ID(KSifServerUid,0x10285BCB);
       
   771 
       
   772     } // namespace Usif
       
   773 
       
   774 #endif // USIF_SIF_COMMON_H