135
|
1 |
// Copyright (c) 2010 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 "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
// e32\include\drivers\resourcecontrol_clientsettings.h
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
#ifndef __RESOURCECONTROL_CLIENTSETTINGS_H__
|
|
19 |
#define __RESOURCECONTROL_CLIENTSETTINGS_H__
|
|
20 |
|
|
21 |
#include <drivers/hcr.h>
|
|
22 |
|
|
23 |
const TUint KBitPerClientSettings = 5; // 0 - 31, Max of 32 elements defined for use per client
|
|
24 |
const TUint KClientElementIdBase = 0x10; // Max of 16 elements defined for use by resman
|
|
25 |
const TUint8 KStaticResourceTableSize = 5;
|
|
26 |
|
|
27 |
inline TUint ElementId_ClientSettingBase(TUint aClientToken)
|
|
28 |
{
|
|
29 |
return ((aClientToken << KBitPerClientSettings) + KClientElementIdBase);
|
|
30 |
}
|
|
31 |
|
|
32 |
inline HCR::TElementId ElementId_ClientName(TUint aClientToken)
|
|
33 |
{
|
|
34 |
return ((HCR::TElementId) ElementId_ClientSettingBase(aClientToken));
|
|
35 |
}
|
|
36 |
|
|
37 |
inline HCR::TElementId ElementId_ClientPropertyFlag(TUint aClientToken)
|
|
38 |
{
|
|
39 |
return ((HCR::TElementId) (ElementId_ClientSettingBase(aClientToken) + 1));
|
|
40 |
}
|
|
41 |
|
|
42 |
inline HCR::TElementId ElementId_ClientPreallocation(TUint aClientToken)
|
|
43 |
{
|
|
44 |
return ((HCR::TElementId) (ElementId_ClientSettingBase(aClientToken) + 2));
|
|
45 |
}
|
|
46 |
|
|
47 |
inline HCR::TElementId ElementId_ClientStaticResource(TUint aClientToken, TUint aResource)
|
|
48 |
{
|
|
49 |
return ((HCR::TElementId) (ElementId_ClientSettingBase(aClientToken) + 3 + aResource));
|
|
50 |
}
|
|
51 |
|
|
52 |
inline HCR::TElementId ElementId_ClientDynamicResource(TUint aClientToken, TUint aResource)
|
|
53 |
{
|
|
54 |
return ((HCR::TElementId) (ElementId_ClientSettingBase(aClientToken) + 3 + KStaticResourceTableSize + aResource));
|
|
55 |
}
|
|
56 |
|
|
57 |
|
|
58 |
// Dynamic Resource Settings
|
|
59 |
|
|
60 |
const TUint KDynamicResourceElementIdBase = 0x20000;
|
|
61 |
const TUint KBitPerDynamicResourceSettings = 5; // 0 - 31, Max of 32 elements defined for use per dynamic resource
|
|
62 |
|
|
63 |
inline TUint ElementId_DynamicResourceBase(TUint aDynamicResource)
|
|
64 |
{
|
|
65 |
return ((aDynamicResource << KBitPerDynamicResourceSettings) + KDynamicResourceElementIdBase);
|
|
66 |
}
|
|
67 |
|
|
68 |
inline HCR::TElementId ElementId_DynamicResourceName(TUint aDynamicResource)
|
|
69 |
{
|
|
70 |
return ((HCR::TElementId) (ElementId_DynamicResourceBase(aDynamicResource)));
|
|
71 |
}
|
|
72 |
|
|
73 |
inline HCR::TElementId ElementId_DynamicResourcePropertyFlag(TUint aDynamicResource)
|
|
74 |
{
|
|
75 |
return ((HCR::TElementId) (ElementId_DynamicResourceBase(aDynamicResource) + 1));
|
|
76 |
}
|
|
77 |
|
|
78 |
inline HCR::TElementId ElementId_DynamicResourceMaxLevel(TUint aDynamicResource)
|
|
79 |
{
|
|
80 |
return ((HCR::TElementId) (ElementId_DynamicResourceBase(aDynamicResource) + 2));
|
|
81 |
}
|
|
82 |
|
|
83 |
inline HCR::TElementId ElementId_DynamicResourceMinLevel(TUint aDynamicResource)
|
|
84 |
{
|
|
85 |
return ((HCR::TElementId) (ElementId_DynamicResourceBase(aDynamicResource) + 3));
|
|
86 |
}
|
|
87 |
|
|
88 |
inline HCR::TElementId ElementId_DynamicResourceDefaultLevel(TUint aDynamicResource)
|
|
89 |
{
|
|
90 |
return ((HCR::TElementId) (ElementId_DynamicResourceBase(aDynamicResource) + 4));
|
|
91 |
}
|
|
92 |
|
|
93 |
inline HCR::TElementId ElementId_DynamicResourceDependencyMask1(TUint aDynamicResource)
|
|
94 |
{
|
|
95 |
return ((HCR::TElementId) (ElementId_DynamicResourceBase(aDynamicResource) + 5));
|
|
96 |
}
|
|
97 |
|
|
98 |
inline HCR::TElementId ElementId_DynamicResourceDependencyMask2(TUint aDynamicResource)
|
|
99 |
{
|
|
100 |
return ((HCR::TElementId) (ElementId_DynamicResourceBase(aDynamicResource) + 6));
|
|
101 |
}
|
|
102 |
|
|
103 |
inline HCR::TElementId ElementId_DynamicResourceDependencyMask3(TUint aDynamicResource)
|
|
104 |
{
|
|
105 |
return ((HCR::TElementId) (ElementId_DynamicResourceBase(aDynamicResource) + 7));
|
|
106 |
}
|
|
107 |
|
|
108 |
#endif
|
|
109 |
|