|
1 /* |
|
2 * Copyright (c) 2005-2009 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 the License "Symbian Foundation License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 /** |
|
19 @test |
|
20 @internalComponent |
|
21 |
|
22 This contains CT_DataFbsBitmap |
|
23 */ |
|
24 |
|
25 #if (!defined __T_DATA_FBS_BITMAP_H__) |
|
26 #define __T_DATA_FBS_BITMAP_H__ |
|
27 |
|
28 // User Includes |
|
29 #include "DataWrapperBase.h" |
|
30 |
|
31 // EPOC includes |
|
32 #include <e32std.h> |
|
33 #include <fbs.h> |
|
34 #include <s32file.h> |
|
35 #include <bitdev.h> |
|
36 |
|
37 class CT_DataFbsBitmap : public CDataWrapperBase |
|
38 { |
|
39 public: |
|
40 static CT_DataFbsBitmap* NewL(); |
|
41 ~CT_DataFbsBitmap(); |
|
42 |
|
43 virtual TBool DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex); |
|
44 |
|
45 virtual TAny* GetObject(); |
|
46 virtual void SetObjectL(TAny* aAny); |
|
47 virtual void DisownObjectL(); |
|
48 |
|
49 protected: |
|
50 CT_DataFbsBitmap(); |
|
51 void ConstructL(); |
|
52 |
|
53 virtual CFbsBitmap* GetFbsBitmap() const; |
|
54 |
|
55 void RunL(CActive* aActive, TInt aIndex); |
|
56 void DoCancel(CActive* aActive, TInt aIndex); |
|
57 |
|
58 private: |
|
59 void DestroyData(); |
|
60 void DoCmdNewL(); |
|
61 void DoCmdDestructor(); |
|
62 void DoCmdCompress(const TDesC& aSection); |
|
63 void DoCmdCompressInBackground(const TDesC& aSection, const TInt aAsyncErrorIndex); |
|
64 void DoCmdCreate(const TDesC& aSection); |
|
65 void DoCmdCreateHardwareBitmap(const TDesC& aSection); |
|
66 void DoCmdDataAddress(const TDesC& aSection); |
|
67 void DoCmdDataStride(const TDesC& aSection); |
|
68 void DoCmdDisplayMode(const TDesC& aSection); |
|
69 void DoCmdDuplicateL(const TDesC& aSection); |
|
70 void DoCmdExternalizeL(const TDesC& aSection); |
|
71 void DoCmdExternalizeRectangleL(const TDesC& aSection); |
|
72 void DoCmdGetPaletteL(const TDesC& aSection); |
|
73 void DoCmdGetPixel(const TDesC& aSection); |
|
74 void DoCmdGetScanLineL(const TDesC& aSection); |
|
75 void DoCmdGetVerticalScanLineL(const TDesC& aSection); |
|
76 void DoCmdHandle(const TDesC& aSection); |
|
77 void DoCmdHardwareBitmapHandle(const TDesC& aSection); |
|
78 void DoCmdHeader(); |
|
79 void DoCmdHorizontalPixelsToTwips(const TDesC& aSection); |
|
80 void DoCmdHorizontalTwipsToPixels(const TDesC& aSection); |
|
81 void DoCmdInitialDisplayMode(const TDesC& aSection); |
|
82 void DoCmdInternalizeL(const TDesC& aSection); |
|
83 void DoCmdIsCompressedInRAM(const TDesC& aSection); |
|
84 void DoCmdIsFileInRom(const TDesC& aSection); |
|
85 void DoCmdIsLargeBitmap(const TDesC& aSection); |
|
86 void DoCmdIsMonochrome(const TDesC& aSection); |
|
87 void DoCmdIsRomBitmap(const TDesC& aSection); |
|
88 void DoCmdLoadL(const TDesC& aSection); |
|
89 void DoCmdLoadAndCompressL(const TDesC& aSection); |
|
90 void DoCmdLockHeap(const TDesC& aSection); |
|
91 void DoCmdLockHeapLC(const TDesC& aSection); |
|
92 void DoCmdPaletteAttributes(const TDesC& aSection); |
|
93 void DoCmdReset(); |
|
94 void DoCmdResize(const TDesC& aSection); |
|
95 void DoCmdSave(const TDesC& aSection); |
|
96 void DoCmdScanLineLength(const TDesC& aSection); |
|
97 void DoCmdSetDisplayMode(const TDesC& aSection); |
|
98 void DoCmdSetPaletteL(const TDesC& aSection); |
|
99 void DoCmdSetRomBitmapL(const TDesC& aSection); |
|
100 void DoCmdSetScanLineL(const TDesC& aSection); |
|
101 void DoCmdSetSizeInTwipsL(const TDesC& aSection); |
|
102 void DoCmdSizeInPixels(const TDesC& aSection); |
|
103 void DoCmdSizeInTwips(const TDesC& aSection); |
|
104 void DoCmdStoreL(const TDesC& aSection); |
|
105 void DoCmdSwapWidthAndHeight(); |
|
106 void DoCmdUnlockHeapL(const TDesC& aSection); |
|
107 void DoCmdVerticalPixelsToTwips(const TDesC& aSection); |
|
108 void DoCmdVerticalTwipsToPixels(const TDesC& aSection); |
|
109 |
|
110 // MTPActiveCallback implementation |
|
111 void RunCompressInBackground(const TInt aIndex); |
|
112 void DoCancelCompressInBackground(const TInt aIndex); |
|
113 |
|
114 // Helpers |
|
115 void ExternalizeImplL(const TDesC& aSection, const TRect& aRect, TBool aUseRect); |
|
116 void LoadOrLoadAndCompressL(const TDesC& aSection, TBool aCompress); |
|
117 inline TDisplayMode GetDisplayMode() const; |
|
118 |
|
119 private: |
|
120 /** CFbsBitmap class instance that is tested */ |
|
121 CFbsBitmap* iFbsBitmap; |
|
122 TDisplayMode iDisplayMode; |
|
123 |
|
124 /** Pop when unlocking */ |
|
125 TBool iPopWhenUnlocking; |
|
126 |
|
127 TBool iCompressFailed; |
|
128 |
|
129 /** Active object for CompressInBackground async operation */ |
|
130 CActiveCallback* iActiveCompressInBackground; |
|
131 }; |
|
132 |
|
133 #include "T_DataFbsBitmap.inl" |
|
134 |
|
135 #endif /* __T_DATA_FBS_BITMAP_H__ */ |