1 // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // 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
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
23 #include <e32property.h>
32 A set of static functions to get and set hardware attributes.
36 class HAL : public HALData
41 Synonyms for the attribute properties
42 HALData::TAttributeProperty, and used in SEntry.
47 When set, means that an attribute is meaningful on this device.
53 When set, means that an attribute is modifiable.
60 Defines an entry in the array that is returned in a call to HAL::GetAll().
65 The properties of the attribute.
67 @see HAL::TEntryProperty
74 @see HALData::TAttribute
80 Gets the value of the specified HAL attribute.
82 @param aAttribute The HAL attribute.
83 @param aValue On successful return, contains the attribute value.
84 Some attributes may accept aValue as an input as well, to select
85 one of several alternate values. See the documentation for the
86 individual HAL attributes for details of this.
88 @return KErrNone, if successful;
89 KErrNotSupported, if the attribute is not defined in the list
90 of attributes, or is not meaningful for this device.
91 KErrArgument, if aValue was invalid (for attributes
92 which take an argument).
94 @see HALData::TAttribute
95 @see HALData::TAttributeProperty
97 IMPORT_C static TInt Get(TAttribute aAttribute, TInt& aValue);
101 Sets the specified HAL attribute.
103 @param aAttribute The HAL attribute.
104 @param aValue The attribute value.
106 @return KErrNone, if successful;
107 KErrNotSupported, if the attribute is not defined in the list
108 of attributes, or is not meaningful for this device, or is
111 @see HALData::TAttribute
112 @see HALData::TAttributeProperty
114 @capability WriteDeviceData or other capability specified
115 for individual attributes in TAttribute
117 IMPORT_C static TInt Set(TAttribute aAttribute, TInt aValue);
121 Gets all HAL attributes, and their properties.
123 For attributes that are not meaningful on this device (ie. those which have
124 not been defined in the config.hcf file),
125 the attribute value and its associated property value are set to zero in
128 Attributes for which multiple values can be retrieved
129 ie. EDisplayIsPalettized, EDisplayBitsPerPixel, EDisplayOffsetToFirstPixel,
130 EDisplayOffsetBetweenLines, and EDisplayPaletteEntry will also be zero in
133 @param aNumEntries On successful return, contains the total number
135 If the function returns KErrNoMemory, this value is set
137 @param aData On successful return, contains a pointer to an array
138 of SEntry objects, each of which contains an attribute value
139 and its property value. Note that the property value is
140 defined by the HAL::TEntry synonym.
141 If the function returns KErrNoMemory, this pointer is set
144 @return KErrNone, if succesful;
145 KErrNoMemory, if there is insufficient memory.
147 IMPORT_C static TInt GetAll(TInt& aNumEntries, SEntry*& aData);
151 Gets the value of the specified HAL attribute.
153 @param aDeviceNumber The device number. (eg: screen number)
154 @param aAttribute The HAL attribute.
155 @param aValue On successful return, contains the attribute value.
156 Some attributes may accept aValue as an input as well, to select
157 one of several alternate values. See the documentation for the
158 individual HAL attributes for details of this.
161 @return KErrNone, if successful;
162 KErrNotSupported, if the attribute is not defined in the list
163 of attributes, or is not meaningful for this device.
164 KErrArgument, if aValue was invalid (for attributes
165 which take an argument).
167 @see HALData::TAttribute
168 @see HALData::TAttributeProperty
170 IMPORT_C static TInt Get(TInt aDeviceNumber, TAttribute aAttribute, TInt& aValue);
174 Sets the specified HAL attribute.
176 @param aDeviceNumber The device number. (eg: screen number)
177 @param aAttribute The HAL attribute.
178 @param aValue The attribute value.
180 @return KErrNone, if successful;
181 KErrNotSupported, if the attribute is not defined in the list
182 of attributes, or is not meaningful for this device, or is
185 @see HALData::TAttribute
186 @see HALData::TAttributeProperty
188 @capability WriteDeviceData or other capability specified
189 for individual attributes in TAttribute
191 IMPORT_C static TInt Set(TInt aDeviceNumber, TAttribute aAttribute, TInt aValue);
198 static const TInt32 KUidHalPropertyKeyBase = 0x1020E306;
200 __ASSERT_COMPILE(HAL::ENumHalAttributes<256); // only 256 UIDs allocated for HAL property keys