installationservices/swi/inc/sisregistrydependency.h
changeset 0 ba25891c3a9e
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 * CSisRegistryDependency declaration
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 /**
       
    21  @file 
       
    22  @released
       
    23  @publishedPartner
       
    24 */
       
    25 
       
    26 #ifndef __SISREGISTRYDEPENDENCY_H__
       
    27 #define __SISREGISTRYDEPENDENCY_H__
       
    28 
       
    29 #include <e32base.h>
       
    30 
       
    31 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
       
    32 #include <usif/scr/scr.h>
       
    33 #include "installtypes.h"
       
    34 #endif
       
    35 
       
    36 namespace Swi
       
    37 {
       
    38 class CSisRegistryDependency;
       
    39 
       
    40 namespace Sis
       
    41 	{
       
    42 	class CDependency;
       
    43 	}
       
    44 
       
    45 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
       
    46 // Forward declare friend functions
       
    47 namespace ScrHelperUtil
       
    48 	{
       
    49 	void WriteToScrL(Usif::RSoftwareComponentRegistry& aScrSession, const TUid& aCompUid, const TDesC& aCompName, Sis::TInstallType aInstallType, CSisRegistryDependency& aRegistryDependency);
       
    50 	void ReadFromScrL(Usif::CVersionedComponentId& aVersionedSupplierCompId, CSisRegistryDependency*& aRegistryDependency);
       
    51 	}
       
    52 #endif
       
    53 
       
    54 class CSisRegistryDependency : public CBase
       
    55 	{
       
    56 public:
       
    57 	/**
       
    58 	 * Creates a new CSisRegistryDependency object based on a Sis::CDependency
       
    59 	 */
       
    60 	IMPORT_C static CSisRegistryDependency* NewL(const Sis::CDependency& aDependency);
       
    61 
       
    62 	/**
       
    63 	 * Creates a new CSisRegistryDependency object on the cleanup stack.
       
    64 	 */
       
    65 	IMPORT_C static CSisRegistryDependency* NewLC(const Sis::CDependency& aDependency);
       
    66 
       
    67 	/**
       
    68 	 * Creates a new CSisRegistryFileDescription from a stream
       
    69 	 */
       
    70 	IMPORT_C static CSisRegistryDependency* NewL(RReadStream& aStream);
       
    71 
       
    72 	/**
       
    73 	 * Creates a new CSisRegistryFileDescription from a stream on the cleanup stack
       
    74 	 */
       
    75 	IMPORT_C static CSisRegistryDependency* NewLC(RReadStream& aStream);
       
    76 	
       
    77 	/**
       
    78 	 * Creates a new CSisRegistryFileDescription from a CSisRegistryDependency object
       
    79 	 */
       
    80 	IMPORT_C static CSisRegistryDependency* NewL(const CSisRegistryDependency& aDependency);
       
    81 
       
    82 	/**
       
    83 	 * Creates a new CSisRegistryFileDescription from a CSisRegistryDependency object and places the created object on the cleanup stack
       
    84 	 */
       
    85 	IMPORT_C static CSisRegistryDependency* NewLC(const CSisRegistryDependency& aDependency);
       
    86 	
       
    87 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
       
    88 	/**
       
    89 	 * Creates a new CSisRegistryFileDescription from a CSisRegistryDependency object
       
    90 	 */
       
    91 	IMPORT_C static CSisRegistryDependency* NewL(const TUid aUid, const TVersion aFromVersion, const TVersion aToVersion);
       
    92 
       
    93 	/**
       
    94 	 * Creates a new CSisRegistryFileDescription from a CSisRegistryDependency object and places the created object on the cleanup stack
       
    95 	 */
       
    96 	IMPORT_C static CSisRegistryDependency* NewLC(const TUid aUid, const TVersion aFromVersion, const TVersion aToVersion);
       
    97 #endif
       
    98 
       
    99 	IMPORT_C void InternalizeL(RReadStream& aStream);
       
   100 	IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
       
   101 
       
   102 	TUid Uid() const;
       
   103 	
       
   104 	TVersion FromVersion() const;
       
   105 	
       
   106 	TVersion ToVersion() const;
       
   107 
       
   108 	IMPORT_C TBool IsCompatible(const TVersion& aVersion) const;
       
   109 
       
   110 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
       
   111 public: // Friend Functions
       
   112 	friend void ScrHelperUtil::WriteToScrL(Usif::RSoftwareComponentRegistry& aScrSession, const TUid& aCompUid, const TDesC& aCompName, Sis::TInstallType aInstallType, CSisRegistryDependency& aRegistryDependency);
       
   113 	friend void ScrHelperUtil::ReadFromScrL(Usif::CVersionedComponentId& aVersionedSupplierCompId, CSisRegistryDependency*& aRegistryDependency);
       
   114 #endif
       
   115 	
       
   116 private:
       
   117 	/**
       
   118 	 * The constructor.
       
   119 	 */
       
   120 	CSisRegistryDependency();
       
   121 
       
   122 	/**
       
   123 	 * The second-phase constructor.
       
   124 	 * @param aDependency The Sis::CDependency dependency object reference argument.
       
   125 	 */
       
   126 	void ConstructL(const Sis::CDependency& aDependency);
       
   127 	
       
   128 	/**
       
   129 	 * The second-phase constructor.
       
   130 	 * @param aDependency The CSisRegistryDependency to read the file description from.
       
   131 	 */	
       
   132 	void ConstructL(const CSisRegistryDependency& aDependency);
       
   133 
       
   134 	/**
       
   135 	 * The second-phase constructor.
       
   136 	 * @param aStream The stream to read the file description from.
       
   137 	 */
       
   138 	void ConstructL(RReadStream& aStream);
       
   139 	
       
   140 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
       
   141  	void ConstructL(const TUid aUid, const TVersion aFromVersion, const TVersion aToVersion);
       
   142 #endif
       
   143 
       
   144 private:
       
   145 	TUid iUid;
       
   146 	TVersion iFromVersion;
       
   147 	TVersion iToVersion;	
       
   148 	};
       
   149 
       
   150 // inline functions from CSisRegistryDependency
       
   151 
       
   152 inline TUid CSisRegistryDependency::Uid() const
       
   153 	{
       
   154 	return iUid;
       
   155 	}
       
   156 
       
   157 inline TVersion CSisRegistryDependency::FromVersion() const
       
   158 	{
       
   159 	return iFromVersion;
       
   160 	}
       
   161 
       
   162 inline TVersion CSisRegistryDependency::ToVersion() const
       
   163 	{
       
   164 	return iToVersion;
       
   165 	}
       
   166 	
       
   167 } //namespace Swi
       
   168 #endif
       
   169