epoc32/include/SyncMLTransportProperties.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     1 /*
     2 * Copyright (c) 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 "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: SyncML Transport properties.
    15 *
    16 */
    17 ///////////////////////////////////////////////////////////////////////////////
    18 // SyncMLTransportProperties.h
    19 //
    20 //
    21 ///////////////////////////////////////////////////////////////////////////////
    22 #ifndef __SYNCMLTRANSPORTPROPERTIES_H__
    23 #define __SYNCMLTRANSPORTPROPERTIES_H__
    24 //
    25 #include <e32base.h>
    26 #include <syncmldef.h>
    27 class RReadStream;
    28 class RWriteStream;
    29 //
    30 
    31 /**
    32 	Data type of a SyncML transport property value.
    33 */
    34 enum TSyncMLTransportPropertyDataType
    35 	{
    36 	/** Narrow text. */
    37 	EDataTypeText8,
    38 	/** Number. */
    39 	EDataTypeNumber,
    40 	/** Boolean. */
    41 	EDataTypeBoolean
    42 	};
    43 
    44 class TSyncMLTransportPropertyInfo
    45 /**	Information about a SyncML transport property.
    46 	@see CSmlTransportPropertiesArray
    47 	@publishedAll
    48 	@released
    49 */
    50 	{
    51 public:
    52 	IMPORT_C void InternalizeL(RReadStream& aStream);
    53 	IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
    54 public:
    55 	/** Property data type. */
    56 	TSyncMLTransportPropertyDataType iDataType;
    57 	/** Property name. */
    58 	TBuf8<KSmlMaxTransportPropertyNameLen> iName;
    59 	};
    60 
    61 
    62 class CSyncMLTransportPropertiesArray : public CBase
    63 /**	An array of SyncML transport property information.
    64 	
    65 	This is used to store information about the properties supported by a transport type.
    66 	@publishedAll
    67 	@released
    68 	@see RSyncMLTransport::Properties() 
    69 */
    70 	{
    71 public:
    72 	/** Information about a property. */
    73 	typedef TSyncMLTransportPropertyInfo TPropertyInfo;
    74 public:
    75 	IMPORT_C CSyncMLTransportPropertiesArray(TInt aGranularity);
    76 	IMPORT_C void InternalizeL(RReadStream&);
    77 	IMPORT_C void ExternalizeL(RWriteStream&) const;
    78 	IMPORT_C TInt AddL(const TPropertyInfo&);
    79 	IMPORT_C void Delete(TInt aIndex);
    80 	IMPORT_C TInt Find(const TDesC8& aPropertyName) const;
    81 	IMPORT_C TInt Count() const;
    82 	IMPORT_C TPropertyInfo& At(TInt aIndex);
    83 	IMPORT_C const TPropertyInfo& At(TInt aIndex) const;
    84 	inline TPropertyInfo& operator[](TInt aIndex);
    85 	inline const TPropertyInfo& operator[](TInt aIndex) const;
    86 private:
    87 	CArrayFixFlat<TPropertyInfo> iElements;
    88 	};
    89 
    90 inline TSyncMLTransportPropertyInfo& CSyncMLTransportPropertiesArray::operator[](TInt aIndex)
    91 /**
    92 Gets the member of the array with the specified index value.
    93 @return	Property value at array index aIndex		
    94 @param aIndex Index value
    95 */
    96 	{ return At(aIndex); }
    97 
    98 inline const TSyncMLTransportPropertyInfo& CSyncMLTransportPropertiesArray::operator[](TInt aIndex) const
    99 /**
   100 Gets the member of the array with the specified index value (const overload).
   101 @return	Property value at array index aIndex		
   102 @param aIndex Index value
   103 */
   104 	{ return At(aIndex); }
   105 
   106 
   107 ///////////////////////////////////////////////////////////////////////////////
   108 ///////////////////////////////////////////////////////////////////////////////
   109 ///////////////////////////////////////////////////////////////////////////////
   110 #endif // __SYNCMLTRANSPORTPROPERTIES_H__