|
1 /* |
|
2 * Copyright (c) 2002 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: DM Email Settings Adapter |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __NSMLEMBEDDEDLINKADAPTER_H__ |
|
21 #define __NSMLEMBEDDEDLINKADAPTER_H__ |
|
22 |
|
23 |
|
24 #include "TARMDmAdapter.h" |
|
25 #include "EmbeddedLinkApp.h" |
|
26 |
|
27 const TUint KNSmlEmbeddedLinkAdapterImplUid = 0x1020782C; |
|
28 |
|
29 // the DDF version must be changed if any changes in DDF structure ( built in DDFStructureL() function ) |
|
30 _LIT8( KNSmlEmbeddedLinkAdapterDDFVersion, "1.0" ); |
|
31 |
|
32 _LIT8( KNSmlEmbeddedLinkAdapterTextPlain, "text/plain" ); |
|
33 _LIT8( KNSmlEmbeddedLinkAdapterNodeName, "Apps" ); |
|
34 _LIT8( KNSmlEmbeddedLinkEmbeddedLinks,"EmbeddedLinks") ; |
|
35 _LIT8( KNSmlEmbeddedLinkCustomization, "Customization"); |
|
36 _LIT8( KNSmlEmbeddedLinkAdapterShutdown,"reboot") ; |
|
37 _LIT8( KNSmlEmbeddedLinkAdapterDescription, "The interior object holds all apps objects" ); |
|
38 _LIT8( KNSmlEmbeddedLinkAdapterDynamicNodeDescription, "Placeholder for one or more Group objects" ); |
|
39 _LIT8( KNSmlEmbeddedLinkAdapterDynamicNode2Description, "Placeholder for one or more Vendor objects" ); |
|
40 _LIT8( KNSmlEmbeddedLinkAdapterDynamicNode3Description, "Placeholder for one or more Package objects" ); |
|
41 _LIT8( KNSmlEmbeddedLinkAdapterPkgDataDescription, "The Data associated with the DM tree application package" ); |
|
42 _LIT8( KNSmlEmbeddedLinkAdapterPkgNameDescription, "The Name associated with the DM tree application package" ); |
|
43 _LIT8( KNSmlEmbeddedLinkAdapterPkgVersionDescription, "Version associated with the DM tree application package" ); |
|
44 _LIT8( KNSmlEmbeddedLinkAdapterPkgMimeTypeDescription, "Mime type associated with the DM tree application package" ); |
|
45 _LIT8( KNSmlEmbeddedLinkAdapterIsInstalledDescription, "IsInstalled status associated with the DM tree application package" ); |
|
46 _LIT8( KNSmlEmbeddedLinkAdapterIsRunningDescription, "IsRunning status associated with the DM tree application package" ); |
|
47 _LIT8( KNSmlEmbeddedLinkAdapterPkgVendorDescription, "name of the vendor associated with the DM tree application package" ); |
|
48 _LIT8( KNSmlEmbeddedLinkAdapterInstallationDateDescription, "InstallationDate associated with the DM tree application package" ); |
|
49 _LIT8( KNSmlEmbeddedLinkAdapterInstallationPathDescription, "InstallationPath associated with the DM tree application package" ); |
|
50 |
|
51 _LIT8( KNSmlEmbeddedLinkDynamicNode, "" ); |
|
52 _LIT8( KNSmlEmbeddedLinkLink, "Links"); |
|
53 _LIT8( KNSmlEmbeddedLinkURL, "URL"); |
|
54 _LIT8( KNSmlEmbeddedLinkName, "Name"); |
|
55 _LIT8( KNSmlEmbeddedLinkUserName, "UserName" ); |
|
56 _LIT8( KNSmlEmbeddedLinkPassword, "Password" ); |
|
57 _LIT8( KNSmlEmbeddedLinkConfRef, "ConRef"); |
|
58 _LIT8( KNSmlEmbeddedLinkID, "ID" ); |
|
59 _LIT8( KNSmlEmbeddedLinkAppName, "AppName" ); |
|
60 |
|
61 _LIT8( KLinkLeafs8, "URL/Name/UserName/Password/ConRef" ); |
|
62 _LIT8( KRootLeafs8, "EmbeddedLinks" ); |
|
63 _LIT8( KAppLeafs8, "Links/ID/AppName" ); |
|
64 |
|
65 // WapAp strings |
|
66 _LIT8( KWapApDefault, "" ); |
|
67 _LIT8( KWapApNull, "null" ); |
|
68 |
|
69 |
|
70 class CEmbeddedLinkHandler; |
|
71 |
|
72 // ------------------------------------------------------------------------------------------------ |
|
73 // CNSmlDmEmailAdapter |
|
74 // ------------------------------------------------------------------------------------------------ |
|
75 class CNSmlEmbeddedLinkAdapter : public CTARMDmAdapter |
|
76 { |
|
77 public: |
|
78 static CNSmlEmbeddedLinkAdapter* NewL(MSmlDmCallback* aDmCallback ); |
|
79 static CNSmlEmbeddedLinkAdapter* NewLC(MSmlDmCallback* aDmCallback ); |
|
80 |
|
81 virtual ~CNSmlEmbeddedLinkAdapter(); |
|
82 |
|
83 // Implementation of MSmlDmAdapter interface |
|
84 // ========================================= |
|
85 void DDFVersionL( CBufBase& aVersion ); |
|
86 void DDFStructureL( MSmlDmDDFObject& aDDF ); |
|
87 |
|
88 void _UpdateLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID, const TDesC8& aObject, const TDesC8& aType, TInt aStatusRef ); |
|
89 void _UpdateLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID, RWriteStream*& aStream, const TDesC8& aType, TInt aStatusRef ); |
|
90 void _DeleteObjectL( const TDesC8& aURI, const TDesC8& aLUID, TInt aStatusRef ); |
|
91 void _FetchLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID, const TDesC8& aType, TInt aResultsRef, TInt aStatusRef ); |
|
92 void _FetchLeafObjectSizeL( const TDesC8& aURI, const TDesC8& aLUID, const TDesC8& aType, TInt aResultsRef, TInt aStatusRef ); |
|
93 void _ChildURIListL( const TDesC8& aURI, const TDesC8& aLUID, const CArrayFix<TSmlDmMappingInfo>& aPreviousURISegmentList, TInt aResultsRef, TInt aStatusRef ); |
|
94 |
|
95 void _AddNodeObjectL( const TDesC8& aURI, const TDesC8& aParentLUID, TInt aStatusRef ); |
|
96 void _ExecuteCommandL( const TDesC8& aURI, const TDesC8& aLUID, const TDesC8& aArgument, const TDesC8& aType, TInt aStatusRef ); |
|
97 void _ExecuteCommandL( const TDesC8& aURI, const TDesC8& aLUID, RWriteStream*& aStream, const TDesC8& aType, TInt aStatusRef ); |
|
98 void _CopyCommandL( const TDesC8& aTargetURI, const TDesC8& aTargetLUID, const TDesC8& aSourceURI, const TDesC8& aSourceLUID, const TDesC8& aType, TInt aStatusRef ); |
|
99 |
|
100 void StartAtomicL(); |
|
101 void CommitAtomicL(); |
|
102 void RollbackAtomicL(); |
|
103 TBool StreamingSupport( TInt& aItemSize ); |
|
104 #ifdef __TARM_SYMBIAN_CONVERGENCY |
|
105 virtual void StreamCommittedL( RWriteStream& aStream ); |
|
106 #else |
|
107 virtual void StreamCommittedL(); |
|
108 #endif |
|
109 void CompleteOutstandingCmdsL(); |
|
110 |
|
111 // PolicyCheck, resource name |
|
112 TPtrC8 PolicyRequestResourceL( const TDesC8& aURI ); |
|
113 |
|
114 TBool LuidMappingInAdapter() { return ETrue ;} |
|
115 TBool AdapterCanChangeACL() { return ETrue ; } |
|
116 |
|
117 private: |
|
118 void ConstructL( ); |
|
119 |
|
120 CNSmlEmbeddedLinkAdapter( MSmlDmCallback* aDmCallback ); |
|
121 |
|
122 enum TNodeId |
|
123 { |
|
124 ENodeUnknown, |
|
125 |
|
126 ENodeCustomization, |
|
127 ENodeEmbeddedLinks, |
|
128 ENodeEmbeddedLinksX1, |
|
129 ENodeLinks, |
|
130 ENodeID, |
|
131 ENodeAppName, |
|
132 ENodeLinksX2, |
|
133 ENodeURL, |
|
134 ENodeName, |
|
135 ENodeUserName, |
|
136 ENodePassword, |
|
137 ENodeConRef, |
|
138 |
|
139 ENodeLast |
|
140 }; |
|
141 |
|
142 TNodeId NodeId( const TDesC8& aURI ); |
|
143 |
|
144 void FillNodeInfoL( MSmlDmDDFObject& aNode,TSmlDmAccessTypes aAccTypes,MSmlDmDDFObject::TOccurence aOccurrence, MSmlDmDDFObject::TScope aScope, MSmlDmDDFObject::TDFFormat aFormat,const TDesC8& aDescription ); |
|
145 TInt RecognizeAppTypeL(const TDesC8& aURI, TDes& aAppName); |
|
146 |
|
147 private: |
|
148 |
|
149 MSmlDmCallback* iCallBack; |
|
150 |
|
151 /** Temporary buffer for got messages.. */ |
|
152 RArray<CEmbeddedLinkApp> iBuffer; |
|
153 |
|
154 TInt iLuid; |
|
155 CEmbeddedLinkHandler* iLinkHandler; |
|
156 |
|
157 }; |
|
158 |
|
159 |
|
160 |
|
161 |
|
162 |
|
163 #endif // __CNSmlEmbeddedLinkAdapter_H__ |