author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 14 Sep 2010 21:19:17 +0300 | |
branch | RCL_3 |
changeset 64 | 34937ec34dac |
parent 60 | 5b3385a43d68 |
child 75 | 01504893d9cb |
permissions | -rw-r--r-- |
60 | 1 |
/* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 |
* All rights reserved. |
|
3 |
* This component and the accompanying materials are made available |
|
4 |
* under the terms of "Eclipse Public License v1.0" |
|
5 |
* which accompanies this distribution, and is available |
|
6 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 |
* |
|
8 |
* Initial Contributors: |
|
9 |
* Nokia Corporation - initial contribution. |
|
10 |
* |
|
11 |
* Contributors: |
|
12 |
* |
|
13 |
* Description: Gif Texture creator implementation |
|
14 |
* |
|
15 |
*/ |
|
16 |
||
17 |
#ifndef GLXDRMGIFTEXTURECREATOR_H_ |
|
18 |
#define GLXDRMGIFTEXTURECREATOR_H_ |
|
19 |
||
20 |
#include <w32std.h> |
|
21 |
#include <fbs.h> |
|
64
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
22 |
#include <icl/imagedata.h> |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
23 |
#include <mglxmedialist.h> // Interface for reading lists of media items |
60 | 24 |
|
25 |
class CGlxDRMgifDecoderAO; |
|
26 |
class CImageDecoder; |
|
27 |
class CGlxUiUtility; |
|
28 |
class CGlxBinding; |
|
29 |
class TGlxMedia; // Reference to a media item in the item pool |
|
30 |
class CAlfEnv; |
|
31 |
||
32 |
namespace Alf |
|
33 |
{ |
|
34 |
class IMulModel; // An interface for the data model |
|
35 |
class IMulWidget; // An interface for all Multimedia widgets |
|
36 |
class MulVisualItem; // Client need to use this class to add data in data model |
|
37 |
} |
|
38 |
||
39 |
const TInt KGlxMaxFrameCount = 25; |
|
40 |
||
41 |
class CGlxDrmGifTextureCreator: public CBase |
|
42 |
{ |
|
43 |
public: |
|
44 |
/* |
|
45 |
* |
|
46 |
*/ |
|
47 |
static CGlxDrmGifTextureCreator* NewL(const CGlxBinding& aBinding, |
|
64
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
48 |
const TGlxMedia& aMedia, TInt aItemIndex, Alf::IMulModel* aModel, MGlxMediaList& aMediaList); |
60 | 49 |
|
50 |
/* |
|
51 |
* destructor |
|
52 |
*/ |
|
53 |
~CGlxDrmGifTextureCreator(); |
|
54 |
public: |
|
55 |
/* |
|
56 |
* This is to cancel the active object from decoding |
|
57 |
*/ |
|
58 |
void HandleRunL(TRequestStatus& aStatus); |
|
59 |
||
60 |
/* |
|
61 |
* This updates the new image. |
|
62 |
*/ |
|
63 |
void UpdateNewImageL(const TGlxMedia& aMedia, TInt aItemIndex); |
|
64 |
||
65 |
/* |
|
66 |
* Enable/Disable the animation |
|
67 |
*/ |
|
68 |
void AnimateDRMGifItem(TBool aAnimate); |
|
69 |
||
70 |
private: |
|
71 |
/* |
|
72 |
* Ctor |
|
73 |
*/ |
|
74 |
CGlxDrmGifTextureCreator(const CGlxBinding& aBinding, |
|
64
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
75 |
const TGlxMedia& aMedia, TInt aItemIndex, Alf::IMulModel* aModel, MGlxMediaList& aMediaList); |
60 | 76 |
|
77 |
/* |
|
78 |
* ConstructL() |
|
79 |
*/ |
|
80 |
void ConstructL(); |
|
81 |
||
82 |
/* |
|
83 |
* Call a refresh on the screen |
|
84 |
*/ |
|
85 |
void RefreshL(); |
|
86 |
||
87 |
/* |
|
88 |
* Release contents |
|
89 |
*/ |
|
90 |
void ReleaseContent(); |
|
91 |
||
92 |
/* |
|
93 |
* Create bitmap |
|
94 |
*/ |
|
95 |
void CreateBitmapAndStartDecodingL(); |
|
96 |
||
97 |
/* |
|
98 |
* Create an image decoder with given file |
|
99 |
* @param - Image file |
|
100 |
*/ |
|
101 |
void CreateImageDecoderL(const TDesC& aImageFile); |
|
102 |
||
103 |
static TInt TimerCallbackL(TAny* aThis); |
|
104 |
||
105 |
/* |
|
106 |
* ProcessTimerEventL |
|
107 |
*/ |
|
108 |
void ProcessTimerEventL(); |
|
109 |
||
110 |
/* |
|
111 |
* ProcessImageL |
|
112 |
*/ |
|
113 |
void ProcessImageL(); |
|
114 |
||
115 |
void SetTexture(TInt aTextureId=KErrNotFound); |
|
116 |
||
117 |
private: |
|
118 |
||
119 |
TSize iOrigImageDimensions; |
|
120 |
TInt iFrameCount; |
|
121 |
||
122 |
CFbsBitmap* iDecodedBitmap[KGlxMaxFrameCount]; //Decoded bitmap of the focussed image |
|
123 |
CFbsBitmap* iDecodedMask[KGlxMaxFrameCount]; |
|
124 |
||
125 |
//ICL |
|
126 |
CGlxDRMgifDecoderAO* iGlxDecoderAO; // Internal Image decoder AO |
|
127 |
CImageDecoder* iImageDecoder; // Image Decoder |
|
128 |
TInt iAnimCount; // animation count |
|
129 |
RFs iFsSession; // RFs |
|
130 |
||
131 |
CPeriodic* iTimer; |
|
132 |
CPeriodic* iAnimationTimer; |
|
133 |
TBool iBitmapReady; |
|
134 |
#ifdef _DEBUG |
|
135 |
TTime iStartTime; |
|
136 |
TTime iStopTime; |
|
137 |
#endif |
|
138 |
||
139 |
const CGlxBinding* iBinding; |
|
140 |
const TGlxMedia* iMedia; |
|
141 |
Alf::IMulModel* iModel; |
|
142 |
TInt iItemIndex; |
|
143 |
CGlxUiUtility* iUiUtility ; |
|
144 |
TBool iAnimateFlag; |
|
145 |
TBool iTransparencyPossible; |
|
146 |
TFrameInfo iFrameInfo; |
|
147 |
TBool iFrameShift; |
|
64
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
148 |
MGlxMediaList& iMediaList; |
60 | 149 |
}; |
150 |
#endif /* GLXDRMGIFTEXTURECREATOR_H_ */ |