|
1 /* |
|
2 * Copyright (c) 2007 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 Browser Adapter |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 #ifndef __NSMLDMDEVINFOADAPTER_H__ |
|
24 #define __NSMLDMDEVINFOADAPTER_H__ |
|
25 |
|
26 // INCLUDES |
|
27 #include <e32base.h> |
|
28 #include <smldmadapter.h> |
|
29 #include "nsmldmconstants.h" |
|
30 |
|
31 // MACROS |
|
32 |
|
33 // the DDF version must be changed if any changes in DDF structure |
|
34 // ( built in DDFStructureL() function ) |
|
35 _LIT8( KNSmlDMBrowserAdapterDDFVersion, "1.0" ); |
|
36 |
|
37 _LIT8 (KNSmlURISeparator ,"/"); |
|
38 |
|
39 _LIT8( KNSmlDMBrowserAdapterTextPlain, "text/plain" ); |
|
40 _LIT8( KNSmlDMBrowserAdapterNodeName, "Browser" ); |
|
41 _LIT8( KNSmlDMBrowserAdapterDescription, "The parent object holding all Browser objects" ); |
|
42 _LIT8( KNSmlDMBrowserStartpageURLDescription, "The default URL that is connected when the browser opens" ); |
|
43 |
|
44 _LIT8( KNSmlDMBrowserAdapterAPNode, "ToConRef" ); |
|
45 _LIT8( KNSmlDMBrowserAdapterBrowserNodes, "ToConRef/StartPage" ); |
|
46 _LIT8( KNSmlDMBrowserAdapterStartpageURL, "StartPage" ); |
|
47 _LIT8( KNSmlDMBrowserAdapterAPNodeDescription, "To set the default AP of browser" ); |
|
48 _LIT8( KNSmlDMBrowserAdapterAPvalue,""); |
|
49 |
|
50 _LIT8( KNSmlDMBrowserAdapterAPDefaultvalue,"AP/APId001"); |
|
51 |
|
52 |
|
53 const TInt KMaxLengthStartpageName = 255; |
|
54 |
|
55 const TInt KBrowserHomePageUDefined = 1; |
|
56 const TInt KMaxLengthStartpageBookmark = 3; |
|
57 |
|
58 const TUint32 KBrowserNGStartpageURL = 0x00000030; |
|
59 //const TUint32 KBrowserNGHomepageType = 0x00000031; |
|
60 |
|
61 |
|
62 |
|
63 // CLASS DECLARATION |
|
64 class CNSmlDmBrowserAdapter : public CSmlDmAdapter |
|
65 { |
|
66 public: // constructors and destructor |
|
67 static CNSmlDmBrowserAdapter* NewL(MSmlDmCallback* aDmCallback ); |
|
68 static CNSmlDmBrowserAdapter* NewLC(MSmlDmCallback* aDmCallback ); |
|
69 |
|
70 virtual ~CNSmlDmBrowserAdapter(); |
|
71 |
|
72 private: ///new functions |
|
73 |
|
74 void SetLeafPropertiesL( MSmlDmDDFObject& aObject, |
|
75 const TSmlDmAccessTypes& aAccessTypes, |
|
76 const TDesC8& aDescription ) const; |
|
77 CNSmlDmBrowserAdapter(TAny* aEcomArguments); |
|
78 CSmlDmAdapter::TError FetchLeafObjectL( const TDesC8& aURI, CBufBase& aObject ); |
|
79 |
|
80 private: // from base classes |
|
81 // Adapter interface from CSmlDmAdapter |
|
82 void DDFVersionL( CBufBase& aDDFVersion ); |
|
83 void DDFStructureL( MSmlDmDDFObject& aDDF ); |
|
84 void UpdateLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID, |
|
85 const TDesC8& aObject, const TDesC8& aType, |
|
86 const TInt aStatusRef ); |
|
87 void DeleteObjectL( const TDesC8& aURI, const TDesC8& aLUID, TInt aStatusRef ); |
|
88 void FetchLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID, |
|
89 const TDesC8& aType, const TInt aResultsRef, |
|
90 const TInt aStatusRef ); |
|
91 void ChildURIListL( const TDesC8& aURI, const TDesC8& aLUID, |
|
92 const CArrayFix<TSmlDmMappingInfo>& aPreviousURISegmentList, |
|
93 const TInt aResultsRef, const TInt aStatusRef ); |
|
94 void AddNodeObjectL( const TDesC8& aURI, const TDesC8& aParentLUID, |
|
95 const TInt aStatusRef ); |
|
96 |
|
97 void UpdateLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID, |
|
98 RWriteStream*& aStream, const TDesC8& aType, |
|
99 const TInt aStatusRef ); |
|
100 void FetchLeafObjectSizeL( const TDesC8& aURI, const TDesC8& aLUID, |
|
101 const TDesC8& aType, const TInt aResultsRef, |
|
102 const TInt aStatusRef ); |
|
103 |
|
104 void ExecuteCommandL( const TDesC8& aURI, const TDesC8& aLUID, |
|
105 const TDesC8& aArgument, |
|
106 const TDesC8& aType, |
|
107 const TInt aStatusRef ); |
|
108 |
|
109 void ExecuteCommandL( const TDesC8& aURI, const TDesC8& aLUID, |
|
110 RWriteStream*& aStream, |
|
111 const TDesC8& aType, |
|
112 const TInt aStatusRef ); |
|
113 |
|
114 void CopyCommandL( const TDesC8& aTargetURI, const TDesC8& aTargetLUID, |
|
115 const TDesC8& aSourceURI, |
|
116 const TDesC8& aSourceLUID, |
|
117 const TDesC8& aType, TInt aStatusRef ); |
|
118 void StartAtomicL(); |
|
119 void CommitAtomicL(); |
|
120 void RollbackAtomicL(); |
|
121 TBool StreamingSupport( TInt& aItemSize ); |
|
122 void StreamCommittedL(); |
|
123 void CompleteOutstandingCmdsL(); |
|
124 |
|
125 |
|
126 private: |
|
127 MSmlDmCallback* iDmCallback; |
|
128 }; |
|
129 |
|
130 #endif // __NSMLDMDEVINFOADAPTER_H__ |