Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Interface for controlling stylus specific popup menu.
19 #ifndef CAKNSTYLUSPOPUPMENU_H
20 #define CAKNSTYLUSPOPUPMENU_H
24 #include <coecobs.h> // MCoeControlObserver
26 class CAknPreviewPopUpController;
27 class CAknStylusPopUpMenuContent;
28 class MEikMenuObserver;
29 class TResourceReader;
32 * Stylus specific popup menu
34 * A floating popup menu which is meant for stylus usage only.
35 * The menu appears near to the tapping position. When an item is
36 * tapped the menu calls its observer's (iMenuObserver) ProcessCommandL.
37 * Typically the observer is application's AppUi. It is then the
38 * observer's responsibility to handle the command appropriately.
39 * The observer is informed with KErrCancel if the menu is closed without
45 NONSHARABLE_CLASS( CAknStylusPopUpMenu ) : public CBase,
46 public MCoeControlObserver
51 EPositionTypeRightTop = 0,
53 EPositionTypeRightBottom,
54 EPositionTypeLeftBottom
57 * Two-phased constructor
59 * @param aObserver Menu observer (not owned) that handles
60 * stylus popup events.
61 * @param aPoint The position where stylus was tapped
62 * @param aPopup Preview popup from which stylus popup
63 * menu was launched, can be NULL.
65 IMPORT_C static CAknStylusPopUpMenu* NewL( MEikMenuObserver* aObserver,
67 CAknPreviewPopUpController* aPopup );
70 * Two-phased constructor
72 * @param aObserver Menu observer (not owned) that handles
73 * stylus popup events.
74 * @param aPoint The position where stylus was tapped
76 IMPORT_C static CAknStylusPopUpMenu* NewL( MEikMenuObserver* aObserver,
77 const TPoint& aPoint );
80 * Two-phased constructor
82 * @param aObserver Menu observer (not owned) that handles
83 * stylus popup events.
84 * @param aPoint The position where stylus was tapped
85 * @param aPopup Preview popup from which stylus popup
86 * menu was launched, can be NULL.
88 IMPORT_C static CAknStylusPopUpMenu* NewLC( MEikMenuObserver* aObserver,
90 CAknPreviewPopUpController* aPopup );
94 ~CAknStylusPopUpMenu();
97 * Adds a menu item. If the menu contains maximum amount of
98 * items, the function will do nothing. Inserted item will be
101 * @param aItem The menu item to be added.
102 * @param aCommandId Item's command id.
104 IMPORT_C void AddMenuItemL( const TDesC& aItem, const TInt aCommandId );
107 * Removes a menu item.
109 * @param aCommandId Command id of the item to be removed.
111 IMPORT_C void RemoveMenuItem( const TInt aCommandId );
114 * Hides / shows a menu item.
116 * @param aCommandId Command id of the item to be hidden / shown.
117 * @param aDimmed ETrue to hide item and EFalse to show item
119 IMPORT_C void SetItemDimmed( const TInt aCommandId, const TBool aDimmed );
122 * Shows the stylus popup menu. If it's already visible,
125 IMPORT_C void ShowMenu();
128 * Sets the position of the stylus popup menu.
129 * Position will be adjusted if the menu doesn't fit on the screen
132 * @param aPoint Position of the left-top corner of the stylus popup menu.
134 IMPORT_C void SetPosition( const TPoint& aPoint );
136 * Sets the position of the stylus popup menu.
137 * Position will be adjusted if the menu doesn't fit on the screen
140 * @param aPoint Position of the stylus popup menu.
141 * @param aPosType Position type e.g. left-top corner or right-top corner
143 IMPORT_C void SetPosition( const TPoint& aPoint, TPositionType aPosType );
146 * Tells the popup menu to recalculate its position. This can be used e.g.
147 * after layout transition.
149 void UpdatePosition();
150 // from base class CCoeControl
153 * Constructs the menu from resource.
155 * @param aReader Resource reader.
157 IMPORT_C void ConstructFromResourceL( TResourceReader& aReader );
159 // from base class MCoeControlObserver
162 * Method to handle events that occur when user selects a menu item.
164 * @param aControl The control that sent the event.
165 * @param aEventType The event type.
167 IMPORT_C void HandleControlEventL( CCoeControl* aControl,
168 TCoeEvent aEventType );
173 * Resets timer that hides popup.
180 * Default constructor
182 * @param aObserver Menu observer (not owned) that handles
183 * stylus popup events.
184 * @param aPoint The position where stylus was tapped
185 * @param aPopup Preview popup from which stylus popup
186 * menu was launched, can be NULL.
188 CAknStylusPopUpMenu( MEikMenuObserver* aObserver, const TPoint& aPoint,
189 CAknPreviewPopUpController* aPopup );
192 * 2nd phase constructor
199 * Screen relative position where stylus was tapped.
204 * Controller for the actual popup.
207 CAknPreviewPopUpController* iController;
213 CAknStylusPopUpMenuContent* iContent;
216 * Observer which will be used to forward selected menu command id.
219 MEikMenuObserver* iMenuObserver;
222 * Preview popup which launches stylus popup menu.
223 * If NULL, menu wasn't launched from a preview popup.
224 * If not NULL, stylus popup menu will close also the preview popup
225 * when an option is selected in the stylus popup menu.
228 CAknPreviewPopUpController* iPreviewPopup;
233 #endif // CAKNSTYLUSPOPUPMENU_H