|
1 /* |
|
2 * Copyright (c) 2006 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 "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: Handles the viewing of a single frame. If the page is not frame |
|
15 * enabled, this class is used as the single view. If frame |
|
16 * enabled, there is one instance of this class for each frame. |
|
17 * |
|
18 */ |
|
19 |
|
20 #ifndef WEBSPRITE_H_ |
|
21 #define WEBSPRITE_H_ |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <w32std.h> |
|
25 #include <coecntrl.h> |
|
26 |
|
27 class CFbsBitmap; |
|
28 |
|
29 |
|
30 NONSHARABLE_CLASS(CWebSprite) : public CCoeControl |
|
31 { |
|
32 public: |
|
33 static CWebSprite* NewL(TPoint& aPos, CFbsBitmap* aBitmap, CFbsBitmap* aMask, |
|
34 TBool aInvertMask); |
|
35 static CWebSprite* NewL(CCoeControl* aParent, TPoint& aPos, CFbsBitmap* aBitmap, |
|
36 CFbsBitmap* aMask, TBool aInvertMask); |
|
37 CWebSprite(); |
|
38 virtual ~CWebSprite(); |
|
39 |
|
40 void Update(const TPoint& aPos, CFbsBitmap* aBitmap, CFbsBitmap* aMask); |
|
41 void Update(CFbsBitmap* aBitmap, CFbsBitmap* aMask); |
|
42 void Update(CFbsBitmap* aBitmap, CFbsBitmap* aMask, TBool aInvertMask); |
|
43 void SetBitmap(CFbsBitmap* aBitmap, CFbsBitmap* aMask, TBool aInvertMask); |
|
44 void Hide(); |
|
45 void Show(); |
|
46 void Draw(const TRect& aRect) const; |
|
47 void SetPos(const TPoint& aPos); |
|
48 TPoint GetPos() { return Position(); } |
|
49 TBool IsShown(); |
|
50 |
|
51 protected: |
|
52 void BaseConstructL(TPoint& aPos, CFbsBitmap* aBitmap, CFbsBitmap* aMask, |
|
53 TBool aInvertMask); |
|
54 void BaseConstructL(CCoeControl* aParent, TPoint& aPos, CFbsBitmap* aBitmap, |
|
55 CFbsBitmap* aMask, TBool aInvertMask); |
|
56 private: |
|
57 CWebSprite(CCoeControl* aParent, CFbsBitmap* aBitmap, CFbsBitmap* aMask, TBool aInvertMask); |
|
58 void ConstructL(TPoint& aPos); |
|
59 void ConstructL(CCoeControl* aParent, TPoint& aPos); |
|
60 void init(TPoint& aPos, TSize aSize); |
|
61 void CreateSprite(TPoint& aPos); |
|
62 void UpdateSprite(); |
|
63 |
|
64 private: |
|
65 CFbsBitmap* iBitmap; |
|
66 CFbsBitmap* iMask; |
|
67 TBool iInvertMask; |
|
68 |
|
69 RWsSprite iSprite; |
|
70 RWindow* iWin; |
|
71 CCoeControl* iParent; |
|
72 }; |
|
73 |
|
74 #endif /* WEBSPRITE_H_ */ |