00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef CAKNSTYLUSPOPUPMENU_H
00022 #define CAKNSTYLUSPOPUPMENU_H
00023
00024
00025 #include <e32base.h>
00026 #include <coecobs.h>
00027
00028 class CAknPreviewPopUpController;
00029 class CAknStylusPopUpMenuContent;
00030 class MEikMenuObserver;
00031 class TResourceReader;
00032
00047 NONSHARABLE_CLASS( CAknStylusPopUpMenu ) : public CBase,
00048 public MCoeControlObserver
00049 {
00050 public:
00051 enum TPositionType
00052 {
00053 EPositionTypeRightTop = 0,
00054 EPositionTypeLeftTop,
00055 EPositionTypeRightBottom,
00056 EPositionTypeLeftBottom
00057 };
00067 IMPORT_C static CAknStylusPopUpMenu* NewL( MEikMenuObserver* aObserver,
00068 const TPoint& aPoint,
00069 CAknPreviewPopUpController* aPopup );
00070
00078 IMPORT_C static CAknStylusPopUpMenu* NewL( MEikMenuObserver* aObserver,
00079 const TPoint& aPoint );
00080
00090 IMPORT_C static CAknStylusPopUpMenu* NewLC( MEikMenuObserver* aObserver,
00091 const TPoint& aPoint,
00092 CAknPreviewPopUpController* aPopup );
00096 ~CAknStylusPopUpMenu();
00097
00106 IMPORT_C void AddMenuItemL( const TDesC& aItem, const TInt aCommandId );
00107
00113 IMPORT_C void RemoveMenuItem( const TInt aCommandId );
00114
00121 IMPORT_C void SetItemDimmed( const TInt aCommandId, const TBool aDimmed );
00122
00127 IMPORT_C void ShowMenu();
00128
00136 IMPORT_C void SetPosition( const TPoint& aPoint );
00145 IMPORT_C void SetPosition( const TPoint& aPoint, TPositionType aPosType );
00146
00151 void UpdatePosition();
00152
00153
00159 IMPORT_C void ConstructFromResourceL( TResourceReader& aReader );
00160
00161
00162
00169 IMPORT_C void HandleControlEventL( CCoeControl* aControl,
00170 TCoeEvent aEventType );
00171
00172 public:
00173
00177 void ResetTimer();
00178
00179 private:
00180
00190 CAknStylusPopUpMenu( MEikMenuObserver* aObserver, const TPoint& aPoint,
00191 CAknPreviewPopUpController* aPopup );
00192
00196 void ConstructL();
00197
00198 private:
00199
00203 TPoint iPosition;
00204
00209 CAknPreviewPopUpController* iController;
00210
00215 CAknStylusPopUpMenuContent* iContent;
00216
00221 MEikMenuObserver* iMenuObserver;
00222
00230 CAknPreviewPopUpController* iPreviewPopup;
00231
00232 };
00233
00234
00235 #endif // CAKNSTYLUSPOPUPMENU_H