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