|
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: CCActivePaletteContainer declaration. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef ACTIVEPALETTECONTAINER_H |
|
19 #define ACTIVEPALETTECONTAINER_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32std.h> |
|
23 #include <e32base.h> |
|
24 #include <coecntrl.h> |
|
25 #include <coeview.h> |
|
26 #include <activepalette2observer.h> |
|
27 |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CActivePalette2ApiTest; |
|
31 class MActivePalette2UI; |
|
32 |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * CCActivePaletteContainer |
|
38 * |
|
39 */ |
|
40 class CActivePaletteContainer : public CCoeControl, |
|
41 public MCoeView, |
|
42 public MActivePalette2Observer |
|
43 { |
|
44 public: |
|
45 |
|
46 // Constructors and destructor |
|
47 void ConstructL(CActivePalette2ApiTest* aTest); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 ~CActivePaletteContainer(); |
|
53 |
|
54 // ------------------------------------------------------------------------- |
|
55 // From CCoeControl |
|
56 public: |
|
57 virtual TInt CountComponentControls() const; |
|
58 virtual CCoeControl* ComponentControl(TInt aIndex) const; |
|
59 virtual void Draw(const TRect &aRect) const; |
|
60 |
|
61 virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); |
|
62 protected: |
|
63 virtual void SizeChanged(); |
|
64 |
|
65 // ------------------------------------------------------------------------- |
|
66 // From MCoeView |
|
67 public: |
|
68 virtual TVwsViewId ViewId() const; |
|
69 private: |
|
70 virtual void ViewActivatedL(const TVwsViewId &aPrevViewId, TUid aCustomMessageId, const TDesC8 &aCustomMessage); |
|
71 virtual void ViewDeactivated(); |
|
72 |
|
73 // ------------------------------------------------------------------------- |
|
74 // From MActivePalette2Observer |
|
75 public: |
|
76 /** |
|
77 * Called when a new item is focused |
|
78 * @param aPrevItem Item ID of previously focused item |
|
79 * @param aFocusedItem Item ID of newly focused item |
|
80 */ |
|
81 virtual void NotifyItemFocused(TInt aPrevItem, TInt aFocusedItem); |
|
82 |
|
83 /** |
|
84 * Called when the user has selected an item from the AP, before the plugin is informed |
|
85 * @param aEvent The event data |
|
86 */ |
|
87 virtual void NotifyItemSelected(const TActivePalette2EventData& aEvent); |
|
88 |
|
89 /** |
|
90 * Called when the user has selected an item from the AP, after the relevant plugin |
|
91 * has completed processing the event |
|
92 * @param aEvent The event data |
|
93 * @param aDataDes Data descriptor |
|
94 * @param aDataInt Data integer |
|
95 */ |
|
96 virtual void NotifyItemComplete(const TActivePalette2EventData& aEvent, |
|
97 const TDesC8& aDataDes, |
|
98 TInt aDataInt); |
|
99 |
|
100 /** |
|
101 * Called when a plugin generates a message for the client app. |
|
102 * @param aEvent The event data |
|
103 * @param aMessageID The ID of the message |
|
104 * @param aDataDes Data descriptor |
|
105 * @param aDataInt Data integer |
|
106 */ |
|
107 virtual void NotifyMessage(const TActivePalette2EventData& aEvent, |
|
108 TInt aMessageID, |
|
109 const TDesC8& aDataDes, |
|
110 TInt aDataInt); |
|
111 |
|
112 /** |
|
113 * Request for the client app to redraw the given area underneath the AP. Used to support semi-transparency. |
|
114 * It is important that this completes quickly. This will only be called if a CCoeControl-derived AP is |
|
115 * in use. |
|
116 * @param aArea The area to redraw. |
|
117 */ |
|
118 virtual void Redraw(const TRect& aArea); |
|
119 |
|
120 /** |
|
121 * Informs the observer that the AP has been updated in some way. Includes animations. |
|
122 * Only called if SetGc() has previously been called on the AP with a non-NULL parameter, and if the AP |
|
123 * in use is a CCoeControl. |
|
124 */ |
|
125 virtual void ActivePaletteUpdated(void); |
|
126 |
|
127 // ------------------------------------------------------------------------- |
|
128 // New methods |
|
129 public: |
|
130 |
|
131 /** |
|
132 * Get the Active Palette instance. |
|
133 */ |
|
134 MActivePalette2UI* ActivePalette() const; |
|
135 |
|
136 private: |
|
137 |
|
138 /** |
|
139 * Create Active Palette. |
|
140 */ |
|
141 void CreateActivePaletteL(); |
|
142 |
|
143 /** |
|
144 * Helper method to trace the Active Palette Event details. |
|
145 * @param aEvent The event. |
|
146 */ |
|
147 void CheckActivePaletteEvent( const TActivePalette2EventData& aEvent ); |
|
148 |
|
149 // ------------------------------------------------------------------------- |
|
150 // Data |
|
151 private: |
|
152 |
|
153 CActivePalette2ApiTest* iTest; |
|
154 MActivePalette2UI* iActivePalette; |
|
155 TUid iAppUid; |
|
156 |
|
157 // ------------------------------------------------------------------------- |
|
158 }; |
|
159 |
|
160 #endif // ACTIVEPALETTECONTAINER_H |