epoc32/include/e32property.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@2
     1
// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@4
     4
// under the terms of the License "Eclipse Public License v1.0"
williamr@2
     5
// which accompanies this distribution, and is available
williamr@4
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
// e32\include\e32property.h
williamr@2
    15
// 
williamr@2
    16
//
williamr@2
    17
williamr@2
    18
#ifndef __E32PROPERTY_H__
williamr@2
    19
#define __E32PROPERTY_H__
williamr@2
    20
williamr@2
    21
#include <e32cmn.h>
williamr@2
    22
williamr@2
    23
/**
williamr@2
    24
@publishedAll
williamr@2
    25
@released
williamr@2
    26
williamr@2
    27
Property category UID value reserved for System services.
williamr@2
    28
*/
williamr@2
    29
static const TInt32 KUidSystemCategoryValue=0x101f75b6;
williamr@2
    30
williamr@2
    31
williamr@2
    32
/**
williamr@2
    33
@publishedAll
williamr@2
    34
@released
williamr@2
    35
williamr@2
    36
Property category UID reserved for System services
williamr@2
    37
*/
williamr@2
    38
static const TUid KUidSystemCategory={KUidSystemCategoryValue};
williamr@2
    39
williamr@2
    40
williamr@2
    41
/**
williamr@2
    42
@publishedAll
williamr@2
    43
@released
williamr@2
    44
williamr@2
    45
The lowest value for Property categories at which additional
williamr@2
    46
security restrictions are applied when defining properties.
williamr@2
    47
williamr@2
    48
Properties with category values above this threshold may only be defined
williamr@2
    49
if the category matches the defining process's Secure ID.
williamr@2
    50
williamr@2
    51
Below this threashold, properties may be defined either by processes with
williamr@2
    52
a matching Secure ID, or by processes with the WriteDeviceData capability.
williamr@2
    53
*/
williamr@2
    54
static const TInt32 KUidSecurityThresholdCategoryValue=0x10273357;
williamr@2
    55
williamr@2
    56
williamr@2
    57
/**
williamr@2
    58
@publishedAll
williamr@2
    59
@released
williamr@2
    60
williamr@2
    61
User side interface to Publish & Subscribe.
williamr@2
    62
williamr@2
    63
The class defines a handle to a property, a single data value representing
williamr@2
    64
an item of state information. Threads can publish (change) a property value
williamr@2
    65
through this handle. Threads can also subscribe
williamr@2
    66
(request notification of changes) to a property value through this handle;
williamr@2
    67
they can also retrieve the current property value.
williamr@2
    68
*/
williamr@2
    69
