epoc32/include/SyncMLTransportProperties.h
branchSymbian2
changeset 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/SyncMLTransportProperties.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,110 @@
     1.4 +/*
     1.5 +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* 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
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: SyncML Transport properties.
    1.18 +*
    1.19 +*/
    1.20 +///////////////////////////////////////////////////////////////////////////////
    1.21 +// SyncMLTransportProperties.h
    1.22 +//
    1.23 +//
    1.24 +///////////////////////////////////////////////////////////////////////////////
    1.25 +#ifndef __SYNCMLTRANSPORTPROPERTIES_H__
    1.26 +#define __SYNCMLTRANSPORTPROPERTIES_H__
    1.27 +//
    1.28 +#include <e32base.h>
    1.29 +#include <syncmldef.h>
    1.30 +class RReadStream;
    1.31 +class RWriteStream;
    1.32 +//
    1.33 +
    1.34 +/**
    1.35 +	Data type of a SyncML transport property value.
    1.36 +*/
    1.37 +enum TSyncMLTransportPropertyDataType
    1.38 +	{
    1.39 +	/** Narrow text. */
    1.40 +	EDataTypeText8,
    1.41 +	/** Number. */
    1.42 +	EDataTypeNumber,
    1.43 +	/** Boolean. */
    1.44 +	EDataTypeBoolean
    1.45 +	};
    1.46 +
    1.47 +class TSyncMLTransportPropertyInfo
    1.48 +/**	Information about a SyncML transport property.
    1.49 +	@see CSmlTransportPropertiesArray
    1.50 +	@publishedAll
    1.51 +	@released
    1.52 +*/
    1.53 +	{
    1.54 +public:
    1.55 +	IMPORT_C void InternalizeL(RReadStream& aStream);
    1.56 +	IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
    1.57 +public:
    1.58 +	/** Property data type. */
    1.59 +	TSyncMLTransportPropertyDataType iDataType;
    1.60 +	/** Property name. */
    1.61 +	TBuf8<KSmlMaxTransportPropertyNameLen> iName;
    1.62 +	};
    1.63 +
    1.64 +
    1.65 +class CSyncMLTransportPropertiesArray : public CBase
    1.66 +/**	An array of SyncML transport property information.
    1.67 +	
    1.68 +	This is used to store information about the properties supported by a transport type.
    1.69 +	@publishedAll
    1.70 +	@released
    1.71 +	@see RSyncMLTransport::Properties() 
    1.72 +*/
    1.73 +	{
    1.74 +public:
    1.75 +	/** Information about a property. */
    1.76 +	typedef TSyncMLTransportPropertyInfo TPropertyInfo;
    1.77 +public:
    1.78 +	IMPORT_C CSyncMLTransportPropertiesArray(TInt aGranularity);
    1.79 +	IMPORT_C void InternalizeL(RReadStream&);
    1.80 +	IMPORT_C void ExternalizeL(RWriteStream&) const;
    1.81 +	IMPORT_C TInt AddL(const TPropertyInfo&);
    1.82 +	IMPORT_C void Delete(TInt aIndex);
    1.83 +	IMPORT_C TInt Find(const TDesC8& aPropertyName) const;
    1.84 +	IMPORT_C TInt Count() const;
    1.85 +	IMPORT_C TPropertyInfo& At(TInt aIndex);
    1.86 +	IMPORT_C const TPropertyInfo& At(TInt aIndex) const;
    1.87 +	inline TPropertyInfo& operator[](TInt aIndex);
    1.88 +	inline const TPropertyInfo& operator[](TInt aIndex) const;
    1.89 +private:
    1.90 +	CArrayFixFlat<TPropertyInfo> iElements;
    1.91 +	};
    1.92 +
    1.93 +inline TSyncMLTransportPropertyInfo& CSyncMLTransportPropertiesArray::operator[](TInt aIndex)
    1.94 +/**
    1.95 +Gets the member of the array with the specified index value.
    1.96 +@return	Property value at array index aIndex		
    1.97 +@param aIndex Index value
    1.98 +*/
    1.99 +	{ return At(aIndex); }
   1.100 +
   1.101 +inline const TSyncMLTransportPropertyInfo& CSyncMLTransportPropertiesArray::operator[](TInt aIndex) const
   1.102 +/**
   1.103 +Gets the member of the array with the specified index value (const overload).
   1.104 +@return	Property value at array index aIndex		
   1.105 +@param aIndex Index value
   1.106 +*/
   1.107 +	{ return At(aIndex); }
   1.108 +
   1.109 +
   1.110 +///////////////////////////////////////////////////////////////////////////////
   1.111 +///////////////////////////////////////////////////////////////////////////////
   1.112 +///////////////////////////////////////////////////////////////////////////////
   1.113 +#endif // __SYNCMLTRANSPORTPROPERTIES_H__
   1.114 \ No newline at end of file