epoc32/include/e32property.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
     1.1 --- a/epoc32/include/e32property.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/e32property.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,179 @@
     1.4 -e32property.h
     1.5 +// Copyright (c) 2002-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:
    1.18 +// e32\include\e32property.h
    1.19 +// 
    1.20 +//
    1.21 +
    1.22 +#ifndef __E32PROPERTY_H__
    1.23 +#define __E32PROPERTY_H__
    1.24 +
    1.25 +#include <e32cmn.h>
    1.26 +
    1.27 +/**
    1.28 +@publishedAll
    1.29 +@released
    1.30 +
    1.31 +Property category UID value reserved for System services.
    1.32 +*/
    1.33 +static const TInt32 KUidSystemCategoryValue=0x101f75b6;
    1.34 +
    1.35 +
    1.36 +/**
    1.37 +@publishedAll
    1.38 +@released
    1.39 +
    1.40 +Property category UID reserved for System services
    1.41 +*/
    1.42 +static const TUid KUidSystemCategory={KUidSystemCategoryValue};
    1.43 +
    1.44 +
    1.45 +/**
    1.46 +@publishedAll
    1.47 +@released
    1.48 +
    1.49 +The lowest value for Property categories at which additional
    1.50 +security restrictions are applied when defining properties.
    1.51 +
    1.52 +Properties with category values above this threshold may only be defined
    1.53 +if the category matches the defining process's Secure ID.
    1.54 +
    1.55 +Below this threashold, properties may be defined either by processes with
    1.56 +a matching Secure ID, or by processes with the WriteDeviceData capability.
    1.57 +*/
    1.58 +static const TInt32 KUidSecurityThresholdCategoryValue=0x10273357;
    1.59 +
    1.60 +
    1.61 +/**
    1.62 +@publishedAll
    1.63 +@released
    1.64 +
    1.65 +User side interface to Publish & Subscribe.
    1.66 +
    1.67 +The class defines a handle to a property, a single data value representing
    1.68 +an item of state information. Threads can publish (change) a property value
    1.69 +through this handle. Threads can also subscribe
    1.70 +(request notification of changes) to a property value through this handle;
    1.71 +they can also retrieve the current property value.
    1.72 +*/
    1.73 +class RProperty : public RHandleBase
    1.74 +	{
    1.75 +public:
    1.76 +	/**
    1.77 +	The largest supported property value, in bytes, for byte-array (binary)
    1.78 +	types and text types.
    1.79 +    */
    1.80 +	enum { KMaxPropertySize = 512 };
    1.81 +	/**
    1.82 +	The largest supported property value, in bytes, for large byte-array (binary)
    1.83 +	types and large text types.
    1.84 +    */
    1.85 +	enum { KMaxLargePropertySize = 65535 };
    1.86 +
    1.87 +
    1.88 +	/**
    1.89 +	Property type attribute.
    1.90 +	*/
    1.91 +	enum TType
    1.92 +		{
    1.93 +		/**
    1.94 +		Integral property type.
    1.95 +		*/
    1.96 +		EInt,
    1.97 +		
    1.98 +		
    1.99 +		/**
   1.100 +		Byte-array (binary data) property type.
   1.101 +		This type provides real-time guarantees but is limited to a maximum size
   1.102 +		of 512 bytes.
   1.103 +
   1.104 +		@see KMaxPropertySize 
   1.105 +		*/
   1.106 +		EByteArray,
   1.107 +		
   1.108 +		
   1.109 +		/**
   1.110 +		Text property type. 
   1.111 +		This is just a programmer friendly view of a byte-array property, and
   1.112 +		is implemented in the same way as EByteArray.
   1.113 +		*/
   1.114 +		EText = EByteArray,
   1.115 +
   1.116 +
   1.117 +		/**
   1.118 +		Large byte-array (binary data) property type.
   1.119 +		This type provides no real-time guarantees but supports properties
   1.120 +		of up to 65536 bytes.
   1.121 +
   1.122 +		@see KMaxLargePropertySize 
   1.123 +		*/
   1.124 +		ELargeByteArray,
   1.125 +		
   1.126 +		
   1.127 +		/**
   1.128 +		Large text property type. 
   1.129 +		This is just a programmer friendly view of a byte-array property, and
   1.130 +		is implemented in the same way as EByteArray.
   1.131 +		*/
   1.132 +		ELargeText = ELargeByteArray,
   1.133 +
   1.134 +
   1.135 +		/**
   1.136 +		Upper limit for TType values.
   1.137 +		It is the maximal legal TType value plus 1.
   1.138 +		*/ 
   1.139 +		ETypeLimit,
   1.140 +		
   1.141 +		
   1.142 +		/**
   1.143 +		Bitmask for TType values coded within TInt attributes.
   1.144 +		*/ 
   1.145 +		ETypeMask = 0xff
   1.146 +		};
   1.147 +
   1.148 +
   1.149 +public:
   1.150 +	IMPORT_C static TInt Define(TUid aCategory, TUint aKey, TInt aAttr, TInt aPreallocate=0);
   1.151 +	IMPORT_C static TInt Define(TUid aCategory, TUint aKey, TInt aAttr, const TSecurityPolicy& aReadPolicy, const TSecurityPolicy& aWritePolicy, TInt aPreallocated=0);
   1.152 +	IMPORT_C static TInt Define(TUint aKey, TInt aAttr, const TSecurityPolicy& aReadPolicy, const TSecurityPolicy& aWritePolicy, TInt aPreallocated=0);
   1.153 +	IMPORT_C static TInt Delete(TUid aCategory, TUint aKey);
   1.154 +	IMPORT_C static TInt Delete(TUint aKey);
   1.155 +	IMPORT_C static TInt Get(TUid aCategory, TUint aKey, TInt& aValue);
   1.156 +	IMPORT_C static TInt Get(TUid aCategory, TUint aKey, TDes8& aValue);
   1.157 +#ifndef __KERNEL_MODE__
   1.158 +	IMPORT_C static TInt Get(TUid aCategory, TUint aKey, TDes16& aValue);
   1.159 +#endif
   1.160 +	IMPORT_C static TInt Set(TUid aCategory, TUint aKey, TInt aValue);
   1.161 +	IMPORT_C static TInt Set(TUid aCategory, TUint aKey, const TDesC8& aValue);
   1.162 +#ifndef __KERNEL_MODE__
   1.163 +	IMPORT_C static TInt Set(TUid aCategory, TUint aKey, const TDesC16& aValue);
   1.164 +#endif
   1.165 +
   1.166 +	IMPORT_C TInt Attach(TUid aCategory, TUint aKey, TOwnerType aType = EOwnerProcess);
   1.167 +
   1.168 +	IMPORT_C void Subscribe(TRequestStatus& aRequest);
   1.169 +	IMPORT_C void Cancel();
   1.170 +
   1.171 +	IMPORT_C TInt Get(TInt& aValue);
   1.172 +	IMPORT_C TInt Get(TDes8& aValue);
   1.173 +#ifndef __KERNEL_MODE__
   1.174 +	IMPORT_C TInt Get(TDes16& aValue);
   1.175 +#endif
   1.176 +	IMPORT_C TInt Set(TInt aValue);
   1.177 +	IMPORT_C TInt Set(const TDesC8& aValue);
   1.178 +#ifndef __KERNEL_MODE__
   1.179 +	IMPORT_C TInt Set(const TDesC16& aValue);
   1.180 +#endif
   1.181 +	};
   1.182 +
   1.183 +#endif