1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
40 */ |
40 */ |
41 inline CDbPolicy::CDbPolicy() |
41 inline CDbPolicy::CDbPolicy() |
42 { |
42 { |
43 } |
43 } |
44 |
44 |
45 /** |
|
46 Standard phase-one CDbPolicy factory method. |
|
47 @param aPolicyCollection A collection of R/W/S policies. |
|
48 @return A pointer to just created CDbPolicy instance. |
|
49 @leave System-wide error codes, including KErrNoMemory |
|
50 */ |
|
51 inline CDbPolicy* CDbPolicy::NewL(const RPolicyCollection& aPolicyCollection) |
|
52 { |
|
53 CDbPolicy* policy = CDbPolicy::NewLC(aPolicyCollection); |
|
54 CleanupStack::Pop(policy); |
|
55 return policy; |
|
56 } |
|
57 |
|
58 ////////////////////////////////////////////////////////////////////////////////////////////// |
45 ////////////////////////////////////////////////////////////////////////////////////////////// |
59 //class CTblPolicy |
46 //class CTblPolicy |
60 |
47 |
61 /** |
48 /** |
62 */ |
49 */ |
63 inline CTblPolicy::CTblPolicy(const CDbPolicy* aDbPolicy) : |
50 inline CTblPolicy::CTblPolicy(const CDbPolicy* aDbPolicy) : |
64 iDbPolicy(aDbPolicy) |
51 iDbPolicy(aDbPolicy) |
65 { |
52 { |
66 __ASSERT(iDbPolicy); |
53 __ASSERT(iDbPolicy); |
67 } |
|
68 |
|
69 /** |
|
70 Standard phase-one CTblPolicy factory method. |
|
71 @param aTblName The name of the table, access to which is controlled by the supplied policies |
|
72 @param aPolicyCollection A collection of R/W/S policies. |
|
73 @param aDbPolicy The related for the table database policy. |
|
74 @return A pointer to just created CTblPolicy instance. |
|
75 @leave System-wide error codes, including KErrNoMemory |
|
76 */ |
|
77 inline CTblPolicy* CTblPolicy::NewL(const TDesC& aTblName, |
|
78 const RPolicyCollection& aPolicyCollection, |
|
79 const CDbPolicy* aDbPolicy) |
|
80 { |
|
81 CTblPolicy* policy = CTblPolicy::NewLC(aTblName, aPolicyCollection, aDbPolicy); |
|
82 CleanupStack::Pop(policy); |
|
83 return policy; |
|
84 } |
54 } |
85 |
55 |
86 /** |
56 /** |
87 @return A const reference to the table name. |
57 @return A const reference to the table name. |
88 */ |
58 */ |
106 */ |
76 */ |
107 inline CPolicyDomain::CPolicyDomain(TUid aUid) : |
77 inline CPolicyDomain::CPolicyDomain(TUid aUid) : |
108 iUid(aUid), |
78 iUid(aUid), |
109 iTPCollection(KTblPolicyCollGranularity) |
79 iTPCollection(KTblPolicyCollGranularity) |
110 { |
80 { |
111 } |
|
112 |
|
113 /** |
|
114 Standard phase-one CPolicyDomain factory method. |
|
115 @param aUid The format uid of the databases, access to which is controlled by security policies |
|
116 @param aPDLoader The interface, which actual implementation is used to load the related set |
|
117 of security policies into CPolicyDomain collection. Currently CPolicyDomain |
|
118 policy collection can be loaded from a text or binary policy file. |
|
119 @return A pointer to just created CPolicyDomain instance. |
|
120 @leave System-wide error codes, including KErrNoMemory |
|
121 */ |
|
122 inline CPolicyDomain* CPolicyDomain::NewL(TUid aUid, MPolicyDomainLoader& aPDLoader) |
|
123 { |
|
124 CPolicyDomain* domain = CPolicyDomain::NewLC(aUid, aPDLoader); |
|
125 CleanupStack::Pop(domain); |
|
126 return domain; |
|
127 } |
81 } |
128 |
82 |
129 /** |
83 /** |
130 @return Policy domain UID. |
84 @return Policy domain UID. |
131 */ |
85 */ |
200 iIndex(0) |
154 iIndex(0) |
201 { |
155 { |
202 } |
156 } |
203 |
157 |
204 /** |
158 /** |
205 @return The UID of the related CPolicyDomain object. |
|
206 */ |
|
207 inline TUid TPolicyDomainReader::Uid() const |
|
208 { |
|
209 return iPolicyDomain.Uid(); |
|
210 } |
|
211 |
|
212 /** |
|
213 @return A const reference to the existing CDbPolicy instance - part of the related |
159 @return A const reference to the existing CDbPolicy instance - part of the related |
214 CPolicyDomain security policies collection. |
160 CPolicyDomain security policies collection. |
215 */ |
161 */ |
216 inline const CDbPolicy& TPolicyDomainReader::DbPolicy() const |
162 inline const CDbPolicy& TPolicyDomainReader::DbPolicy() const |
217 { |
163 { |