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