|
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 Wallpaper Adapter |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __WallpaperAdapter_H__ |
|
21 #define __WallpaperAdapter_H__ |
|
22 |
|
23 // ------------------------------------------------------------------------------------------------ |
|
24 // Includes |
|
25 // ------------------------------------------------------------------------------------------------ |
|
26 #include <e32base.h> |
|
27 #include <smldmadapter.h> |
|
28 #include "TARMDmAdapter.h" |
|
29 |
|
30 |
|
31 const TUint KSmlDMWallpaperAdapterImplUid = 0x10207830; |
|
32 |
|
33 // the DDF version must be changed if any changes in DDF structure ( built in DDFStructureL() function ) |
|
34 _LIT8( KSmlWPDDFVersion, "1.0" ); |
|
35 _LIT8( KSmlWPTextPlain, "text/plain" ); |
|
36 _LIT( KSmlWPDescription, "The interior object holds all wallpaper objects" ); |
|
37 |
|
38 _LIT8( KSmlCustomizationN, "Customization" ); |
|
39 _LIT8( KSmlCustomizationD, "Customization node" ); |
|
40 _LIT8( KSmlWPWallpaperN, "Wallpaper" ); |
|
41 _LIT8( KSmlWPWallpaperD, "Wallpaper node" ); |
|
42 _LIT8( KSmlWPDataN, "Data" ); |
|
43 _LIT8( KSmlWPImageD, "Image node" ); |
|
44 |
|
45 _LIT8( KWPSeparator, "/" ); |
|
46 |
|
47 // ------------------------------------------------------------------------------------------------ |
|
48 // CWallpaperAdapter |
|
49 // ------------------------------------------------------------------------------------------------ |
|
50 class CWallpaperAdapter : public CTARMDmAdapter |
|
51 { |
|
52 public: |
|
53 static CWallpaperAdapter* NewL(MSmlDmCallback* aDmCallback ); |
|
54 static CWallpaperAdapter* NewLC(MSmlDmCallback* aDmCallback ); |
|
55 |
|
56 virtual ~CWallpaperAdapter(); |
|
57 |
|
58 // Implementation of MSmlDmAdapter interface |
|
59 // ========================================= |
|
60 void DDFVersionL( CBufBase& aVersion ); |
|
61 void DDFStructureL( MSmlDmDDFObject& aDDF ); |
|
62 |
|
63 void _UpdateLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID, const TDesC8& aObject, const TDesC8& aType, TInt aStatusRef ); |
|
64 void _UpdateLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID, RWriteStream*& aStream, const TDesC8& aType, TInt aStatusRef ); |
|
65 void _DeleteObjectL( const TDesC8& aURI, const TDesC8& aLUID, TInt aStatusRef ); |
|
66 void _FetchLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID, const TDesC8& aType, TInt aResultsRef, TInt aStatusRef ); |
|
67 void _FetchLeafObjectSizeL( const TDesC8& aURI, const TDesC8& aLUID, const TDesC8& aType, TInt aResultsRef, TInt aStatusRef ); |
|
68 void _ChildURIListL( const TDesC8& aURI, const TDesC8& aLUID, const CArrayFix<TSmlDmMappingInfo>& aPreviousURISegmentList, TInt aResultsRef, TInt aStatusRef ); |
|
69 |
|
70 void _AddNodeObjectL( const TDesC8& aURI, const TDesC8& aParentLUID, TInt aStatusRef ); |
|
71 void _ExecuteCommandL( const TDesC8& aURI, const TDesC8& aLUID, const TDesC8& aArgument, const TDesC8& aType, TInt aStatusRef ); |
|
72 void _ExecuteCommandL( const TDesC8& aURI, const TDesC8& aLUID, RWriteStream*& aStream, const TDesC8& aType, TInt aStatusRef ); |
|
73 void _CopyCommandL( const TDesC8& aTargetURI, const TDesC8& aTargetLUID, const TDesC8& aSourceURI, const TDesC8& aSourceLUID, const TDesC8& aType, TInt aStatusRef ); |
|
74 |
|
75 void StartAtomicL(); |
|
76 void CommitAtomicL(); |
|
77 void RollbackAtomicL(); |
|
78 TBool StreamingSupport( TInt& aItemSize ); |
|
79 #ifdef __TARM_SYMBIAN_CONVERGENCY |
|
80 virtual void StreamCommittedL( RWriteStream& aStream ); |
|
81 #else |
|
82 virtual void StreamCommittedL(); |
|
83 #endif |
|
84 void CompleteOutstandingCmdsL(); |
|
85 |
|
86 // PolicyCheck, resource name |
|
87 //#ifdef __SAP_POLICY_MANAGEMENT |
|
88 TPtrC8 PolicyRequestResourceL( const TDesC8& aURI ); |
|
89 //#endif |
|
90 private: |
|
91 void ConstructL(); |
|
92 CWallpaperAdapter( MSmlDmCallback* aDmCallback ); |
|
93 |
|
94 enum TNodeId |
|
95 { |
|
96 ENodeUnknown, |
|
97 ENodeCustomization, |
|
98 ENodeWallpaper, |
|
99 ENodeImage, |
|
100 ENodeLast |
|
101 }; |
|
102 |
|
103 TNodeId NodeId( const TDesC8& aURI ); |
|
104 |
|
105 void FillNodeInfoL( MSmlDmDDFObject& aNode, |
|
106 TSmlDmAccessTypes aAccTypes, |
|
107 MSmlDmDDFObject::TOccurence aOccurrence, |
|
108 MSmlDmDDFObject::TScope aScope, |
|
109 MSmlDmDDFObject::TDFFormat aFormat, |
|
110 const TDesC8& aDescription, |
|
111 TBool aObjectGroup); |
|
112 |
|
113 TBool IsImageL(const TDesC8& aMime) ; |
|
114 private: |
|
115 |
|
116 MSmlDmCallback* iCallBack; |
|
117 |
|
118 }; |
|
119 |
|
120 |
|
121 |
|
122 |
|
123 |
|
124 #endif // __WallpaperAdapter_H__ |