Move virtual destructor position to its original
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / control-impl.h
1 #ifndef DALI_TOOLKIT_CONTROL_IMPL_H
2 #define DALI_TOOLKIT_CONTROL_IMPL_H
3
4 /*
5  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/adaptor-framework/style-change.h>
23 #include <dali/public-api/events/long-press-gesture.h>
24 #include <dali/public-api/events/pan-gesture.h>
25 #include <dali/public-api/events/pinch-gesture.h>
26 #include <dali/public-api/events/tap-gesture.h>
27 #include <dali/public-api/object/property-index-ranges.h>
28 #include <dali/public-api/object/type-info.h>
29
30 // INTERNAL INCLUDES
31 #include <dali-toolkit/public-api/controls/control.h>
32
33 namespace Dali
34 {
35 namespace Toolkit
36 {
37
38 /**
39  * @addtogroup dali_toolkit_controls
40  * @{
41  */
42
43 class StyleManager;
44 class TransitionData;
45
46 namespace Visual
47 {
48 class Base;
49 }
50
51 namespace Internal
52 {
53
54 /**
55  * @brief This is the internal base class for all controls.
56  *
57  * It will provide some common functionality required by all controls.
58  * Implements ConnectionTrackerInterface so that signals (typically connected to member functions) will
59  * be disconnected automatically when the control is destroyed.
60  * @SINCE_1_0.0
61  */
62 class DALI_IMPORT_API Control : public CustomActorImpl, public ConnectionTrackerInterface
63 {
64 protected:
65   /**
66    * @brief Virtual destructor.
67    * @SINCE_1_0.0
68    */
69   virtual ~Control();
70
71 public:
72
73   class Extension; ///< Forward declare future extension interface
74
75   // Creation & Destruction
76
77   /**
78    * @brief Create a new ControlImpl instance that does not require touch by default.
79    *
80    * If touch is required then the user can connect to this class' touch signal.
81    * @SINCE_1_0.0
82    * @return A handle to the ControlImpl instance.
83    */
84   static Toolkit::Control New();
85
86   // Styling
87
88   /**
89    * @copydoc Dali::Toolkit::Control::SetStyleName
90    */
91   void SetStyleName( const std::string& styleName );
92
93   /**
94    * @copydoc Dali::Toolkit::Control::GetStyleName
95    */
96   const std::string& GetStyleName() const;
97
98   // Background
99
100   /**
101    * @copydoc Dali::Toolkit::Control::SetBackgroundColor
102    */
103   void SetBackgroundColor( const Vector4& color );
104
105   /**
106    * @copydoc Dali::Toolkit::Control::GetBackgroundColor
107    */
108   Vector4 GetBackgroundColor() const;
109
110   /**
111    * @copydoc Dali::Toolkit::Control::SetBackgroundImage
112    */
113   void SetBackgroundImage( Image image );
114
115   /**
116    * @brief Set the background with a property map.
117    *
118    * @SINCE_1_0.0
119    * @param[in] map The background property map.
120    */
121   void SetBackground(const Property::Map& map);
122
123   /**
124    * @copydoc Dali::Toolkit::Control::ClearBackground
125    */
126   void ClearBackground();
127
128   // Gesture Detection
129
130   /**
131    * @brief Allows deriving classes to enable any of the gesture detectors that are available.
132    *
133    * Gesture detection can be enabled one at a time or in bitwise format as shown:
134    * @code
135    * EnableGestureDetection(Gesture::Type(Gesture::Pinch | Gesture::Tap | Gesture::Pan));
136    * @endcode
137    * @SINCE_1_0.0
138    * @param[in]  type  The gesture type(s) to enable.
139    */
140   void EnableGestureDetection( Gesture::Type type );
141
142   /**
143    * @brief Allows deriving classes to disable any of the gesture detectors.
144    *
145    * Like EnableGestureDetection, this can also be called using bitwise or.
146    * @SINCE_1_0.0
147    * @param[in]  type  The gesture type(s) to disable.
148    * @see EnableGetureDetection
149    */
150   void DisableGestureDetection( Gesture::Type type );
151
152   /**
153    * @brief If deriving classes wish to fine tune pinch gesture
154    * detection then they can access the gesture detector through this
155    * API and modify the detection.
156    *
157    * @SINCE_1_0.0
158    * @return The pinch gesture detector.
159    * @pre Pinch detection should have been enabled via EnableGestureDetection().
160    * @see EnableGestureDetection
161    */
162   PinchGestureDetector GetPinchGestureDetector() const;
163
164   /**
165    * @brief If deriving classes wish to fine tune pan gesture
166    * detection then they can access the gesture detector through this
167    * API and modify the detection.
168    *
169    * @SINCE_1_0.0
170    * @return The pan gesture detector.
171    * @pre Pan detection should have been enabled via EnableGestureDetection().
172    * @see EnableGestureDetection
173    */
174   PanGestureDetector GetPanGestureDetector() const;
175
176   /**
177    * @brief If deriving classes wish to fine tune tap gesture
178    * detection then they can access the gesture detector through this
179    * API and modify the detection.
180    *
181    * @SINCE_1_0.0
182    * @return The tap gesture detector.
183    * @pre Tap detection should have been enabled via EnableGestureDetection().
184    * @see EnableGestureDetection
185    */
186   TapGestureDetector GetTapGestureDetector() const;
187
188   /**
189    * @brief If deriving classes wish to fine tune long press gesture
190    * detection then they can access the gesture detector through this
191    * API and modify the detection.
192    *
193    * @SINCE_1_0.0
194    * @return The long press gesture detector.
195    * @pre Long press detection should have been enabled via EnableGestureDetection().
196    * @see EnableGestureDetection
197    */
198   LongPressGestureDetector GetLongPressGestureDetector() const;
199
200   // Keyboard Navigation
201
202   /**
203    * @brief Sets whether this control supports two dimensional
204    * keyboard navigation (i.e. whether it knows how to handle the
205    * keyboard focus movement between its child actors).
206    *
207    * The control doesn't support it by default.
208    * @SINCE_1_0.0
209    * @param[in] isSupported Whether this control supports two dimensional keyboard navigation.
210    */
211   void SetKeyboardNavigationSupport( bool isSupported );
212
213   /**
214    * @brief Gets whether this control supports two dimensional keyboard navigation.
215    *
216    * @SINCE_1_0.0
217    * @return true if this control supports two dimensional keyboard navigation.
218    */
219   bool IsKeyboardNavigationSupported();
220
221   // Key Input
222
223   /**
224    * @copydoc Toolkit::Control::SetKeyInputFocus()
225    */
226   void SetKeyInputFocus();
227
228   /**
229    * @copydoc Toolkit::Control::HasKeyInputFocus()
230    */
231   bool HasKeyInputFocus();
232
233   /**
234    * @copydoc Toolkit::Control::ClearKeyInputFocus()
235    */
236   void ClearKeyInputFocus();
237
238   // Keyboard Focus
239
240   /**
241    * @brief Sets whether this control is a focus group for keyboard navigation.
242    *
243    * (i.e. the scope of keyboard focus movement
244    * can be limitied to its child actors). The control is not a focus group by default.
245    * @SINCE_1_0.0
246    * @param[in] isFocusGroup Whether this control is set as a focus group for keyboard navigation.
247    */
248   void SetAsKeyboardFocusGroup( bool isFocusGroup );
249
250   /**
251    * @brief Gets whether this control is a focus group for keyboard navigation.
252    *
253    * @SINCE_1_0.0
254    * @return true if this control is set as a focus group for keyboard navigation.
255    */
256   bool IsKeyboardFocusGroup();
257
258   /// @cond internal
259   /**
260    * @brief Called by the AccessibilityManager to activate the Control.
261    * @SINCE_1_0.0
262    */
263   DALI_INTERNAL void AccessibilityActivate();
264
265   /**
266    * @brief Called by the KeyboardFocusManager.
267    * @SINCE_1_0.0
268    */
269   DALI_INTERNAL void KeyboardEnter();
270   /// @endcond
271
272   // Signals
273
274   /**
275    * @copydoc Dali::Toolkit::Control::KeyEventSignal()
276    */
277   Toolkit::Control::KeyEventSignalType& KeyEventSignal();
278
279   /**
280    * @copydoc Dali::Toolkit::Control::KeyInputFocusGainedSignal()
281    */
282   Toolkit::Control::KeyInputFocusSignalType& KeyInputFocusGainedSignal();
283
284   /**
285    * @copydoc Dali::Toolkit::Control::KeyInputFocusLostSignal()
286    */
287   Toolkit::Control::KeyInputFocusSignalType& KeyInputFocusLostSignal();
288
289   /// @cond internal
290   /**
291    * @brief Called by the KeyInputFocusManager to emit key event signals.
292    *
293    * @SINCE_1_0.0
294    * @param[in] event The key event.
295    * @return True if the event was consumed.
296    */
297   DALI_INTERNAL bool EmitKeyEventSignal( const KeyEvent& event );
298   /// @endcond
299
300 protected: // For derived classes to call
301
302   /**
303    * @brief Register a visual by Property Index, linking an Actor to visual when required.
304    * In the case of the visual being an actor or control deeming visual not required then visual should be an empty handle.
305    * No parenting is done during registration, this should be done by derived class.
306    *
307    * @SINCE_1_2.0
308    *
309    * @param[in] index The Property index of the visual, used to reference visual
310    * @param[in] visual The visual to register
311    * @note Derived class should not call visual.SetOnStage(actor). It is the responsibility of the base class to connect/disconnect registered visual to stage.
312    *       Use below API with enabled set to false if derived class wishes to control when visual is staged.
313    */
314   void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual );
315
316   /**
317    * @brief Register a visual by Property Index, linking an Actor to visual when required.
318    * In the case of the visual being an actor or control deeming visual not required then visual should be an empty handle.
319    * If enabled is false then the visual is not set on stage until enabled by the derived class.
320    * @see EnableVisual
321    *
322    * @SINCE_1_2.11
323    *
324    * @param[in] index The Property index of the visual, used to reference visual
325    * @param[in] visual The visual to register
326    * @param[in] enabled false if derived class wants to control when visual is set on stage.
327    *
328    */
329   void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled );
330
331   /**
332    * @brief Erase the entry matching the given index from the list of registered visuals
333    * @param[in] index The Property index of the visual, used to reference visual
334    *
335    * @SINCE_1_2.0
336    */
337   void UnregisterVisual( Property::Index index );
338
339   /**
340    * @brief Retrieve the visual associated with the given property index.
341    *
342    * @SINCE_1_2.2
343    *
344    * @param[in] index The Property index of the visual.
345    * @return The registered visual if exist, otherwise empty handle.
346    * @note For managing object life-cycle, do not store the returned visual as a member which increments its reference count.
347    */
348   Toolkit::Visual::Base GetVisual( Property::Index index ) const;
349
350   /**
351    * @brief Sets the given visual to be displayed or not when parent staged.
352    *
353    * @SINCE_1_2.11
354    *
355    * @param[in] index The Property index of the visual
356    * @param[in] enable flag to set enabled or disabled.
357    */
358   void EnableVisual( Property::Index index, bool enable );
359
360   /**
361    * @brief Queries if the given visual is to be displayed when parent staged.
362    *
363    * @SINCE_1_2.11
364    *
365    * @param[in] index The Property index of the visual
366    * @return bool whether visual is enabled or not
367    */
368   bool IsVisualEnabled( Property::Index index ) const;
369
370   /**
371    * @brief Create a transition effect on the control.
372    *
373    * @SINCE_1_2.12
374    *
375    * @param[in] transitionData The transition data describing the effect to create
376    * @return A handle to an animation defined with the given effect, or an empty
377    * handle if no properties match.
378    */
379   Dali::Animation CreateTransition( const Toolkit::TransitionData& transitionData );
380
381   /**
382    * @brief Emits KeyInputFocusGained signal if true else emits KeyInputFocusLost signal
383    *
384    * Should be called last by the control after it acts on the Input Focus change.
385    *
386    * @SINCE_1_0.0
387    * @param[in] focusGained True if gained, False if lost
388    */
389   void EmitKeyInputFocusSignal( bool focusGained );
390
391 protected: // From CustomActorImpl, not to be used by application developers
392
393   /**
394    * @copydoc CustomActorImpl::OnStageConnection()
395    * @note If overridden, then an up-call to Control::OnStageConnection MUST be made at the start.
396    */
397   virtual void OnStageConnection( int depth );
398
399   /**
400    * @copydoc CustomActorImpl::OnStageDisconnection()
401    * @note If overridden, then an up-call to Control::OnStageDisconnection MUST be made at the end.
402    */
403   virtual void OnStageDisconnection();
404
405   /**
406    * @copydoc CustomActorImpl::OnChildAdd()
407    * @note If overridden, then an up-call to Control::OnChildAdd MUST be made at the start.
408    */
409   virtual void OnChildAdd( Actor& child );
410
411   /**
412    * @copydoc CustomActorImpl::OnChildRemove()
413    * @note If overridden, then an up-call to Control::OnChildRemove MUST be made at the end.
414    */
415   virtual void OnChildRemove( Actor& child );
416
417   /**
418    * @copydoc CustomActorImpl::OnSizeSet()
419    * @note If overridden, then an up-call to Control::OnSizeSet MUST be made at the start.
420    */
421   virtual void OnSizeSet( const Vector3& targetSize );
422
423   /**
424    * @copydoc CustomActorImpl::OnSizeAnimation()
425    * @note If overridden, then an up-call to Control::OnSizeAnimation MUST be made at the start.
426    */
427   virtual void OnSizeAnimation( Animation& animation, const Vector3& targetSize );
428
429   /**
430    * @copydoc CustomActorImpl::OnTouchEvent()
431    */
432   virtual bool OnTouchEvent( const TouchEvent& event );
433
434   /**
435    * @copydoc CustomActorImpl::OnHoverEvent()
436    */
437   virtual bool OnHoverEvent( const HoverEvent& event );
438
439   /**
440    * @copydoc CustomActorImpl::OnKeyEvent()
441    */
442   virtual bool OnKeyEvent( const KeyEvent& event );
443
444   /**
445    * @copydoc CustomActorImpl::OnWheelEvent()
446    */
447   virtual bool OnWheelEvent( const WheelEvent& event );
448
449   /**
450    * @copydoc CustomActorImpl::OnRelayout()
451    */
452   virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
453
454   /**
455    * @copydoc CustomActorImpl::OnSetResizePolicy()
456    */
457   virtual void OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension );
458
459   /**
460    * @copydoc CustomActorImpl::GetNaturalSize()
461    */
462   virtual Vector3 GetNaturalSize();
463
464   /**
465    * @copydoc CustomActorImpl::CalculateChildSize()
466    */
467   virtual float CalculateChildSize( const Dali::Actor& child, Dimension::Type dimension );
468
469   /**
470    * @copydoc CustomActorImpl::GetHeightForWidth()
471    */
472   virtual float GetHeightForWidth( float width );
473
474   /**
475    * @copydoc CustomActorImpl::GetWidthForHeight()
476    */
477   virtual float GetWidthForHeight( float height );
478
479   /**
480    * @copydoc CustomActorImpl::RelayoutDependentOnChildren()
481    */
482   virtual bool RelayoutDependentOnChildren( Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
483
484   /**
485    * @copydoc CustomActorImpl::OnCalculateRelayoutSize()
486    */
487   virtual void OnCalculateRelayoutSize( Dimension::Type dimension );
488
489   /**
490    * @copydoc CustomActorImpl::OnLayoutNegotiated()
491    */
492   virtual void OnLayoutNegotiated( float size, Dimension::Type dimension );
493
494 protected: // Helpers for deriving classes
495
496   // Construction
497
498   /**
499    * @brief Flags for the constructor
500    * @SINCE_1_0.0
501    */
502   enum ControlBehaviour
503   {
504     CONTROL_BEHAVIOUR_DEFAULT            = 0, ///< Default behaviour: Size negotiation is enabled & listens to Style Change signal, but doesn't receive event callbacks. @SINCE_1_2_10
505     REQUIRES_STYLE_CHANGE_SIGNALS        = 1 << ( CustomActorImpl::ACTOR_FLAG_COUNT + 0 ),     ///< True if needs to monitor style change signals such as theme/font change @SINCE_1_0.0 @DEPRECATED_1_2_10
506     REQUIRES_KEYBOARD_NAVIGATION_SUPPORT = 1 << ( CustomActorImpl::ACTOR_FLAG_COUNT + 1 ),     ///< True if needs to support keyboard navigation @SINCE_1_0.0
507
508     DISABLE_STYLE_CHANGE_SIGNALS         = 1 << ( CustomActorImpl::ACTOR_FLAG_COUNT + 2 ),     ///< True if control should not monitor style change signals @SINCE_1_2_10
509
510     LAST_CONTROL_BEHAVIOUR_FLAG
511   };
512
513   static const int CONTROL_BEHAVIOUR_FLAG_COUNT = Log< LAST_CONTROL_BEHAVIOUR_FLAG - 1 >::value + 1;      ///< Total count of flags
514
515   /**
516    * @brief Control constructor
517    *
518    * @SINCE_1_0.0
519    * @param[in] behaviourFlags Behavioural flags from ControlBehaviour enum
520    */
521   Control( ControlBehaviour behaviourFlags );
522
523   /**
524    * @brief Second phase initialization.
525    * @SINCE_1_0.0
526    */
527   void Initialize();
528
529 public: // API for derived classes to override
530
531   // Lifecycle
532
533   /**
534    * @brief This method is called after the Control has been initialized.
535    *
536    * Derived classes should do any second phase initialization by overriding this method.
537    * @SINCE_1_0.0
538    */
539   virtual void OnInitialize();
540
541   /**
542    * @DEPRECATED_1_1.30. Override OnChildAdd instead.
543    *
544    * @brief Called whenever an Actor is added to the control.
545    *
546    * Could be overridden by derived classes.
547    *
548    * @SINCE_1_0.0
549    * @param[in] child The added actor.
550    */
551   virtual void OnControlChildAdd( Actor& child ) DALI_DEPRECATED_API;
552
553   /**
554    * @DEPRECATED_1_1.30. Override OnChildRemove instead.
555    *
556    * @brief Called whenever an Actor is removed from the control.
557    *
558    * Could be overridden by derived classes.
559    *
560    * @SINCE_1_0.0
561    * @param[in] child The removed actor.
562    */
563   virtual void OnControlChildRemove( Actor& child ) DALI_DEPRECATED_API;
564
565   // Styling
566
567   /**
568    * @brief This method should be overridden by deriving classes requiring notifications when the style changes.
569    *
570    * @SINCE_1_0.0
571    * @param[in] styleManager  The StyleManager object.
572    * @param[in] change  Information denoting what has changed.
573    */
574   virtual void OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change );
575
576   // Accessibility
577
578   /**
579    * @brief This method is called when the control is accessibility activated.
580    *
581    * Derived classes should override this to perform custom accessibility activation.
582    * @SINCE_1_0.0
583    * @return true if this control can perform accessibility activation.
584    */
585   virtual bool OnAccessibilityActivated();
586
587   /**
588    * @brief This method should be overridden by deriving classes when they wish to respond the accessibility
589    * pan gesture.
590    *
591    * @SINCE_1_0.0
592    * @param[in] gesture The pan gesture.
593    * @return true if the pan gesture has been consumed by this control
594    */
595   virtual bool OnAccessibilityPan( PanGesture gesture );
596
597   /**
598    * @brief This method should be overridden by deriving classes when they wish to respond the accessibility
599    * touch event.
600    *
601    * @SINCE_1_0.0
602    * @param[in] touchEvent The touch event.
603    * @return true if the touch event has been consumed by this control
604    */
605   virtual bool OnAccessibilityTouch( const TouchEvent& touchEvent );
606
607   /**
608    * @brief This method should be overridden by deriving classes when they wish to respond
609    * the accessibility up and down action (i.e. value change of slider control).
610    *
611    * @SINCE_1_0.0
612    * @param[in] isIncrease Whether the value should be increased or decreased
613    * @return true if the value changed action has been consumed by this control
614    */
615   virtual bool OnAccessibilityValueChange( bool isIncrease );
616
617   /**
618    * @brief This method should be overridden by deriving classes when they wish to respond
619    * the accessibility zoom action.
620    *
621    * @SINCE_1_0.0
622    * @return true if the zoom action has been consumed by this control
623    */
624   virtual bool OnAccessibilityZoom();
625
626   // Keyboard focus
627
628   /**
629    * @brief Called when the control gains key input focus.
630    *
631    * Should be overridden by derived classes if they need to customize what happens when focus is gained.
632    * @SINCE_1_0.0
633    */
634   virtual void OnKeyInputFocusGained();
635
636   /**
637    * @brief Called when the control loses key input focus.
638    *
639    * Should be overridden by derived classes if they need to customize what happens when focus is lost.
640    * @SINCE_1_0.0
641    */
642   virtual void OnKeyInputFocusLost();
643
644   /**
645    * @brief Gets the next keyboard focusable actor in this control towards the given direction.
646    *
647    * A control needs to override this function in order to support two dimensional keyboard navigation.
648    * @SINCE_1_0.0
649    * @param[in] currentFocusedActor The current focused actor.
650    * @param[in] direction The direction to move the focus towards.
651    * @param[in] loopEnabled Whether the focus movement should be looped within the control.
652    * @return the next keyboard focusable actor in this control or an empty handle if no actor can be focused.
653    */
654   virtual Actor GetNextKeyboardFocusableActor( Actor currentFocusedActor, Toolkit::Control::KeyboardFocus::Direction direction, bool loopEnabled );
655
656   /**
657    * @brief Informs this control that its chosen focusable actor will be focused.
658    *
659    * This allows the application to preform any actions if wishes
660    * before the focus is actually moved to the chosen actor.
661    *
662    * @SINCE_1_0.0
663    * @param[in] commitedFocusableActor The commited focusable actor.
664    */
665   virtual void OnKeyboardFocusChangeCommitted( Actor commitedFocusableActor );
666
667   /**
668    * @brief This method is called when the control has enter pressed on it.
669    *
670    * Derived classes should override this to perform custom actions.
671    * @SINCE_1_0.0
672    * @return true if this control supported this action.
673    */
674   virtual bool OnKeyboardEnter();
675
676   // Gestures
677
678   /**
679    * @brief Called whenever a pinch gesture is detected on this control.
680    *
681    * This can be overridden by deriving classes when pinch detection
682    * is enabled.  The default behaviour is to scale the control by the
683    * pinch scale.
684    *
685    * @SINCE_1_0.0
686    * @param[in]  pinch  The pinch gesture.
687    * @note If overridden, then the default behaviour will not occur.
688    * @note Pinch detection should be enabled via EnableGestureDetection().
689    * @see EnableGestureDetection
690    */
691   virtual void OnPinch( const PinchGesture& pinch );
692
693   /**
694    * @brief Called whenever a pan gesture is detected on this control.
695    *
696    * This should be overridden by deriving classes when pan detection
697    * is enabled.
698    *
699    * @SINCE_1_0.0
700    * @param[in]  pan  The pan gesture.
701    * @note There is no default behaviour with panning.
702    * @note Pan detection should be enabled via EnableGestureDetection().
703    * @see EnableGestureDetection
704    */
705   virtual void OnPan( const PanGesture& pan );
706
707   /**
708    * @brief Called whenever a tap gesture is detected on this control.
709    *
710    * This should be overridden by deriving classes when tap detection
711    * is enabled.
712    *
713    * @SINCE_1_0.0
714    * @param[in]  tap  The tap gesture.
715    * @note There is no default behaviour with a tap.
716    * @note Tap detection should be enabled via EnableGestureDetection().
717    * @see EnableGestureDetection
718    */
719   virtual void OnTap( const TapGesture& tap );
720
721   /**
722    * @brief Called whenever a long press gesture is detected on this control.
723    *
724    * This should be overridden by deriving classes when long press
725    * detection is enabled.
726    *
727    * @SINCE_1_0.0
728    * @param[in]  longPress  The long press gesture.
729    * @note There is no default behaviour associated with a long press.
730    * @note Long press detection should be enabled via EnableGestureDetection().
731    * @see EnableGestureDetection
732    */
733   virtual void OnLongPress( const LongPressGesture& longPress );
734
735   // From ConnectionTrackerInterface
736
737   /**
738    * @copydoc ConnectionTrackerInterface::SignalConnected
739    */
740   virtual void SignalConnected( SlotObserver* slotObserver, CallbackBase* callback );
741
742   /**
743    * @copydoc ConnectionTrackerInterface::SignalDisconnected
744    */
745   virtual void SignalDisconnected( SlotObserver* slotObserver, CallbackBase* callback );
746
747   /**
748    * @brief Retrieve the extension for this control
749    *
750    * @SINCE_1_0.0
751    * @return The extension if available, NULL otherwise
752    */
753   virtual Extension* GetControlExtension()
754   {
755     return NULL;
756   }
757
758 private:
759
760   /// @cond internal
761   // Undefined
762   DALI_INTERNAL Control( const Control& );
763   DALI_INTERNAL Control& operator=( const Control& );
764
765   class Impl;
766   Impl* mImpl;
767   /// @endcond
768
769 };
770
771 /**
772  * @brief Get implementation from the handle.
773  *
774  * @SINCE_1_0.0
775  * @param handle
776  * @return implementation
777  * @pre handle is initialized and points to a control
778  */
779 DALI_IMPORT_API Internal::Control& GetImplementation( Dali::Toolkit::Control& handle );
780
781 /**
782  * @brief Get implementation from the handle.
783  *
784  * @SINCE_1_0.0
785  * @param handle
786  * @return implementation
787  * @pre handle is initialized and points to a control
788  */
789 DALI_IMPORT_API const Internal::Control& GetImplementation( const Dali::Toolkit::Control& handle );
790
791 } // namespace Internal
792
793 /**
794  * @}
795  */
796 } // namespace Toolkit
797
798 } // namespace Dali
799
800 #endif // DALI_TOOLKIT_CONTROL_IMPL_H