24
|
1 |
/*
|
|
2 |
* Copyright (c) 2007-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 "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
* This file contains Feature Manager related definitions for use by the test Feature Manager stub.
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
#ifndef FEATURECMN_H
|
|
23 |
#define FEATURECMN_H
|
|
24 |
|
|
25 |
#include <e32cmn.h>
|
|
26 |
#include <babitflags.h>
|
|
27 |
|
|
28 |
const TInt KFeatureUnsupported( 0 );
|
|
29 |
const TInt KFeatureSupported( 1 );
|
|
30 |
|
|
31 |
/** An enumeration for accessing feature status flags.
|
|
32 |
@see TBitFlagsT
|
|
33 |
*/
|
|
34 |
enum TFeatureFlags
|
|
35 |
{
|
|
36 |
/** If set, feature is supported and available for use;
|
|
37 |
if not, feature is not supported.
|
|
38 |
*/
|
|
39 |
EFeatureSupported = 0,
|
|
40 |
/** If set, feature is upgradeable. The feature is known to the device
|
|
41 |
but it must be upgraded to enable it. If a feature s blacklisted,
|
|
42 |
its upgradeable flag is unset.
|
|
43 |
*/
|
|
44 |
EFeatureUpgradeable = 1,
|
|
45 |
/** If set, the feature is modifiable and may be enabled/disabled
|
|
46 |
at run-time. The initial flag values for such a feature flag are
|
|
47 |
defined in a ROM image obey file.
|
|
48 |
*/
|
|
49 |
EFeatureModifiable = 2,
|
|
50 |
/** If set, the feature has been blacklisted, and may not be changed at
|
|
51 |
run-time. This also prevents a feature from being upgraded.
|
|
52 |
*/
|
|
53 |
EFeatureBlackListed = 3,
|
|
54 |
/** If set, this flag Supported state is unknown at build-time and is
|
|
55 |
initialised at run-time by system software. The Feature Manager will
|
|
56 |
ignore the Supported flag in the file. A run-time call to RFeatureControl
|
|
57 |
will be needed to set the feature's supported flag. Look ups of
|
|
58 |
uninitialised features result in a KErrNotReady error code.
|
|
59 |
*/
|
|
60 |
EFeatureUninitialized = 4,
|
|
61 |
/** If set, this flag is saved to the system drive when modified
|
|
62 |
preserving its value across reboots/power downs.
|
|
63 |
*/
|
|
64 |
EFeaturePersisted = 5,
|
|
65 |
|
|
66 |
// Bits 6..23 Reserved for Symbian to define for future use, always zero.
|
|
67 |
|
|
68 |
// High byte bits are undefined, reserved for internal use
|
|
69 |
EFeatureReserved24 = 24,
|
|
70 |
EFeatureReserved25 = 25,
|
|
71 |
EFeatureReserved26 = 26,
|
|
72 |
EFeatureReserved27 = 27,
|
|
73 |
EFeatureReserved28 = 28,
|
|
74 |
EFeatureReserved29 = 29,
|
|
75 |
EFeatureReserved30 = 30,
|
|
76 |
EFeatureReserved31 = 31
|
|
77 |
|
|
78 |
};
|
|
79 |
|
|
80 |
/** An enumeration for checking feature change type.
|
|
81 |
*/
|
|
82 |
enum TFeatureChangeType
|
|
83 |
{
|
|
84 |
/** Feature status not changed.
|
|
85 |
*/
|
|
86 |
EFeatureNoChange = 0,
|
|
87 |
/** Feature status changed to enabled or disabled.
|
|
88 |
*/
|
|
89 |
EFeatureStatusUpdated = 1,
|
|
90 |
/** Feature data changed.
|
|
91 |
*/
|
|
92 |
EFeatureDataUpdated = 2,
|
|
93 |
/** Feature status and data changed.
|
|
94 |
*/
|
|
95 |
EFeatureStatusDataUpdated = 3,
|
|
96 |
/** Not used, future: complex change occurred, reload all features.
|
|
97 |
*/
|
|
98 |
EFeatureRediscover = 4,
|
|
99 |
/** Not used, future: new feature has been added to system.
|
|
100 |
*/
|
|
101 |
EFeatureFeatureCreated = 5
|
|
102 |
};
|
|
103 |
|
|
104 |
/**
|
|
105 |
Feature entry class.
|
|
106 |
Used by Feature Manager and its clients.
|
|
107 |
|
|
108 |
*/
|
|
109 |
|
|
110 |
class TFeatureEntry
|
|
111 |
{
|
|
112 |
public:
|
|
113 |
|
|
114 |
/**
|
|
115 |
Default constructor.
|
|
116 |
Needed by clients using the method
|
|
117 |
FeatureSupported( TFeatureEntry& aFeature ) of Feature Control API.
|
|
118 |
|
|
119 |
@param aFeature Feature UID.
|
|
120 |
*/
|
|
121 |
IMPORT_C TFeatureEntry( TUid aFeature );
|
|
122 |
|
|
123 |
/**
|
|
124 |
Default constructor.
|
|
125 |
Needed by clients using the method
|
|
126 |
AddFeature( TFeatureEntry& aFeature ) of Feature Control API.
|
|
127 |
|
|
128 |
@param aFeature Feature UID.
|
|
129 |
@param aFlags Feature status flags.
|
|
130 |
@param aData Feature data.
|
|
131 |
*/
|
|
132 |
IMPORT_C TFeatureEntry( TUid aFeature, TBitFlags32 aFlags, TUint32 aData );
|
|
133 |
|
|
134 |
/**
|
|
135 |
Returns feature UID.
|
|
136 |
*/
|
|
137 |
IMPORT_C TUid FeatureUid() const;
|
|
138 |
|
|
139 |
/**
|
|
140 |
Returns feature status flags.
|
|
141 |
*/
|
|
142 |
IMPORT_C TBitFlags32 FeatureFlags() const;
|
|
143 |
|
|
144 |
/**
|
|
145 |
Returns feature data.
|
|
146 |
*/
|
|
147 |
IMPORT_C TUint32 FeatureData() const;
|
|
148 |
|
|
149 |
public:
|
|
150 |
/**
|
|
151 |
Default constructor.
|
|
152 |
Used by Feature Manager.
|
|
153 |
*/
|
|
154 |
IMPORT_C TFeatureEntry();
|
|
155 |
|
|
156 |
private:
|
|
157 |
|
|
158 |
/** UID of the feature. */
|
|
159 |
TUid iFeatureID;
|
|
160 |
/**
|
|
161 |
Value of the feature status flags.
|
|
162 |
@see TFeatureFlags
|
|
163 |
*/
|
|
164 |
TBitFlags32 iFlags;
|
|
165 |
/** Data associated with feature. */
|
|
166 |
TUint32 iData;
|
|
167 |
/**
|
|
168 |
Reserved for future use.
|
|
169 |
Initialised to 0 on construction.
|
|
170 |
*/
|
|
171 |
TUint32 iReserved;
|
|
172 |
};
|
|
173 |
|
|
174 |
|
|
175 |
/**
|
|
176 |
Defines the feature UID array.
|
|
177 |
*/
|
|
178 |
typedef RArray<TUid> RFeatureUidArray;
|
|
179 |
|
|
180 |
/**
|
|
181 |
Defines the feature entry array.
|
|
182 |
*/
|
|
183 |
typedef RArray<TFeatureEntry> RFeatureArray;
|
|
184 |
|
|
185 |
#endif // FEATURECMN_H
|
|
186 |
|
|
187 |
// End of File
|