class RProperty : public RHandleBase
williamr@2
    70
	{
williamr@2
    71
public:
williamr@2
    72
	/**
williamr@2
    73
	The largest supported property value, in bytes, for byte-array (binary)
williamr@2
    74
	types and text types.
williamr@2
    75
    */
williamr@2
    76
	enum { KMaxPropertySize = 512 };
williamr@2
    77
	/**
williamr@2
    78
	The largest supported property value, in bytes, for large byte-array (binary)
williamr@2
    79
	types and large text types.
williamr@2
    80
    */
williamr@2
    81
	enum { KMaxLargePropertySize = 65535 };
williamr@2
    82
williamr@2
    83
williamr@2
    84
	/**
williamr@2
    85
	Property type attribute.
williamr@2
    86
	*/
williamr@2
    87
	enum TType
williamr@2
    88
		{
williamr@2
    89
		/**
williamr@2
    90
		Integral property type.
williamr@2
    91
		*/
williamr@2
    92
		EInt,
williamr@2
    93
		
williamr@2
    94
		
williamr@2
    95
		/**
williamr@2
    96
		Byte-array (binary data) property type.
williamr@2
    97
		This type provides real-time guarantees but is limited to a maximum size
williamr@2
    98
		of 512 bytes.
williamr@2
    99
williamr@2
   100
		@see KMaxPropertySize 
williamr@2
   101
		*/
williamr@2
   102
		EByteArray,
williamr@2
   103
		
williamr@2
   104
		
williamr@2
   105
		/**
williamr@2
   106
		Text property type. 
williamr@2
   107
		This is just a programmer friendly view of a byte-array property, and
williamr@2
   108
		is implemented in the same way as EByteArray.
williamr@2
   109
		*/
williamr@2
   110
		EText = EByteArray,
williamr@2
   111
williamr@2
   112
williamr@2
   113
		/**
williamr@2
   114
		Large byte-array (binary data) property type.
williamr@2
   115
		This type provides no real-time guarantees but supports properties
williamr@2
   116
		of up to 65536 bytes.
williamr@2
   117
williamr@2
   118
		@see KMaxLargePropertySize 
williamr@2
   119
		*/
williamr@2
   120
		ELargeByteArray,
williamr@2
   121
		
williamr@2
   122
		
williamr@2
   123
		/**
williamr@2
   124
		Large text property type. 
williamr@2
   125
		This is just a programmer friendly view of a byte-array property, and
williamr@2
   126
		is implemented in the same way as EByteArray.
williamr@2
   127
		*/
williamr@2
   128
		ELargeText = ELargeByteArray,
williamr@2
   129
williamr@2
   130
williamr@2
   131
		/**
williamr@2
   132
		Upper limit for TType values.
williamr@2
   133
		It is the maximal legal TType value plus 1.
williamr@2
   134
		*/ 
williamr@2
   135
		ETypeLimit,
williamr@2
   136
		
williamr@2
   137
		
williamr@2
   138
		/**
williamr@2
   139
		Bitmask for TType values coded within TInt attributes.
williamr@2
   140
		*/ 
williamr@2
   141
		ETypeMask = 0xff
williamr@2
   142
		};
williamr@2
   143
williamr@2
   144
williamr@2
   145
public:
williamr@2
   146
	IMPORT_C static TInt Define(TUid aCategory, TUint aKey, TInt aAttr, TInt aPreallocate=0);
williamr@2
   147
	IMPORT_C static TInt Define(TUid aCategory, TUint aKey, TInt aAttr, const TSecurityPolicy& aReadPolicy, const TSecurityPolicy& aWritePolicy, TInt aPreallocated=0);
williamr@2
   148
	IMPORT_C static TInt Define(TUint aKey, TInt aAttr, const TSecurityPolicy& aReadPolicy, const TSecurityPolicy& aWritePolicy, TInt aPreallocated=0);
williamr@2
   149
	IMPORT_C static TInt Delete(TUid aCategory, TUint aKey);
williamr@2
   150
	IMPORT_C static TInt Delete(TUint aKey);
williamr@2
   151
	IMPORT_C static TInt Get(TUid aCategory, TUint aKey, TInt& aValue);
williamr@2
   152
	IMPORT_C static TInt Get(TUid aCategory, TUint aKey, TDes8& aValue);
williamr@2
   153
#ifndef __KERNEL_MODE__
williamr@2
   154
	IMPORT_C static TInt Get(TUid aCategory, TUint aKey, TDes16& aValue);
williamr@2
   155
#endif
williamr@2
   156
	IMPORT_C static TInt Set(TUid aCategory, TUint aKey, TInt aValue);
williamr@2
   157
	IMPORT_C static TInt Set(TUid aCategory, TUint aKey, const TDesC8& aValue);
williamr@2
   158
#ifndef __KERNEL_MODE__
williamr@2
   159
	IMPORT_C static TInt Set(TUid aCategory, TUint aKey, const TDesC16& aValue);
williamr@2
   160
#endif
williamr@2
   161
williamr@2
   162
	IMPORT_C TInt Attach(TUid aCategory, TUint aKey, TOwnerType aType = EOwnerProcess);
williamr@2
   163
williamr@2
   164
	IMPORT_C void Subscribe(TRequestStatus& aRequest);
williamr@2
   165
	IMPORT_C void Cancel();
williamr@2
   166
williamr@2
   167
	IMPORT_C TInt Get(TInt& aValue);
williamr@2
   168
	IMPORT_C TInt Get(TDes8& aValue);
williamr@2
   169
#ifndef __KERNEL_MODE__
williamr@2
   170
	IMPORT_C TInt Get(TDes16& aValue);
williamr@2
   171
#endif
williamr@2
   172
	IMPORT_C TInt Set(TInt aValue);
williamr@2
   173
	IMPORT_C TInt Set(const TDesC8& aValue);
williamr@2
   174
#ifndef __KERNEL_MODE__
williamr@2
   175
	IMPORT_C TInt Set(const TDesC16& aValue);
williamr@2
   176
#endif
williamr@2
   177
	};
williamr@2
   178
williamr@2
   179
#endif