470fb27de31aa4c26c367a291fb7f8447865729c
[platform/core/uifw/dali-toolkit.git] / base / 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) 2014 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/common/vector-wrapper.h>
24 #include <dali/public-api/events/long-press-gesture.h>
25 #include <dali/public-api/events/pan-gesture.h>
26 #include <dali/public-api/events/pinch-gesture.h>
27 #include <dali/public-api/events/tap-gesture.h>
28 #include <dali/public-api/object/property-index.h>
29 #include <dali/public-api/object/type-info.h>
30
31 // INTERNAL INCLUDES
32 #include <dali-toolkit/public-api/controls/control.h>
33
34 namespace Dali
35 {
36
37 namespace Toolkit
38 {
39
40 class StyleManager;
41
42 namespace Internal DALI_INTERNAL
43 {
44 class RelayoutControllerImpl;
45 class KeyInputFocusManager;
46 }
47
48 typedef std::pair< Actor, Vector2 > ActorSizePair;       ///< Pair of actor and size
49 typedef std::vector< ActorSizePair > ActorSizeContainer; ///< Container of actors and their sizes
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  */
61 class DALI_IMPORT_API Control : public CustomActorImpl, public ConnectionTrackerInterface
62 {
63 public:
64
65   // Properties
66   enum
67   {
68     CONTROL_PROPERTY_START_INDEX = PROPERTY_REGISTRATION_START_INDEX,
69     CONTROL_PROPERTY_END_INDEX = CONTROL_PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices
70   };
71
72   // Creation
73
74   /**
75    * @brief Create a new ControlImpl instance that does not require touch by default.
76    *
77    * If touch is required then the user can connect to this class' touch signal.
78    * @return A handle to the ConntrolImpl instance.
79    */
80   static Toolkit::Control New();
81
82   // Destruction
83
84   /**
85    * @brief Virtual destructor.
86    */
87   virtual ~Control();
88
89   // Actions
90
91   /**
92    * @brief This method should be overridden by deriving classes when they wish to be notified when they
93    * are activated.
94    */
95   virtual void OnActivated() { }
96
97   /**
98    * @brief This method should be overridden by deriving classes when they wish to respond the accessibility
99    * pan gesture.
100    *
101    * @param[in] gesture The pan gesture.
102    * @return true if the pan gesture has been consumed by this control
103    */
104   virtual bool OnAccessibilityPan(PanGesture gesture);
105
106   /**
107    * @brief This method should be overridden by deriving classes when they wish to respond the accessibility
108    * touch event.
109    *
110    * @param[in] touchEvent The touch event.
111    * @return true if the touch event has been consumed by this control
112    */
113   virtual bool OnAccessibilityTouch(const TouchEvent& touchEvent);
114
115   /**
116    * @brief This method should be overridden by deriving classes when they wish to respond
117    * the accessibility up and down action (i.e. value change of slider control).
118    *
119    * @param[in] isIncrease Whether the value should be increased or decreased
120    * @return true if the value changed action has been consumed by this control
121    */
122   virtual bool OnAccessibilityValueChange(bool isIncrease);
123
124   /**
125    * @brief Sets whether this control supports two dimensional
126    * keyboard navigation (i.e. whether it knows how to handle the
127    * keyboardn focus movement between its child actors).
128    *
129    * The control doesn't support it by default.
130    * @param[in] isSupported Whether this control supports two dimensional keyboard navigation.
131    */
132   void SetKeyboardNavigationSupport(bool isSupported);
133
134   /**
135    * @brief Gets whether this control supports two dimensional keyboard navigation.
136    *
137    * @return true if this control supports two dimensional keyboard navigation.
138    */
139   bool IsKeyboardNavigationSupported();
140
141   /**
142    * @brief Sets whether this control is a focus group for keyboard navigation.
143    *
144    * (i.e. the scope of keyboard focus movement
145    * can be limitied to its child actors). The control is not a focus group by default.
146    * @param[in] isFocusGroup Whether this control is set as a focus group for keyboard navigation.
147    */
148   void SetAsKeyboardFocusGroup(bool isFocusGroup);
149
150   /**
151    * @brief Gets whether this control is a focus group for keyboard navigation.
152    *
153    * @return true if this control is set as a focus group for keyboard navigation.
154    */
155   bool IsKeyboardFocusGroup();
156
157   /**
158    * @brief Gets the next keyboard focusable actor in this control towards the given direction.
159    *
160    * A control needs to override this function in order to support two dimensional keyboard navigation.
161    * @param[in] currentFocusedActor The current focused actor.
162    * @param[in] direction The direction to move the focus towards.
163    * @param[in] loopEnabled Whether the focus movement should be looped within the control.
164    * @return the next keyboard focusable actor in this control or an empty handle if no actor can be focused.
165    */
166   virtual Actor GetNextKeyboardFocusableActor(Actor currentFocusedActor, Toolkit::Control::KeyboardFocusNavigationDirection direction, bool loopEnabled);
167
168   /**
169    * @brief Informs this control that its chosen focusable actor will be focused.
170    *
171    * This allows the application to preform any actions if wishes
172    * before the focus is actually moved to the chosen actor.
173    *
174    * @param[in] commitedFocusableActor The commited focusable actor.
175    */
176   virtual void OnKeyboardFocusChangeCommitted(Actor commitedFocusableActor) { }
177
178   /**
179    * @brief Performs actions as requested using the action name.
180    *
181    * @param[in] object The object on which to perform the action.
182    * @param[in] actionName The action to perform.
183    * @param[in] attributes The attributes with which to perfrom this action.
184    * @return true if action has been accepted by this control
185    */
186   static bool DoAction(BaseObject* object, const std::string& actionName, const PropertyValueContainer& attributes);
187
188   /**
189    * Connects a callback function with the object's signals.
190    * @param[in] object The object providing the signal.
191    * @param[in] tracker Used to disconnect the signal.
192    * @param[in] signalName The signal to connect to.
193    * @param[in] functor A newly allocated FunctorDelegate.
194    * @return True if the signal was connected.
195    * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
196    */
197   static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
198
199   /**
200    * @brief If deriving classes wish to fine tune pinch gesture
201    * detection then they can access the gesture detector through this
202    * API and modify the detection.
203    *
204    * @return The pinch gesture detector.
205    * @pre Pinch detection should have been enabled via EnableGestureDetection().
206    * @see EnableGestureDetection
207    */
208   PinchGestureDetector GetPinchGestureDetector() const;
209
210   /**
211    * @brief If deriving classes wish to fine tune pan gesture
212    * detection then they can access the gesture detector through this
213    * API and modify the detection.
214    *
215    * @return The pan gesture detector.
216    * @pre Pan detection should have been enabled via EnableGestureDetection().
217    * @see EnableGestureDetection
218    */
219   PanGestureDetector GetPanGestureDetector() const;
220
221   /**
222    * @brief If deriving classes wish to fine tune tap gesture
223    * detection then they can access the gesture detector through this
224    * API and modify the detection.
225    *
226    * @return The tap gesture detector.
227    * @pre Tap detection should have been enabled via EnableGestureDetection().
228    * @see EnableGestureDetection
229    */
230   TapGestureDetector GetTapGestureDetector() const;
231
232   /**
233    * @brief If deriving classes wish to fine tune long press gesture
234    * detection then they can access the gesture detector through this
235    * API and modify the detection.
236    *
237    * @return The long press gesture detector.
238    * @pre Long press detection should have been enabled via EnableGestureDetection().
239    * @see EnableGestureDetection
240    */
241   LongPressGestureDetector GetLongPressGestureDetector() const;
242
243   // Background
244
245   /**
246    * @copydoc Dali::Toolkit::Control::SetBackgroundColor
247    */
248   void SetBackgroundColor( const Vector4& color );
249
250   /**
251    * @copydoc Dali::Toolkit::Control::GetBackgroundColor
252    */
253   Vector4 GetBackgroundColor() const;
254
255   /**
256    * @copydoc Dali::Toolkit::Control::SetBackground
257    */
258   void SetBackground( Image image );
259
260   /**
261    * @copydoc Dali::Toolkit::Control::ClearBackground
262    */
263   void ClearBackground();
264
265   /**
266    * @copydoc Dali::Toolkit::Control::GetBackgroundActor
267    */
268   Actor GetBackgroundActor() const;
269
270 public:
271
272   /**
273    * @copydoc Dali::Toolkit::Control::KeyEventSignal()
274    */
275   Toolkit::Control::KeyEventSignalV2& KeyEventSignal();
276
277 protected:
278
279   // Construction
280
281   /**
282    * @brief Second phase initialization.
283    */
284   void Initialize();
285
286   // Gesture Detection
287
288   /**
289    * @brief Allows deriving classes to enable any of the gesture detectors that are available.
290    *
291    * Gesture detection can be enabled one at a time or in bitwise format as shown:
292    * @code
293    * EnableGestureDetection(Gesture::Type(Gesture::Pinch | Gesture::Tap | Gesture::Pan));
294    * @endcode
295    * @param[in]  type  The gesture type(s) to enable.
296    */
297   void EnableGestureDetection(Gesture::Type type);
298
299   /**
300    * @brief Allows deriving classes to disable any of the gesture detectors.
301    *
302    * Like EnableGestureDetection, this can also be called using bitwise or.
303    * @param[in]  type  The gesture type(s) to disable.
304    * @see EnableGetureDetection
305    */
306   void DisableGestureDetection(Gesture::Type type);
307
308 private: // For derived classes to override
309
310   /**
311    * @brief This method is called after the Control has been initialized.
312    *
313    * Derived classes should do any second phase initialization by
314    * overriding this method.
315    */
316   virtual void OnInitialize() { }
317
318   /**
319    * @brief This method should be overridden by deriving classes when
320    * they wish to be notified when the style manager changes the theme.
321    *
322    * @param[in] styleManager  The StyleManager object.
323    */
324   virtual void OnThemeChange( Toolkit::StyleManager styleManager );
325
326   /**
327    * @brief This method should be overridden by deriving classes when
328    * they wish to be notified when the style changes the default font.
329    *
330    * @param[in] defaultFontChange  Information denoting whether the default font has changed.
331    * @param[in] defaultFontSizeChange Information denoting whether the default font size has changed.
332    */
333   virtual void OnFontChange( bool defaultFontChange, bool defaultFontSizeChange ){ }
334
335   /**
336    * @brief Called whenever a pinch gesture is detected on this control.
337    *
338    * This can be overridden by deriving classes when pinch detection
339    * is enabled.  The default behaviour is to scale the control by the
340    * pinch scale.
341    *
342    * @note If overridden, then the default behaviour will not occur.
343    * @note Pinch detection should be enabled via EnableGestureDetection().
344    * @param[in]  pinch  The pinch gesture.
345    * @see EnableGestureDetection
346    */
347   virtual void OnPinch(const PinchGesture& pinch);
348
349   /**
350    * @brief Called whenever a pan gesture is detected on this control.
351    *
352    * This should be overridden by deriving classes when pan detection
353    * is enabled.
354    *
355    * @note There is no default behaviour with panning.
356    * @note Pan detection should be enabled via EnableGestureDetection().
357    * @param[in]  pan  The pan gesture.
358    * @see EnableGestureDetection
359    */
360   virtual void OnPan( const PanGesture& pan );
361
362   /**
363    * @brief Called whenever a tap gesture is detected on this control.
364    *
365    * This should be overridden by deriving classes when tap detection
366    * is enabled.
367    *
368    * @note There is no default behaviour with a tap.
369    * @note Tap detection should be enabled via EnableGestureDetection().
370    * @param[in]  tap  The tap gesture.
371    * @see EnableGestureDetection
372    */
373   virtual void OnTap( const TapGesture& tap );
374
375   /**
376    * @brief Called whenever a long press gesture is detected on this control.
377    *
378    * This should be overridden by deriving classes when long press
379    * detection is enabled.
380    *
381    * @note There is no default behaviour associated with a long press.
382    * @note Long press detection should be enabled via EnableGestureDetection().
383    * @param[in]  longPress  The long press gesture.
384    * @see EnableGestureDetection
385    */
386   virtual void OnLongPress( const LongPressGesture& longPress );
387
388   /**
389    * @brief Called whenever the control is added to the stage.
390    *
391    * Could be overridden by derived classes.
392    */
393   virtual void OnControlStageConnection() { }
394
395   /**
396    * @brief Called whenever the control is removed from the stage.
397    *
398    * Could be overridden by derived classes.
399    */
400   virtual void OnControlStageDisconnection() { }
401
402   /**
403    * @brief Called whenever an Actor is added to the control.
404    *
405    * Could be overridden by derived classes.
406    *
407    * @param[in] child The added actor.
408    */
409   virtual void OnControlChildAdd( Actor& child ) { }
410
411   /**
412    * @brief Called whenever an Actor is removed from the control.
413    *
414    * Could be overridden by derived classes.
415    *
416    * @param[in] child The removed actor.
417    */
418   virtual void OnControlChildRemove( Actor& child ) { }
419
420   /**
421    * @brief Called whenever the Control's size is set.
422    *
423    * Could be overridden by derived classes.
424    *
425    * @param[in] size The new size.
426    */
427   virtual void OnControlSizeSet( const Vector3& size ) { }
428
429   /**
430    * @brief Called after the Dali::Stage::SignalMessageQueueFlushed()
431    * signal is emitted if this control requested to be relaid-out.
432    *
433    * Should be overridden by derived classes if they need to layout
434    * actors differently after certain operations like add or remove
435    * actors, resize or after changing especific properties.
436    *
437    * @param[in]      size       The allocated size.
438    * @param[in,out]  container  The control should add actors to this container that it is not able
439    *                            to allocate a size for.
440    */
441   virtual void OnRelaidOut( Vector2 size, ActorSizeContainer& container );
442
443 private: // From CustomActorImpl, derived classes can override these.
444
445   /**
446    * @brief Sends a request to relayout this control.
447    *
448    * The control will be relaid out after the
449    * Dali::Stage::SignalMessageQueueFlushed() signal is emitted.
450    *
451    * It calls OnControlStageConnection() to notify derived classes.
452    *
453    * @see Dali::CustomActorImpl::OnStageConnection()
454    */
455   virtual void OnStageConnection();
456
457   /**
458    * @brief Calls OnControlStageDisconnection() to notify derived classed.
459    *
460    * @see Dali::CustomActorImpl::OnStageDisconnection()
461    */
462   virtual void OnStageDisconnection();
463
464   /**
465    * @brief Sends a request to relayout this control.
466    *
467    * The control will be relaid out after the
468    * Dali::Stage::SignalMessageQueueFlushed() signal is emitted.  It
469    * calls OnControlChildAdd() to notify derived classes.
470    *
471    * @note This method shouldn't be overridden by derived classes.
472    *
473    * @param[in] child The added actor.
474    *
475    * @see Dali::CustomActorImpl::OnChildAdd(Actor&)
476    */
477   virtual void OnChildAdd(Actor& child);
478
479   /**
480    * @brief Sends a request to relayout this control.
481    *
482    * The control will be relaid out after the
483    * Dali::Stage::SignalMessageQueueFlushed() signal is emitted.  It
484    * calls OnControlChildRemove() to notify derived classes.
485    *
486    * @note This method shouldn't be overridden by derived classes.
487    *
488    * @param[in] child The removed actor.
489    *
490    * @see Dali::CustomActorImpl::OnChildRemove(Actor&)
491    */
492   virtual void OnChildRemove(Actor& child);
493
494   /**
495    * @brief It stores the size set by size negotiation and relayout.
496    *
497    * It also keeps a backup of the size set through the Actor's API used in the size negotiation.
498    * It calls the OnControlSizeSet() to notify derived classes.
499    *
500    * @param[in] targetSize The new size.
501    *
502    * @see Dali::CustomActorImpl::OnSizeSet(const Vector3&)
503    */
504   virtual void OnSizeSet(const Vector3& targetSize);
505
506   /**
507    * @copydoc Dali::CustomActorImpl::OnSizeAnimation(Animation&, const Vector3&)
508    */
509   virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize);
510
511   /**
512    * @copydoc Dali::CustomActorImpl::OnTouchEvent(const TouchEvent&)
513    */
514   virtual bool OnTouchEvent(const TouchEvent& event);
515
516   /**
517    * @copydoc Dali::CustomActorImpl::OnHoverEvent(const HoverEvent&)
518    */
519   virtual bool OnHoverEvent(const HoverEvent& event);
520
521   /**
522    * @copydoc Dali::CustomActorImpl::OnKeyEvent(const KeyEvent&)
523    */
524   virtual bool OnKeyEvent(const KeyEvent& event);
525
526   /**
527    * @copydoc Dali::CustomActorImpl::OnMouseWheelEvent(const MouseWheelEvent&)
528    */
529   virtual bool OnMouseWheelEvent(const MouseWheelEvent& event);
530
531   /**
532    * @copydoc Dali::CustomActorImpl::OnKeyInputFocusGained()
533    */
534   virtual void OnKeyInputFocusGained();
535
536   /**
537    * @copydoc Dali::CustomActorImpl::OnKeyInputFocusLost()
538    */
539   virtual void OnKeyInputFocusLost();
540
541   /**
542    * @copydoc Dali::CustomActorImpl::GetChildByAlias(const std::string& actorAlias)
543    */
544   virtual Actor GetChildByAlias(const std::string& actorAlias);
545
546 private:
547
548   /**
549    * @brief This method is the callback for the StyleChangeSignal from StyleManager
550    *
551    * @param[in] styleManager The StyleManager Object
552    * @param[in] change  Information denoting what has changed.
553    */
554   DALI_INTERNAL void DoStyleChange( Toolkit::StyleManager styleManager, StyleChange change );
555
556 protected: // Construction
557
558   // Flags for the constructor
559   enum ControlBehaviour
560   {
561     CONTROL_BEHAVIOUR_NONE        = 0,
562     REQUIRES_TOUCH_EVENTS         = 1<<1,     ///< True if the OnTouchEvent() callback is required.
563     REQUIRES_STYLE_CHANGE_SIGNALS = 1<<2,     ///< True if needs to monitor style change signals such as theme/font change
564     NO_SIZE_NEGOTIATION           = 1<<3,     ///< True if control does not need size negotiation, i.e. it can be skipped in the algorithm
565     REQUIRES_HOVER_EVENTS         = 1<<4,     ///< True if the OnHoverEvent() callback is required.
566     REQUIRES_MOUSE_WHEEL_EVENTS   = 1<<5      ///< True if the OnMouseWheelEvent() callback is required.
567   };
568
569   /**
570    * @brief Create a Control.
571    *
572    * @param[in] behaviourFlags Behavioural flags from ControlBehaviour enum
573    */
574   Control(ControlBehaviour behaviourFlags);
575
576 public:
577
578   // Size negotiation
579
580   /**
581    * @copydoc Toolkit::Control::SetSizePolicy()
582    */
583   void SetSizePolicy( Toolkit::Control::SizePolicy widthPolicy, Toolkit::Control::SizePolicy heightPolicy );
584
585   /**
586    * @copydoc Toolkit::Control::GetSizePolicy()
587    */
588   void GetSizePolicy( Toolkit::Control::SizePolicy& widthPolicy, Toolkit::Control::SizePolicy& heightPolicy ) const;
589
590   /**
591    * @copydoc Toolkit::Control::SetMinimumSize()
592    */
593   void SetMinimumSize( const Vector3& size );
594
595   /**
596    * @copydoc Toolkit::Control::GetMinimumSize()
597    */
598   const Vector3& GetMinimumSize() const;
599
600   /**
601    * @copydoc Toolkit::Control::SetMaximumSize()
602    */
603   void SetMaximumSize( const Vector3& size );
604
605   /**
606    * @copydoc Toolkit::Control::GetMaximumSize()
607    */
608   const Vector3& GetMaximumSize() const;
609
610   /**
611    * @copydoc Toolkit::Control::GetNaturalSize()
612    */
613   virtual Vector3 GetNaturalSize();
614
615   /**
616    * @copydoc Toolkit::Control::GetHeightForWidth()
617    */
618   virtual float GetHeightForWidth( float width );
619
620   /**
621    * @copydoc Toolkit::Control::GetWidthForHeight()
622    */
623   virtual float GetWidthForHeight( float height );
624
625   /**
626    * @brief Retrieves the current Control's size.
627    *
628    * @return The control's size.
629    */
630   const Vector3& GetControlSize() const;
631
632   /**
633    * @brief Retrieves the Control's size set by the Application / Control.
634    *
635    * @return The control's size.
636    */
637   const Vector3& GetSizeSet() const;
638
639   //KeyInput
640
641   /**
642    * @copydoc Toolkit::Control::SetKeyInputFocus()
643    */
644   void SetKeyInputFocus();
645
646   /**
647    * @copydoc Toolkit::Control::HasKeyInputFocus()
648    */
649   bool HasKeyInputFocus();
650
651   /**
652    * @copydoc Toolkit::Control::ClearKeyInputFocus()
653    */
654   void ClearKeyInputFocus();
655
656   /**
657    * @copydoc ConnectionTrackerInterface::SignalConnected
658    */
659   virtual void SignalConnected( SlotObserver* slotObserver, CallbackBase* callback );
660
661   /**
662    * @copydoc ConnectionTrackerInterface::SignalDisconnected
663    */
664   virtual void SignalDisconnected( SlotObserver* slotObserver, CallbackBase* callback );
665
666 protected:
667
668   /**
669    * @brief Sends a request to be relaid-out.
670    *
671    * This method is called from OnStageConnection(), OnChildAdd(),
672    * OnChildRemove(), SetSizePolicy(), SetMinimumSize() and
673    * SetMaximumSize().
674    *
675    * This method could also be called from derived classes every time
676    * a control's poperty change and it needs to be relaid-out.  After
677    * the Dali::Stage::SignalMessageQueueFlushed() is emitted a
678    * relayout process starts and all controls which called this method
679    * will be relaid-out.
680    *
681    * @note RelayoutRequest() only sends a request per Control before
682    * the Dali::Stage::SignalMessageQueueFlushed() signal is
683    * emitted. That means a control will be relaid-out only once, even
684    * if more than one request is sent between two consecutive signals.
685    */
686   void RelayoutRequest();
687
688   /**
689    * @brief Helper method for controls to Relayout their children if
690    * they do not know whether that child is a control or not.
691    *
692    * @param[in]      actor      The actor to relayout.
693    * @param[in]      size       The size to allocate to the actor.
694    * @param[in,out]  container  The container that holds actors that have not been allocated a size yet.
695    */
696   static void Relayout( Actor actor, Vector2 size, ActorSizeContainer& container );
697
698 private: // Used by the RelayoutController
699
700   /**
701    * @brief Called by the RelayoutController to negotiate the size of a control.
702    *
703    * The size allocated by the the algorithm is passed in which the
704    * control must adhere to.  A container is passed in as well which
705    * the control should populate with actors it has not / or does not
706    * need to handle in its size negotiation.
707    *
708    * @param[in]      size       The allocated size.
709    * @param[in,out]  container  The container that holds actors that are fed back into the
710    *                            RelayoutController algorithm.
711    */
712   DALI_INTERNAL void NegotiateSize( Vector2 size, ActorSizeContainer& container );
713
714 private:
715
716   /**
717    * @brief Called by NegotiateSize when the size to allocate to the control has been calculated.
718    *
719    * It calls the OnRelaidOut() method which can be overridden by derived classes.
720    *
721    * @param[in]      size       The allocated size.
722    * @param[in,out]  container  The control should add actors to this container that it is not able
723    *                            to allocate a size for.
724    */
725   DALI_INTERNAL void Relayout( Vector2 size, ActorSizeContainer& container );
726
727   /**
728    * @brief Used by the KeyInputFocusManager to emit key event signals.
729    *
730    * @param[in] event The key event.
731    * @return True if the event was consumed.
732    */
733   DALI_INTERNAL bool EmitKeyEventSignal(const KeyEvent& event);
734
735 private:
736
737   // Undefined
738   DALI_INTERNAL Control(const Control&);
739   DALI_INTERNAL Control& operator=(const Control&);
740
741   class Impl;
742   Impl* mImpl;
743
744   friend class Internal::RelayoutControllerImpl;   ///< Relayout controller needs to call Relayout() which is private.
745   friend class Internal::KeyInputFocusManager;     ///< KeyInputFocusManager needs to call which is private.
746 };
747
748 } // namespace Internal
749
750 } // namespace Toolkit
751
752 } // namespace Dali
753
754 #endif // __DALI_TOOLKIT_CONTROL_IMPL_H__