|
1 /* |
|
2 * Copyright (c) 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 "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 #ifndef HGVGBUTTON_H_ |
|
19 #define HGVGBUTTON_H_ |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32base.h> |
|
23 #include <coemain.h> |
|
24 #include <VG/openvg.h> |
|
25 |
|
26 class MHgVgMediaWallButtonObserver; |
|
27 class CGulIcon; |
|
28 |
|
29 /** |
|
30 * Button class, which draws buttons using OpenVG. |
|
31 */ |
|
32 NONSHARABLE_CLASS(CHgVgButton) : public CBase |
|
33 { |
|
34 public: |
|
35 |
|
36 /** |
|
37 * Creates new CHgVgButton. |
|
38 * |
|
39 * @param aSize sizeof the button. |
|
40 * @param aPosition position of the button. |
|
41 * @return HgVgButton-object |
|
42 */ |
|
43 static CHgVgButton* NewL (const TSize& aSize, const TPoint& aPosition, |
|
44 const CGulIcon& aIcon); |
|
45 |
|
46 // Destructor. |
|
47 virtual ~CHgVgButton(); |
|
48 |
|
49 private: |
|
50 CHgVgButton(const TSize& aSize, const TPoint& aPosition); |
|
51 |
|
52 void ConstructL(const CGulIcon& aIcon); |
|
53 |
|
54 public: // METHODS |
|
55 |
|
56 /** |
|
57 * |
|
58 */ |
|
59 TBool HandlePointerEvent(const TPointerEvent& aEvent); |
|
60 |
|
61 /** |
|
62 * |
|
63 */ |
|
64 TBool IsEnabled() const; |
|
65 |
|
66 |
|
67 /** |
|
68 * |
|
69 */ |
|
70 const TPoint& Position() const; |
|
71 |
|
72 /** |
|
73 * |
|
74 */ |
|
75 const TSize& Size() const; |
|
76 |
|
77 /** |
|
78 * |
|
79 */ |
|
80 void SetEnabled(TBool aEnabled); |
|
81 |
|
82 /** |
|
83 * |
|
84 */ |
|
85 void SetPosition(const TPoint& aPosition); |
|
86 |
|
87 /** |
|
88 * |
|
89 */ |
|
90 void SetSize(const TSize& aSize); |
|
91 |
|
92 /** |
|
93 * |
|
94 */ |
|
95 void Draw(const TRect& aWindowRect, TReal aAlpha=1); |
|
96 |
|
97 private: |
|
98 |
|
99 TSize iSize; |
|
100 TPoint iPosition; |
|
101 VGImage iImage; |
|
102 TBool iEnabled; |
|
103 TBool iPointerDown; |
|
104 |
|
105 }; |
|
106 |
|
107 #endif /* HGVGBUTTON_H */ |