author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:32:09 +0300 | |
branch | RCL_3 |
changeset 75 | 01504893d9cb |
parent 64 | 34937ec34dac |
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; |
|
75
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
31 |
class CGlxDRMUtility; |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
32 |
class CGlxImageViewerManager; |
60 | 33 |
|
34 |
namespace Alf |
|
35 |
{ |
|
36 |
class IMulModel; // An interface for the data model |
|
37 |
class IMulWidget; // An interface for all Multimedia widgets |
|
38 |
class MulVisualItem; // Client need to use this class to add data in data model |
|
39 |
} |
|
40 |
||
41 |
const TInt KGlxMaxFrameCount = 25; |
|
42 |
||
43 |
class CGlxDrmGifTextureCreator: public CBase |
|
44 |
{ |
|
45 |
public: |
|
46 |
/* |
|
47 |
* |
|
48 |
*/ |
|
49 |
static CGlxDrmGifTextureCreator* NewL(const CGlxBinding& aBinding, |
|
64
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
50 |
const TGlxMedia& aMedia, TInt aItemIndex, Alf::IMulModel* aModel, MGlxMediaList& aMediaList); |
60 | 51 |
|
52 |
/* |
|
53 |
* destructor |
|
54 |
*/ |
|
55 |
~CGlxDrmGifTextureCreator(); |
|
56 |
public: |
|
57 |
/* |
|
58 |
* This is to cancel the active object from decoding |
|
59 |
*/ |
|
60 |
void HandleRunL(TRequestStatus& aStatus); |
|
61 |
||
62 |
/* |
|
63 |
* This updates the new image. |
|
64 |
*/ |
|
65 |
void UpdateNewImageL(const TGlxMedia& aMedia, TInt aItemIndex); |
|
66 |
||
67 |
/* |
|
68 |
* Enable/Disable the animation |
|
69 |
*/ |
|
70 |
void AnimateDRMGifItem(TBool aAnimate); |
|
71 |
||
72 |
private: |
|
73 |
/* |
|
74 |
* Ctor |
|
75 |
*/ |
|
76 |
CGlxDrmGifTextureCreator(const CGlxBinding& aBinding, |
|
64
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
77 |
const TGlxMedia& aMedia, TInt aItemIndex, Alf::IMulModel* aModel, MGlxMediaList& aMediaList); |
60 | 78 |
|
79 |
/* |
|
80 |
* ConstructL() |
|
81 |
*/ |
|
82 |
void ConstructL(); |
|
83 |
||
84 |
/* |
|
85 |
* Call a refresh on the screen |
|
86 |
*/ |
|
87 |
void RefreshL(); |
|
88 |
||
89 |
/* |
|
90 |
* Release contents |
|
91 |
*/ |
|
92 |
void ReleaseContent(); |
|
93 |
||
94 |
/* |
|
95 |
* Create bitmap |
|
96 |
*/ |
|
97 |
void CreateBitmapAndStartDecodingL(); |
|
98 |
||
99 |
/* |
|
100 |
* Create an image decoder with given file |
|
101 |
* @param - Image file |
|
102 |
*/ |
|
103 |
void CreateImageDecoderL(const TDesC& aImageFile); |
|
104 |
||
105 |
static TInt TimerCallbackL(TAny* aThis); |
|
106 |
||
107 |
/* |
|
108 |
* ProcessTimerEventL |
|
109 |
*/ |
|
110 |
void ProcessTimerEventL(); |
|
111 |
||
112 |
/* |
|
113 |
* ProcessImageL |
|
114 |
*/ |
|
115 |
void ProcessImageL(); |
|
116 |
||
117 |
void SetTexture(TInt aTextureId=KErrNotFound); |
|
75
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
118 |
|
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
119 |
/* |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
120 |
* Check whether the drm rights are expired or not |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
121 |
* for animated gifs. |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
122 |
*/ |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
123 |
TBool IsDRMRightsExpiredL(); |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
124 |
|
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
125 |
/** |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
126 |
* Sets the default or FS texture as initial texture. |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
127 |
* Then creates Image decoder & starts image decoding |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
128 |
* if DRM Rights are not expired. |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
129 |
*/ |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
130 |
void SetInitialTextureAndStartDecodingL(); |
60 | 131 |
|
132 |
private: |
|
133 |
||
134 |
TSize iOrigImageDimensions; |
|
135 |
TInt iFrameCount; |
|
136 |
||
137 |
CFbsBitmap* iDecodedBitmap[KGlxMaxFrameCount]; //Decoded bitmap of the focussed image |
|
138 |
CFbsBitmap* iDecodedMask[KGlxMaxFrameCount]; |
|
139 |
||
140 |
//ICL |
|
141 |
CGlxDRMgifDecoderAO* iGlxDecoderAO; // Internal Image decoder AO |
|
142 |
CImageDecoder* iImageDecoder; // Image Decoder |
|
143 |
TInt iAnimCount; // animation count |
|
144 |
RFs iFsSession; // RFs |
|
145 |
||
146 |
CPeriodic* iTimer; |
|
147 |
CPeriodic* iAnimationTimer; |
|
148 |
TBool iBitmapReady; |
|
149 |
#ifdef _DEBUG |
|
150 |
TTime iStartTime; |
|
151 |
TTime iStopTime; |
|
152 |
#endif |
|
153 |
||
154 |
const CGlxBinding* iBinding; |
|
155 |
const TGlxMedia* iMedia; |
|
156 |
Alf::IMulModel* iModel; |
|
157 |
TInt iItemIndex; |
|
158 |
CGlxUiUtility* iUiUtility ; |
|
159 |
TBool iAnimateFlag; |
|
160 |
TBool iTransparencyPossible; |
|
161 |
TFrameInfo iFrameInfo; |
|
162 |
TBool iFrameShift; |
|
64
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
163 |
MGlxMediaList& iMediaList; |
75
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
164 |
|
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
165 |
/** Poniter to instance of DRM utility (owned) */ |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
166 |
CGlxDRMUtility* iDrmUtility; |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
167 |
/** For image viewer, not own */ |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
168 |
CGlxImageViewerManager* iImageViewerInstance; |
60 | 169 |
}; |
170 |
#endif /* GLXDRMGIFTEXTURECREATOR_H_ */ |