|
1 /* |
|
2 * Copyright (c) 2002-2004 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: Implementation of terminalsecurity components |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __TARMDmAdapter_H__ |
|
21 #define __TARMDmAdapter_H__ |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <smldmadapter.h> |
|
26 |
|
27 #include <PolicyEngineClient.h> |
|
28 |
|
29 |
|
30 |
|
31 // Adapter to check policy and if allowed to call "original" adapter |
|
32 class CTARMDmAdapter : public CSmlDmAdapter |
|
33 { |
|
34 public: |
|
35 |
|
36 // Implementation of MSmlDmAdapter interface functions that make policy checks |
|
37 // =========================================================================== |
|
38 private: |
|
39 void UpdateLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID, const TDesC8& aObject, const TDesC8& aType, TInt aStatusRef ); |
|
40 void UpdateLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID, RWriteStream*& aStream, const TDesC8& aType, TInt aStatusRef ); |
|
41 void DeleteObjectL( const TDesC8& aURI, const TDesC8& aLUID, TInt aStatusRef ); |
|
42 void FetchLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID, const TDesC8& aType, TInt aResultsRef, TInt aStatusRef ); |
|
43 void FetchLeafObjectSizeL( const TDesC8& aURI, const TDesC8& aLUID, const TDesC8& aType, TInt aResultsRef, TInt aStatusRef ); |
|
44 void ChildURIListL( const TDesC8& aURI, const TDesC8& aLUID, const CArrayFix<TSmlDmMappingInfo>& aPreviousURISegmentList, TInt aResultsRef, TInt aStatusRef ); |
|
45 |
|
46 void AddNodeObjectL( const TDesC8& aURI, const TDesC8& aParentLUID, TInt aStatusRef ); |
|
47 void ExecuteCommandL( const TDesC8& aURI, const TDesC8& aLUID, const TDesC8& aArgument, const TDesC8& aType, TInt aStatusRef ); |
|
48 void ExecuteCommandL( const TDesC8& aURI, const TDesC8& aLUID, RWriteStream*& aStream, const TDesC8& aType, TInt aStatusRef ); |
|
49 void CopyCommandL( const TDesC8& aTargetURI, const TDesC8& aTargetLUID, const TDesC8& aSourceURI, const TDesC8& aSourceLUID, const TDesC8& aType, TInt aStatusRef ); |
|
50 |
|
51 // Implementation of MSmlDmAdapter interface functions AFTER policy checks |
|
52 // ======================================================================= |
|
53 public: |
|
54 virtual void _UpdateLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID, const TDesC8& aObject, const TDesC8& aType, TInt aStatusRef ) = 0; |
|
55 virtual void _UpdateLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID, RWriteStream*& aStream, const TDesC8& aType, TInt aStatusRef ) = 0; |
|
56 virtual void _DeleteObjectL( const TDesC8& aURI, const TDesC8& aLUID, TInt aStatusRef ) = 0; |
|
57 virtual void _FetchLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID, const TDesC8& aType, TInt aResultsRef, TInt aStatusRef ) = 0; |
|
58 virtual void _FetchLeafObjectSizeL( const TDesC8& aURI, const TDesC8& aLUID, const TDesC8& aType, TInt aResultsRef, TInt aStatusRef ) = 0; |
|
59 virtual void _ChildURIListL( const TDesC8& aURI, const TDesC8& aLUID, const CArrayFix<TSmlDmMappingInfo>& aPreviousURISegmentList, TInt aResultsRef, TInt aStatusRef ) = 0; |
|
60 |
|
61 virtual void _AddNodeObjectL( const TDesC8& aURI, const TDesC8& aParentLUID, TInt aStatusRef ) = 0; |
|
62 virtual void _ExecuteCommandL( const TDesC8& aURI, const TDesC8& aLUID, const TDesC8& aArgument, const TDesC8& aType, TInt aStatusRef ) = 0; |
|
63 virtual void _ExecuteCommandL( const TDesC8& aURI, const TDesC8& aLUID, RWriteStream*& aStream, const TDesC8& aType, TInt aStatusRef ) = 0; |
|
64 virtual void _CopyCommandL( const TDesC8& aTargetURI, const TDesC8& aTargetLUID, const TDesC8& aSourceURI, const TDesC8& aSourceLUID, const TDesC8& aType, TInt aStatusRef ) = 0; |
|
65 |
|
66 // Other |
|
67 |
|
68 // PolicyCheck |
|
69 virtual TPtrC8 PolicyRequestResourceL( const TDesC8& aURI ) = 0; |
|
70 virtual TInt CheckPolicyL( const TDesC8& aURI ); |
|
71 virtual TInt CheckPolicy2L( const TDesC8& aResource ); |
|
72 |
|
73 // Other |
|
74 |
|
75 protected: |
|
76 CTARMDmAdapter( MSmlDmCallback* aCallback ); |
|
77 |
|
78 virtual ~CTARMDmAdapter(); |
|
79 |
|
80 private: |
|
81 virtual void InitializeL(); |
|
82 |
|
83 protected: |
|
84 TBool iInitialized; |
|
85 |
|
86 private: |
|
87 RPolicyEngine iPE; |
|
88 RPolicyRequest iPR; |
|
89 }; |
|
90 |
|
91 #endif // __TARMDmAdapter_H__ |
|
92 |
|
93 // End of File |