installationservices/swi/inc/swi/sisproperties.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 * Definition of the CSISProperties
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 /**
       
    21  @file 
       
    22  @released
       
    23  @internalTechnology
       
    24 */
       
    25 
       
    26 
       
    27 #ifndef __SISPROPERTIES_H__
       
    28 #define __SISPROPERTIES_H__
       
    29 
       
    30 #include <e32base.h>
       
    31 #include "sisfield.h"
       
    32 #include "sislanguage.h"
       
    33 
       
    34 namespace Swi
       
    35 {
       
    36 namespace Sis
       
    37  {
       
    38 
       
    39 class CProperty;
       
    40 class TPtrProvider;
       
    41 
       
    42 /**
       
    43  * This class represents a SISProperties. SISProperties is a 
       
    44  * basic structure found in  files. It is described in SGL.GT0140.045.
       
    45  *
       
    46  * @released
       
    47  * @internalTechnology
       
    48  */
       
    49 class CProperties : public CField
       
    50 	{
       
    51 public:
       
    52 
       
    53 	/**
       
    54 	 * This creates a new CProperties object and places it on the cleanup stack.
       
    55 	 *
       
    56 	 * @param aDataProvider 	 An instance of a MSisDataProvider to read the entity from.
       
    57 	 * @param aTypeReadBehaviour Whether we need to check the sis type or not.
       
    58 	 *
       
    59 	 * @return An instance of CProperties representing the data read.	 	 	 
       
    60 	 */
       
    61 	IMPORT_C static CProperties* NewLC(MSisDataProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour = EReadType);
       
    62 
       
    63 	/**
       
    64 	 * This creates a new CProperties object.
       
    65 	 *
       
    66 	 * @param aDataProvider 	 An instance of a MSisDataProvider to read the entity from.
       
    67 	 * @param aTypeReadBehaviour Whether we need to check the sis type or not.
       
    68 	 *
       
    69 	 * @return An instance of CProperties representing the data read.	 	 	 
       
    70 	 */
       
    71 	IMPORT_C static CProperties* NewL(MSisDataProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour = EReadType);
       
    72 
       
    73 	/**
       
    74 	 * This creates a new CProperties object in place.
       
    75 	 *
       
    76 	 * @param aDataProvider 	 An instance of a TPtrProvider to read the entity from.
       
    77 	 * @param aTypeReadBehaviour Whether we need to check the sis type or not.
       
    78 	 *
       
    79 	 * @return An instance of CProperties representing the data read.	 	 	 
       
    80 	 */
       
    81 
       
    82 	IMPORT_C static CProperties* NewL(TPtrProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour = EReadType);
       
    83 
       
    84 	/**
       
    85 	 * This creates a new CProperties object in place and places it on the cleanup stack.
       
    86 	 *
       
    87 	 * @param aDataProvider 	 An instance of a TPtrProvider to read the entity from.
       
    88 	 * @param aTypeReadBehaviour Whether we need to check the sis type or not.
       
    89 	 *
       
    90 	 * @return An instance of CProperties representing the data read.	 	 	 
       
    91 	 */
       
    92 
       
    93 	IMPORT_C static CProperties* NewLC(TPtrProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour = EReadType);
       
    94 
       
    95 	IMPORT_C virtual ~CProperties();
       
    96 
       
    97 private:
       
    98 
       
    99 	CProperties();
       
   100 
       
   101 	/**
       
   102 	 * The second-phase constructor.
       
   103 	 *
       
   104 	 * @param aDataProvider 	 An instance of a MSisDataProvider to read the entity from.
       
   105 	 * @param aTypeReadBehaviour Whether we need to check the sis type or not.
       
   106 	 *	 
       
   107 	 */
       
   108 	void ConstructL(MSisDataProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour);
       
   109 
       
   110 	/**
       
   111 	 * The second-phase in-place constructor.
       
   112 	 *
       
   113 	 * @param aDataProvider 	 An instance of a MSisDataProvider to read the entity from.
       
   114 	 * @param aTypeReadBehaviour Whether we need to check the sis type or not.
       
   115 	 *	 
       
   116 	 */
       
   117 	
       
   118 	void ConstructL(TPtrProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour);
       
   119 
       
   120 public:
       
   121 
       
   122 	/**
       
   123 	 * This function returns the number of supported options.
       
   124 	 */
       
   125 	inline TInt Count() const;
       
   126 	
       
   127 	/**
       
   128 	 * Accessor for the n-th property
       
   129 	 *
       
   130 	 * @return The n-th property.
       
   131 	 */
       
   132 	inline const CProperty& operator [](TInt n) const;
       
   133 
       
   134 private:
       
   135 
       
   136 	/**
       
   137 	 * The actual list of property objects.
       
   138 	 */
       
   139 	RPointerArray<CProperty> iProperties;
       
   140 	};
       
   141 
       
   142 // inline functions
       
   143 TInt CProperties::Count() const
       
   144 	{
       
   145 	return iProperties.Count();
       
   146 	}
       
   147 
       
   148 const CProperty& CProperties::operator [](TInt n) const
       
   149 	{
       
   150 	return *iProperties[n];
       
   151 	}
       
   152 
       
   153  } // namespace Sis
       
   154 } //namespace Swi
       
   155 
       
   156 #endif