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