|
1 /* |
|
2 * Copyright (c) 2008-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: Cloud View Context menu control |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef GLXTAGSCONTEXTMENUCONTROL_H_ |
|
19 #define GLXTAGSCONTEXTMENUCONTROL_H_ |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <e32std.h> |
|
23 #include <alf/alfcontrol.h> |
|
24 #include "glxbubbletimer.h" //for timer functionality |
|
25 |
|
26 //Forward Declaration |
|
27 class CAlfGridLayout; |
|
28 class CGlxUiUtility; |
|
29 |
|
30 /** |
|
31 *MGlxItemMenuObserver is a class to handle the menu items in grid layout |
|
32 */ |
|
33 class MGlxItemMenuObserver |
|
34 { |
|
35 public: |
|
36 /** |
|
37 * To Handle menu items in Grid layout |
|
38 * @param aCommand command to be handled |
|
39 */ |
|
40 virtual void HandleGridMenuListL(TInt aCommand) = 0; |
|
41 }; |
|
42 |
|
43 class CGlxTagsContextMenuControl : public CAlfControl, public MGlxTimerNotifier |
|
44 |
|
45 { |
|
46 public: |
|
47 /** |
|
48 * Perform the two phase construction |
|
49 * @param aItemMenuObserver - handles the menu items in grid layout |
|
50 * @return Pointer to newly created object |
|
51 */ |
|
52 static CGlxTagsContextMenuControl* NewL( MGlxItemMenuObserver& aItemMenuObserver ); |
|
53 /** |
|
54 * Perform the two phase construction |
|
55 * @param aItemMenuObserver - handles the menu items in grid layout |
|
56 * @return Pointer to newly created object |
|
57 */ |
|
58 static CGlxTagsContextMenuControl* NewLC( MGlxItemMenuObserver& aItemMenuObserver ); |
|
59 /** |
|
60 * Destroy the object and release all memory objects |
|
61 */ |
|
62 ~CGlxTagsContextMenuControl(); |
|
63 |
|
64 public://MGlxTimernotifier |
|
65 /** |
|
66 * Virtual Function from MGlxTimernotifier |
|
67 */ |
|
68 void TimerComplete(); |
|
69 |
|
70 public: |
|
71 /** |
|
72 * Sets the grid layout on the screen with the Point specified |
|
73 * @param aPoint - Point from which grid has to be displayed |
|
74 */ |
|
75 void SetDisplay(const TPoint& aPoint); |
|
76 /** |
|
77 * Hides/shows the grid layout |
|
78 * @param aOpacity - Opacity value |
|
79 */ |
|
80 void ShowItemMenu(TBool aOpacity); |
|
81 |
|
82 /** |
|
83 * Sets the drawable screen rect |
|
84 * It also handles coordinates changed from Orientation |
|
85 * @param aRect - rect area where the Tags are drawn |
|
86 */ |
|
87 void SetViewableRect(TRect aRect); |
|
88 |
|
89 private: |
|
90 /** |
|
91 * constructor |
|
92 * @param aItemMenuObserver - handles the menu items in grid layout |
|
93 */ |
|
94 CGlxTagsContextMenuControl( MGlxItemMenuObserver& aItemMenuObserver ); |
|
95 |
|
96 /** |
|
97 * Perform the second phase of two phase construction |
|
98 */ |
|
99 void ConstructL(); |
|
100 |
|
101 /** |
|
102 * Creates the font |
|
103 * @return the fontId |
|
104 */ |
|
105 TInt CreateFontL(); |
|
106 /** |
|
107 * Creates the menulist and sets the Text style |
|
108 * @param aFontId - Sets the text style |
|
109 */ |
|
110 void CreateMenuListL(TInt aFontId); |
|
111 |
|
112 /** |
|
113 * Perform the two phase construction |
|
114 * @param aEvent - key Event to handle |
|
115 * @return EKeyWasConsumed if key event is processed, |
|
116 * otherwise EKeyWasNotConsumed |
|
117 */ |
|
118 TBool OfferEventL(const TAlfEvent& aEvent); |
|
119 |
|
120 private: |
|
121 |
|
122 //Ui Utility, not owning, only close |
|
123 CGlxUiUtility* iUiUtility; |
|
124 |
|
125 // Background Image Visual |
|
126 CAlfImageVisual* iBackgroundBorderImageVisual; |
|
127 |
|
128 //Observer to handle the menu items in grid layout |
|
129 MGlxItemMenuObserver& iItemMenuObserver; |
|
130 |
|
131 //Grid layout, not owning |
|
132 CAlfGridLayout* iGrid; |
|
133 |
|
134 //Slideshow text, not owning |
|
135 CAlfTextVisual* iSlideshowTextVisual; |
|
136 |
|
137 //Delete text, not owning |
|
138 CAlfTextVisual* iDeleteTextVisual; |
|
139 |
|
140 //Rename text, not owning |
|
141 CAlfTextVisual* iRenameTextVisual; |
|
142 |
|
143 // Anchor Layout |
|
144 CAlfAnchorLayout* iMainVisual; |
|
145 |
|
146 //variable used for providing delay |
|
147 CGlxBubbleTimer* iTimer; |
|
148 |
|
149 //Viewable rect |
|
150 TRect iViewableRect; |
|
151 |
|
152 //flag for stylus menu visibility |
|
153 TBool iItemMenuVisibility; |
|
154 }; |
|
155 |
|
156 #endif /* GLXTAGSCONTEXTMENUCONTROL_H_ */ |