|
1 /* |
|
2 * Copyright (c) 2008 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef HUIFXFILTER_H_ |
|
21 #define HUIFXFILTER_H_ |
|
22 |
|
23 class CHuiFxParameterManager; |
|
24 |
|
25 #include "HuiFxEngine.h" |
|
26 #include "HuiFxRenderbuffer.h" |
|
27 #include "HuiFxParameter.h" |
|
28 #include "HuiFxConstants.h" |
|
29 #include "HuiFxParameterCollection.h" |
|
30 |
|
31 class CHuiFxFilter: public CBase, public MHuiFxParameterCollection |
|
32 { |
|
33 public: |
|
34 IMPORT_C virtual ~CHuiFxFilter(); |
|
35 IMPORT_C virtual TBool PrepareDrawL(CHuiFxEngine& aEngine); |
|
36 IMPORT_C virtual TBool Draw(CHuiFxEngine& aEngine, CHuiGc& aGc, CHuiFxRenderbuffer& aTarget, CHuiFxRenderbuffer& aSource, |
|
37 const TRect& aTargetRect, const TRect& aSourceRect) = 0; |
|
38 // CalculateMargin will be called before PrepareDrawL(), so |
|
39 // parameters are not ready, so margin calculation need to use |
|
40 // either previous frame parameter values, or should be independent |
|
41 // of parameters. Should do nothing else than set value for aMargin. |
|
42 IMPORT_C virtual void CalculateMargin(TMargins &aMargin) const; |
|
43 |
|
44 // TODO: which of these are really needed? |
|
45 IMPORT_C void SetMargin(const TSize& aMargin); |
|
46 IMPORT_C const TSize& Margin() const; |
|
47 IMPORT_C const TMargins &Margin2() const; |
|
48 IMPORT_C void SetFreeForm(TBool aEnable); |
|
49 IMPORT_C TBool IsFreeForm() const; |
|
50 IMPORT_C void AdvanceTime(TReal32 aElapsedTime); |
|
51 IMPORT_C TBool Changed() const; |
|
52 IMPORT_C void SetVisualRect(const TRect& aVisualRect); |
|
53 IMPORT_C const TRect& VisualRect() const; |
|
54 |
|
55 IMPORT_C MHuiFxParameter* Parameter(const TDesC& aName); |
|
56 IMPORT_C virtual CHuiFxFilter *CloneL() const=0; |
|
57 |
|
58 protected: |
|
59 IMPORT_C void ConstructL(); |
|
60 IMPORT_C void RegisterParameterL(const TDesC& aName, TRgb* aValue); |
|
61 IMPORT_C void RegisterParameterL(const TDesC& aName, TReal32* aValue); |
|
62 IMPORT_C void CopyParameterL(const TDesC& aName, TRgb* aValue, const CHuiFxFilter *aOldFilter); |
|
63 IMPORT_C void CopyParameterL(const TDesC& aName, TReal32* aValue, const CHuiFxFilter *aOldFilter); |
|
64 IMPORT_C void CopyFromL(const CHuiFxFilter *aOldFilter); // copies all baseclass CHuiFxFilter parameters |
|
65 IMPORT_C TBool ParameterChanged(); |
|
66 |
|
67 TReal32 iOpacity; |
|
68 |
|
69 private: |
|
70 CHuiFxParameterManager* iParameterManager; |
|
71 TSize iMargin; // not used |
|
72 TBool iIsFreeForm; |
|
73 TBool iParameterChanged; |
|
74 TBool iFirstParameterCheck; |
|
75 TBool iFrameCount; |
|
76 TRect iVisualRect; |
|
77 mutable TMargins iMargin2; |
|
78 }; |
|
79 |
|
80 #endif /*HUIFXFILTER_H_*/ |