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: Long Tap Detector with animation informing of long tap functionality
20 #ifndef CAKNLONGTAPDETECTORCONTROLLER_H
21 #define CAKNLONGTAPDETECTORCONTROLLER_H
28 * Avkon LongTapDetector CallBack.
30 * Inherit from this class and implement HandleLongTapEventL to
31 * get a callback when/if a long tap occurs.
36 class MAknLongTapDetectorCallBack
40 * Callback method. Get's called when a long tap occurs.
41 * @param aPenEventLocation Long tap event location relative to parent control.
42 * @param aPenEventScreenLocation Long tap event location relative to screen.
44 virtual void HandleLongTapEventL( const TPoint& aPenEventLocation,
45 const TPoint& aPenEventScreenLocation ) = 0;
50 * Avkon Long Tap Detector.
52 * Receives pointer events from owner application or owner control and returns
53 * location if a long tap event occurs.
54 * After short period of time (default 0,15s) animation is displayed next to stylus on the screen to
55 * inform the user of long tap functionality. Animation can be turned OFF by application if wanted.
60 NONSHARABLE_CLASS( CAknLongTapDetector ) : public CTimer, MCoeMessageMonitorObserver
62 public: // Constructors and destructor
65 * Two-phased constructor.
66 * @param aOwner Pointer to owner of this component. Ownership not transferred.
68 IMPORT_C static CAknLongTapDetector* NewL( MAknLongTapDetectorCallBack* aOwner );
71 * Two-phased constructor.
72 * @param aOwner Pointer to owner of this component. Ownership not transferred.
74 IMPORT_C static CAknLongTapDetector* NewLC( MAknLongTapDetectorCallBack* aOwner );
79 virtual ~CAknLongTapDetector();
81 public: // New functions
84 * Receives and handles pointer events from owner's HandlePointerEventL() -method.
85 * Used to control timers in detecting long tap events.
86 * @param aEvent Pointer event from owner.
88 IMPORT_C void PointerEventL( const TPointerEvent& aEvent );
91 * Sets new time delay before long tap detector animation starts. Default delay is 0,15s.
92 * @param aMicroSeconds New delay in microseconds.
94 IMPORT_C void SetTimeDelayBeforeAnimation( const TInt aMicroSeconds );
97 * Sets new time delay before long tap detector event is returned. Default delay is 0,8s.
98 * @param aMicroSeconds New delay in microseconds.
100 IMPORT_C void SetLongTapDelay( const TInt aMicroSeconds );
103 * Sets long tap animation ON/OFF. Default is ON.
104 * @param aAnimation ETrue turns animations ON and EFalse turns animations OFF.
106 IMPORT_C void EnableLongTapAnimation( const TBool aAnimation );
109 * Checks if the animation is running
110 * @return ETrue if the animation is running, EFalse if not
112 IMPORT_C TBool IsAnimationRunning() const;
115 * Cancels the long tap animation
117 IMPORT_C void CancelAnimationL();
120 * This function is used to capture key events during the longtap animation.
121 * If such events are received, the longtap animation is then cancelled (TSW Error
124 void MonitorWsMessage(const TWsEvent& aEvent);
126 private: // From CActive
129 * Handles CTimer events. Called by system framework.
133 private: // Constructors
136 * C++ default constructor.
137 * @param aOwner Owner.
139 CAknLongTapDetector( MAknLongTapDetectorCallBack* aOwner );
142 * By default Symbian 2nd phase constructor is private.
146 private: // New functions
148 void StartAnimationL();
149 void StopAnimationL();
153 enum TLongTapDetectorState
155 EWaiting, // normal state
156 EWaitingForAnimation, // Only "Pen down" event received, CTimer started
157 EShowingAnimation // Long tap animation started
161 * Current state of LongTapDetector.
163 TLongTapDetectorState iState;
166 * Pointer to owner of this LongTapDetector object.
169 MAknLongTapDetectorCallBack* iOwner;
172 * Delay before animation starts in microseconds.
174 TInt iTimeDelayBeforeAnimation;
177 * Delay before long tap event is reported in microseconds.
182 * Pointer event received from owner.
184 TPointerEvent iPointerEvent;
187 * Is long tap animation shown or not.
189 TBool iShowAnimation;
193 #endif // CAKNLONGTAPDETECTOR_H