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 Operator Logo Adapter |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __OPERATORLOGOADAPTER_H__ |
|
21 #define __OPERATORLOGOADAPTER_H__ |
|
22 |
|
23 // ------------------------------------------------------------------------------------------------ |
|
24 // Includes |
|
25 // ------------------------------------------------------------------------------------------------ |
|
26 #include "TARMDmAdapter.h" |
|
27 |
|
28 #include <fbs.h> |
|
29 |
|
30 const TUint KOperatorLogoAdapterImplUid = 0x1020782A; |
|
31 |
|
32 // the DDF version must be changed if any changes in DDF structure ( built in DDFStructureL() function ) |
|
33 _LIT8( KOperatorLogoDDFVersion, "1.0" ); |
|
34 |
|
35 _LIT8( KOperatorLogoCustomization, "Customization" ); |
|
36 _LIT8( KOperatorLogoCustomizationD, "Customization node" ); |
|
37 _LIT8( KOperatorLogoOperatorLogo, "OperatorLogo" ); |
|
38 _LIT8( KOperatorLogoOperatorLogoD, "OperatorLogo node" ); |
|
39 _LIT8( KOperatorLogoLogoData, "Data" ); |
|
40 _LIT8( KOperatorLogoLogoDataD, "LogoData node" ); |
|
41 |
|
42 |
|
43 _LIT8( KNSmlDMTextPlain, "text/plain" ); |
|
44 _LIT8( KNSmlDMImageAny, "image/*" ); |
|
45 |
|
46 // ------------------------------------------------------------------------------------------------ |
|
47 // COperatorLogoAdapter |
|
48 // ------------------------------------------------------------------------------------------------ |
|
49 class COperatorLogoAdapter : public CTARMDmAdapter |
|
50 { |
|
51 public: |
|
52 static COperatorLogoAdapter* NewL(MSmlDmCallback* aDmCallback ); |
|
53 static COperatorLogoAdapter* NewLC(MSmlDmCallback* aDmCallback ); |
|
54 |
|
55 virtual ~COperatorLogoAdapter(); |
|
56 |
|
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 |
|
91 private: |
|
92 void ConstructL( ); |
|
93 |
|
94 COperatorLogoAdapter( MSmlDmCallback* aDmCallback ); |
|
95 |
|
96 enum TNodeId |
|
97 { |
|
98 ENodeUnknown, |
|
99 |
|
100 ENodeCustomization, |
|
101 ENodeOperatorLogo, |
|
102 ENodeLogoData, |
|
103 |
|
104 ENodeLast |
|
105 }; |
|
106 |
|
107 TNodeId NodeId( const TDesC8& aURI ); |
|
108 |
|
109 void FillNodeInfoL( MSmlDmDDFObject& aNode,TSmlDmAccessTypes aAccTypes,MSmlDmDDFObject::TOccurence aOccurrence, MSmlDmDDFObject::TScope aScope, MSmlDmDDFObject::TDFFormat aFormat,const TDesC8& aDescription,TBool aObjectGroup); |
|
110 |
|
111 TBool IsText(const TDesC8& aMime); |
|
112 TBool IsImage(const TDesC8& aMime); |
|
113 TError GetOperatorLogoL( CBufBase& aData, TDes8& aMimeType ); |
|
114 TError SetOperatorLogoL( const TDesC8& aData, const TDesC8& aMime ); |
|
115 TError SetOperatorLogoText( const TDesC8& aData, const TDesC8& aMime ); |
|
116 TError SetOperatorLogoImageL( const TDesC8& aData, const TDesC8& aMime ); |
|
117 TError DeleteOperatorLogoImageL(); |
|
118 |
|
119 void LoadBitmapL( const TDesC& aFileName, CFbsBitmap& aBitmap ); |
|
120 void ScaleBitmapL( CFbsBitmap& aBitmap, TInt aX, TInt aY ); |
|
121 void GetScreenDisplayModeL( TDisplayMode &aDisplayMode ); |
|
122 void GetOpInfoL( TInt& aMCC, TInt& aMNC ); |
|
123 void SaveOperatorLogoBitmapL( TInt aBitmapHandle, TInt aMCC, TInt aMNC ); |
|
124 |
|
125 private: |
|
126 |
|
127 MSmlDmCallback* iCallBack; |
|
128 |
|
129 |
|
130 }; |
|
131 |
|
132 |
|
133 |
|
134 |
|
135 |
|
136 #endif // __OPERATORLOGOADAPTER_H__ |
|