Manual binding to add getter/setter APIs for Hover
[platform/core/uifw/dali-toolkit.git] / plugins / dali-swig / manual / csharp / CustomView.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 namespace Dali
19 {
20     public class CustomView : ViewWrapper
21     {
22         public CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour) : base(new ViewWrapperImpl(behaviour))
23         {
24             // Registering CustomView virtual functions to viewWrapperImpl delegates.
25             viewWrapperImpl.OnStageConnection = new ViewWrapperImpl.OnStageConnectionDelegate(OnStageConnection);
26             viewWrapperImpl.OnStageDisconnection = new ViewWrapperImpl.OnStageDisconnectionDelegate(OnStageDisconnection);
27             viewWrapperImpl.OnChildAdd = new ViewWrapperImpl.OnChildAddDelegate(OnChildAdd);
28             viewWrapperImpl.OnChildRemove = new ViewWrapperImpl.OnChildRemoveDelegate(OnChildRemove);
29             viewWrapperImpl.OnPropertySet = new ViewWrapperImpl.OnPropertySetDelegate(OnPropertySet);
30             viewWrapperImpl.OnSizeSet = new ViewWrapperImpl.OnSizeSetDelegate(OnSizeSet);
31             viewWrapperImpl.OnSizeAnimation = new ViewWrapperImpl.OnSizeAnimationDelegate(OnSizeAnimation);
32             viewWrapperImpl.OnTouchEvent = new ViewWrapperImpl.OnTouchEventDelegate(OnTouchEvent);
33             viewWrapperImpl.OnHover = new ViewWrapperImpl.OnHoverDelegate(OnHover);
34             viewWrapperImpl.OnKeyEvent = new ViewWrapperImpl.OnKeyEventDelegate(OnKeyEvent);
35             viewWrapperImpl.OnWheelEvent = new ViewWrapperImpl.OnWheelEventDelegate(OnWheelEvent);
36             viewWrapperImpl.OnRelayout = new ViewWrapperImpl.OnRelayoutDelegate(OnRelayout);
37             viewWrapperImpl.OnSetResizePolicy = new ViewWrapperImpl.OnSetResizePolicyDelegate(OnSetResizePolicy);
38             viewWrapperImpl.GetNaturalSize = new ViewWrapperImpl.GetNaturalSizeDelegate(GetNaturalSize);
39             viewWrapperImpl.CalculateChildSize = new ViewWrapperImpl.CalculateChildSizeDelegate(CalculateChildSize);
40             viewWrapperImpl.GetHeightForWidth = new ViewWrapperImpl.GetHeightForWidthDelegate(GetHeightForWidth);
41             viewWrapperImpl.GetWidthForHeight = new ViewWrapperImpl.GetWidthForHeightDelegate(GetWidthForHeight);
42             viewWrapperImpl.RelayoutDependentOnChildrenDimension = new ViewWrapperImpl.RelayoutDependentOnChildrenDimensionDelegate(RelayoutDependentOnChildren);
43             viewWrapperImpl.RelayoutDependentOnChildren = new ViewWrapperImpl.RelayoutDependentOnChildrenDelegate(RelayoutDependentOnChildren);
44             viewWrapperImpl.OnCalculateRelayoutSize = new ViewWrapperImpl.OnCalculateRelayoutSizeDelegate(OnCalculateRelayoutSize);
45             viewWrapperImpl.OnLayoutNegotiated = new ViewWrapperImpl.OnLayoutNegotiatedDelegate(OnLayoutNegotiated);
46             viewWrapperImpl.OnControlChildAdd = new ViewWrapperImpl.OnControlChildAddDelegate(OnControlChildAdd);
47             viewWrapperImpl.OnControlChildRemove = new ViewWrapperImpl.OnControlChildRemoveDelegate(OnControlChildRemove);
48             viewWrapperImpl.OnStyleChange = new ViewWrapperImpl.OnStyleChangeDelegate(OnStyleChange);
49             viewWrapperImpl.OnAccessibilityActivated = new ViewWrapperImpl.OnAccessibilityActivatedDelegate(OnAccessibilityActivated);
50             viewWrapperImpl.OnAccessibilityPan = new ViewWrapperImpl.OnAccessibilityPanDelegate(OnAccessibilityPan);
51             viewWrapperImpl.OnAccessibilityTouch = new ViewWrapperImpl.OnAccessibilityTouchDelegate(OnAccessibilityTouch);
52             viewWrapperImpl.OnAccessibilityValueChange = new ViewWrapperImpl.OnAccessibilityValueChangeDelegate(OnAccessibilityValueChange);
53             viewWrapperImpl.OnAccessibilityZoom = new ViewWrapperImpl.OnAccessibilityZoomDelegate(OnAccessibilityZoom);
54             viewWrapperImpl.OnKeyInputFocusGained = new ViewWrapperImpl.OnKeyInputFocusGainedDelegate(OnKeyInputFocusGained);
55             viewWrapperImpl.OnKeyInputFocusLost = new ViewWrapperImpl.OnKeyInputFocusLostDelegate(OnKeyInputFocusLost);
56             viewWrapperImpl.GetNextKeyboardFocusableActor = new ViewWrapperImpl.GetNextKeyboardFocusableActorDelegate(GetNextKeyboardFocusableActor);
57             viewWrapperImpl.OnKeyboardFocusChangeCommitted = new ViewWrapperImpl.OnKeyboardFocusChangeCommittedDelegate(OnKeyboardFocusChangeCommitted);
58             viewWrapperImpl.OnKeyboardEnter = new ViewWrapperImpl.OnKeyboardEnterDelegate(OnKeyboardEnter);
59             viewWrapperImpl.OnPinch = new ViewWrapperImpl.OnPinchDelegate(OnPinch);
60             viewWrapperImpl.OnPan = new ViewWrapperImpl.OnPanDelegate(OnPan);
61             viewWrapperImpl.OnTap = new ViewWrapperImpl.OnTapDelegate(OnTap);
62             viewWrapperImpl.OnLongPress = new ViewWrapperImpl.OnLongPressDelegate(OnLongPress);
63             viewWrapperImpl.SignalConnected = new ViewWrapperImpl.SignalConnectedDelegate(SignalConnected);
64             viewWrapperImpl.SignalDisconnected = new ViewWrapperImpl.SignalDisconnectedDelegate(SignalDisconnected);
65
66             // Make sure CustomView is initialized.
67             OnInitialize();
68
69             // Make sure the style of actors/visuals initialized above are applied by the style manager.
70             viewWrapperImpl.ApplyThemeStyle();
71         }
72
73         /**
74          * @brief Set the background with a property map.
75          *
76          * @param[in] map The background property map.
77          */
78         public void SetBackground(Dali.Property.Map map)
79         {
80             viewWrapperImpl.SetBackground(map);
81         }
82
83         /**
84          * @brief Allows deriving classes to enable any of the gesture detectors that are available.
85          *
86          * Gesture detection can be enabled one at a time or in bitwise format as shown:
87          * @code
88          * EnableGestureDetection(Gesture.Type.Pinch | Gesture.Type.Tap | Gesture.Type.Pan));
89          * @endcode
90          * @param[in]  type  The gesture type(s) to enable.
91          */
92         public void EnableGestureDetection(Gesture.Type type)
93         {
94             viewWrapperImpl.EnableGestureDetection(type);
95         }
96
97         /**
98          * @brief Allows deriving classes to disable any of the gesture detectors.
99          *
100          * Like EnableGestureDetection, this can also be called using bitwise or.
101          * @param[in]  type  The gesture type(s) to disable.
102          * @see EnableGetureDetection
103          */
104         public void DisableGestureDetection(Gesture.Type type)
105         {
106             viewWrapperImpl.DisableGestureDetection(type);
107         }
108
109         /**
110          * @brief Sets whether this control supports two dimensional
111          * keyboard navigation (i.e. whether it knows how to handle the
112          * keyboard focus movement between its child actors).
113          *
114          * The control doesn't support it by default.
115          * @param[in] isSupported Whether this control supports two dimensional keyboard navigation.
116          */
117         public void SetKeyboardNavigationSupport(bool isSupported)
118         {
119             viewWrapperImpl.SetKeyboardNavigationSupport(isSupported);
120         }
121
122         /**
123          * @brief Gets whether this control supports two dimensional keyboard navigation.
124          *
125          * @return true if this control supports two dimensional keyboard navigation.
126          */
127         public bool IsKeyboardNavigationSupported()
128         {
129             return viewWrapperImpl.IsKeyboardNavigationSupported();
130         }
131
132         /**
133          * @brief Sets whether this control is a focus group for keyboard navigation.
134          *
135          * (i.e. the scope of keyboard focus movement
136          * can be limitied to its child actors). The control is not a focus group by default.
137          * @param[in] isFocusGroup Whether this control is set as a focus group for keyboard navigation.
138          */
139         public void SetAsKeyboardFocusGroup(bool isFocusGroup)
140         {
141             viewWrapperImpl.SetAsKeyboardFocusGroup(isFocusGroup);
142         }
143
144         /**
145          * @brief Gets whether this control is a focus group for keyboard navigation.
146          *
147          * @return true if this control is set as a focus group for keyboard navigation.
148          */
149         public bool IsKeyboardFocusGroup()
150         {
151             return viewWrapperImpl.IsKeyboardFocusGroup();
152         }
153
154         /**
155          * @brief Called by the AccessibilityManager to activate the Control.
156          * @SINCE_1_0.0
157          */
158         public void AccessibilityActivate()
159         {
160             viewWrapperImpl.AccessibilityActivate();
161         }
162
163         /**
164          * @brief Called by the KeyboardFocusManager.
165          */
166         public void KeyboardEnter()
167         {
168             viewWrapperImpl.KeyboardEnter();
169         }
170
171         /**
172          * @brief Called by the KeyInputFocusManager to emit key event signals.
173          *
174          * @param[in] keyEvent The key event.
175          * @return True if the event was consumed.
176          */
177         public bool EmitKeyEventSignal(KeyEvent keyEvent)
178         {
179             return viewWrapperImpl.EmitKeyEventSignal(keyEvent);
180         }
181
182         /**
183          * @brief Request a relayout, which means performing a size negotiation on this actor, its parent and children (and potentially whole scene).
184          *
185          * This method can also be called from a derived class every time it needs a different size.
186          * At the end of event processing, the relayout process starts and
187          * all controls which requested Relayout will have their sizes (re)negotiated.
188          *
189          * @note RelayoutRequest() can be called multiple times; the size negotiation is still
190          * only performed once, i.e. there is no need to keep track of this in the calling side.
191          */
192         protected void RelayoutRequest()
193         {
194             viewWrapperImpl.RelayoutRequest();
195         }
196
197         /**
198          * @brief Provides the Actor implementation of GetHeightForWidth.
199          * @param width Width to use.
200          * @return The height based on the width.
201          */
202         protected float GetHeightForWidthBase(float width)
203         {
204             return viewWrapperImpl.GetHeightForWidthBase( width );
205         }
206
207         /**
208          * @brief Provides the Actor implementation of GetWidthForHeight.
209          * @param height Height to use.
210          * @return The width based on the height.
211          */
212         protected float GetWidthForHeightBase(float height)
213         {
214             return viewWrapperImpl.GetWidthForHeightBase( height );
215         }
216
217         /**
218          * @brief Calculate the size for a child using the base actor object.
219          *
220          * @param[in] child The child actor to calculate the size for
221          * @param[in] dimension The dimension to calculate the size for. E.g. width or height
222          * @return Return the calculated size for the given dimension. If more than one dimension is requested, just return the first one found.
223          */
224         protected float CalculateChildSizeBase(Actor child, DimensionType dimension)
225         {
226             return viewWrapperImpl.CalculateChildSizeBase( child, dimension );
227         }
228
229         /**
230          * @brief Determine if this actor is dependent on it's children for relayout from the base class.
231          *
232          * @param dimension The dimension(s) to check for
233          * @return Return if the actor is dependent on it's children.
234          */
235         protected bool RelayoutDependentOnChildrenBase(DimensionType dimension)
236         {
237             return viewWrapperImpl.RelayoutDependentOnChildrenBase( dimension );
238         }
239
240         /**
241          * @brief Determine if this actor is dependent on it's children for relayout from the base class.
242          *
243          * @param dimension The dimension(s) to check for
244          * @return Return if the actor is dependent on it's children.
245          */
246         protected bool RelayoutDependentOnChildrenBase()
247         {
248             return viewWrapperImpl.RelayoutDependentOnChildrenBase();
249         }
250
251         /**
252          * @brief Register a visual by Property Index, linking an Actor to visual when required.
253          * In the case of the visual being an actor or control deeming visual not required then visual should be an empty handle.
254          * No parenting is done during registration, this should be done by derived class.
255          *
256          * @param[in] index The Property index of the visual, used to reference visual
257          * @param[in] visual The visual to register
258          * @note Derived class should not call visual.SetOnStage(actor). It is the responsibility of the base class to connect/disconnect registered visual to stage.
259          *       Use below API with enabled set to false if derived class wishes to control when visual is staged.
260          */
261         protected void RegisterVisual(int index, VisualBase visual)
262         {
263             viewWrapperImpl.RegisterVisual( index, visual );
264         }
265
266         /**
267          * @brief Register a visual by Property Index, linking an Actor to visual when required.
268          * In the case of the visual being an actor or control deeming visual not required then visual should be an empty handle.
269          * If enabled is false then the visual is not set on stage until enabled by the derived class.
270          * @see EnableVisual
271          *
272          * @param[in] index The Property index of the visual, used to reference visual
273          * @param[in] visual The visual to register
274          * @param[in] enabled false if derived class wants to control when visual is set on stage.
275          *
276          */
277         protected void RegisterVisual(int index, VisualBase visual, bool enabled)
278         {
279             viewWrapperImpl.RegisterVisual( index, visual, enabled );
280         }
281
282         /**
283          * @brief Erase the entry matching the given index from the list of registered visuals
284          * @param[in] index The Property index of the visual, used to reference visual
285          *
286          */
287         protected void UnregisterVisual(int index)
288         {
289             viewWrapperImpl.UnregisterVisual( index );
290         }
291
292         /**
293          * @brief Retrieve the visual associated with the given property index.
294          *
295          * @param[in] index The Property index of the visual.
296          * @return The registered visual if exist, otherwise empty handle.
297          * @note For managing object life-cycle, do not store the returned visual as a member which increments its reference count.
298          */
299         protected VisualBase GetVisual(int index)
300         {
301             return viewWrapperImpl.GetVisual( index );
302         }
303
304         /**
305          * @brief Sets the given visual to be displayed or not when parent staged.
306          *
307          * @param[in] index The Property index of the visual
308          * @param[in] enable flag to set enabled or disabled.
309          */
310         protected void EnableVisual(int index, bool enable)
311         {
312             viewWrapperImpl.EnableVisual( index, enable );
313         }
314
315         /**
316          * @brief Queries if the given visual is to be displayed when parent staged.
317          *
318          * @param[in] index The Property index of the visual
319          * @return bool whether visual is enabled or not
320          */
321         protected bool IsVisualEnabled(int index)
322         {
323             return viewWrapperImpl.IsVisualEnabled( index );
324         }
325
326         /**
327          * @brief Create a transition effect on the control.
328          *
329          * @param[in] transitionData The transition data describing the effect to create
330          * @return A handle to an animation defined with the given effect, or an empty
331          * handle if no properties match.
332          */
333         protected Animation CreateTransition(TransitionData transitionData)
334         {
335             return viewWrapperImpl.CreateTransition( transitionData );
336         }
337
338         /**
339          * @brief Emits KeyInputFocusGained signal if true else emits KeyInputFocusLost signal
340          *
341          * Should be called last by the control after it acts on the Input Focus change.
342          *
343          * @param[in] focusGained True if gained, False if lost
344          */
345         protected void EmitKeyInputFocusSignal(bool focusGained)
346         {
347             viewWrapperImpl.EmitKeyInputFocusSignal( focusGained );
348         }
349
350         /**
351          * @brief This method is called after the Control has been initialized.
352          *
353          * Derived classes should do any second phase initialization by overriding this method.
354          */
355         public virtual void OnInitialize()
356         {
357         }
358
359         /**
360          * @brief Called after the actor has been connected to the stage.
361          *
362          * When an actor is connected, it will be directly or indirectly parented to the root Actor.
363          * @param[in] depth The depth in the hierarchy for the actor
364          *
365          * @note The root Actor is provided automatically by Dali::Stage, and is always considered to be connected.
366          * When the parent of a set of actors is connected to the stage, then all of the children
367          * will received this callback.
368          * For the following actor tree, the callback order will be A, B, D, E, C, and finally F.
369          *
370          * @code
371          *
372          *       A (parent)
373          *      / \
374          *     B   C
375          *    / \   \
376          *   D   E   F
377          *
378          * @endcode
379          * @param[in] depth The depth in the hierarchy for the actor
380          */
381         public virtual void OnStageConnection(int depth)
382         {
383         }
384
385         /**
386          * @brief Called after the actor has been disconnected from Stage.
387          *
388          * If an actor is disconnected it either has no parent, or is parented to a disconnected actor.
389          *
390          * @note When the parent of a set of actors is disconnected to the stage, then all of the children
391          * will received this callback, starting with the leaf actors.
392          * For the following actor tree, the callback order will be D, E, B, F, C, and finally A.
393          *
394          * @code
395          *
396          *       A (parent)
397          *      / \
398          *     B   C
399          *    / \   \
400          *   D   E   F
401          *
402          * @endcode
403          */
404         public virtual void OnStageDisconnection()
405         {
406         }
407
408         /**
409          * @brief Called after a child has been added to the owning actor.
410          *
411          * @param[in] child The child which has been added
412          */
413         public virtual void OnChildAdd(Actor actor)
414         {
415         }
416
417         /**
418          * @brief Called after the owning actor has attempted to remove a child( regardless of whether it succeeded or not ).
419          *
420          * @param[in] child The child being removed
421          */
422         public virtual void OnChildRemove(Actor actor)
423         {
424         }
425
426         /**
427          * @brief Called when the owning actor property is set.
428          *
429          * @param[in] index The Property index that was set
430          * @param[in] propertyValue The value to set
431          */
432         public virtual void OnPropertySet(int index, Dali.Property.Value propertyValue)
433         {
434         }
435
436         /**
437          * @brief Called when the owning actor's size is set e.g. using Actor::SetSize().
438          *
439          * @param[in] targetSize The target size. Note that this target size may not match the size returned via Actor.GetTargetSize.
440          */
441         public virtual void OnSizeSet(Vector3 targetSize)
442         {
443         }
444
445         /**
446          * @brief Called when the owning actor's size is animated e.g. using Animation::AnimateTo( Property( actor, Actor::Property::SIZE ), ... ).
447          *
448          * @param[in] animation The object which is animating the owning actor.
449          * @param[in] targetSize The target size. Note that this target size may not match the size returned via @ref Actor.GetTargetSize.
450          */
451         public virtual void OnSizeAnimation(Animation animation, Vector3 targetSize)
452         {
453         }
454
455         /**
456          * @DEPRECATED_1_1.37 Connect to TouchSignal() instead.
457          *
458          * @brief Called after a touch-event is received by the owning actor.
459          *
460          * @param[in] event The touch event
461          * @return True if the event should be consumed.
462          * @note CustomViewBehaviour.REQUIRES_TOUCH_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).
463          */
464         public virtual bool OnTouchEvent(TouchEvent touchEvent)
465         {
466             return false; // Do not consume
467         }
468
469         /**
470          * @brief Called after a hover-event is received by the owning actor.
471          *
472          * @param[in] hover The hover event
473          * @return True if the hover event should be consumed.
474          * @note CustomViewBehaviour.REQUIRES_HOVER_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).
475          */
476         public virtual bool OnHover(Hover hover)
477         {
478             return false; // Do not consume
479         }
480
481         /**
482          * @brief Called after a key-event is received by the actor that has had its focus set.
483          *
484          * @param[in] event the Key Event
485          * @return True if the event should be consumed.
486          */
487         public virtual bool OnKeyEvent(KeyEvent keyEvent)
488         {
489             return false; // Do not consume
490         }
491
492         /**
493          * @brief Called after a wheel-event is received by the owning actor.
494          *
495          * @param[in] event The wheel event
496          * @return True if the event should be consumed.
497          * @note CustomViewBehaviour.REQUIRES_WHEEL_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).
498          */
499         public virtual bool OnWheelEvent(WheelEvent wheelEvent)
500         {
501             return false; // Do not consume
502         }
503
504         /**
505          * @brief Called after the size negotiation has been finished for this control.
506          *
507          * The control is expected to assign this given size to itself/its children.
508          *
509          * Should be overridden by derived classes if they need to layout
510          * actors differently after certain operations like add or remove
511          * actors, resize or after changing specific properties.
512          *
513          * @param[in]      size       The allocated size.
514          * @param[in,out]  container  The control should add actors to this container that it is not able
515          *                            to allocate a size for.
516          * @note  As this function is called from inside the size negotiation algorithm, you cannot
517          * call RequestRelayout (the call would just be ignored).
518          */
519         public virtual void OnRelayout(Vector2 size, RelayoutContainer container)
520         {
521         }
522
523         /**
524          * @brief Notification for deriving classes
525          *
526          * @param[in] policy The policy being set
527          * @param[in] dimension The dimension the policy is being set for
528          */
529         public virtual void OnSetResizePolicy(ResizePolicyType policy, DimensionType dimension)
530         {
531         }
532
533         /**
534          * @brief Return the natural size of the actor.
535          *
536          * @return The actor's natural size
537          */
538         public virtual Vector3 GetNaturalSize()
539         {
540             return new Vector3(0.0f, 0.0f, 0.0f);
541         }
542
543         /**
544          * @brief Calculate the size for a child.
545          *
546          * @param[in] child The child actor to calculate the size for
547          * @param[in] dimension The dimension to calculate the size for. E.g. width or height.
548          * @return Return the calculated size for the given dimension.
549          */
550         public virtual float CalculateChildSize(Actor child, DimensionType dimension)
551         {
552             return viewWrapperImpl.CalculateChildSizeBase( child, dimension );
553         }
554
555         /**
556          * @brief This method is called during size negotiation when a height is required for a given width.
557          *
558          * Derived classes should override this if they wish to customize the height returned.
559          *
560          * @param width Width to use.
561          * @return The height based on the width.
562          */
563         public virtual float GetHeightForWidth(float width)
564         {
565             return viewWrapperImpl.GetHeightForWidthBase( width );
566         }
567
568         /**
569          * @brief This method is called during size negotiation when a width is required for a given height.
570          *
571          * Derived classes should override this if they wish to customize the width returned.
572          *
573          * @param height Height to use.
574          * @return The width based on the width.
575          */
576         public virtual float GetWidthForHeight(float height)
577         {
578             return viewWrapperImpl.GetWidthForHeightBase( height );
579         }
580
581         /**
582          * @brief Determine if this actor is dependent on it's children for relayout.
583          *
584          * @param dimension The dimension(s) to check for
585          * @return Return if the actor is dependent on it's children.
586          */
587         public virtual bool RelayoutDependentOnChildren(DimensionType dimension)
588         {
589             return viewWrapperImpl.RelayoutDependentOnChildrenBase( dimension );
590         }
591
592         /**
593          * @brief Determine if this actor is dependent on it's children for relayout from the base class.
594          *
595          * @return Return if the actor is dependent on it's children.
596          */
597         public virtual bool RelayoutDependentOnChildren()
598         {
599             return viewWrapperImpl.RelayoutDependentOnChildrenBase();
600         }
601
602         /**
603          * @brief Virtual method to notify deriving classes that relayout dependencies have been
604          * met and the size for this object is about to be calculated for the given dimension
605          *
606          * @param dimension The dimension that is about to be calculated
607          */
608         public virtual void OnCalculateRelayoutSize(DimensionType dimension)
609         {
610         }
611
612         /**
613          * @brief Virtual method to notify deriving classes that the size for a dimension
614          * has just been negotiated
615          *
616          * @param[in] size The new size for the given dimension
617          * @param[in] dimension The dimension that was just negotiated
618          */
619         public virtual void OnLayoutNegotiated(float size, DimensionType dimension)
620         {
621         }
622
623         /**
624          * @brief This method should be overridden by deriving classes requiring notifications when the style changes.
625          *
626          * @param[in] styleManager  The StyleManager object.
627          * @param[in] change  Information denoting what has changed.
628          */
629         public virtual void OnStyleChange(StyleManager styleManager, StyleChangeType change)
630         {
631         }
632
633         /**
634          * @brief This method is called when the control is accessibility activated.
635          *
636          * Derived classes should override this to perform custom accessibility activation.
637          * @return true if this control can perform accessibility activation.
638          */
639         public virtual bool OnAccessibilityActivated()
640         {
641             return false;
642         }
643
644         /**
645          * @brief This method should be overridden by deriving classes when they wish to respond the accessibility
646          * pan gesture.
647          *
648          * @param[in] gesture The pan gesture.
649          * @return true if the pan gesture has been consumed by this control
650          */
651         public virtual bool OnAccessibilityPan(PanGesture gestures)
652         {
653             return false;
654         }
655
656         /**
657          * @brief This method should be overridden by deriving classes when they wish to respond the accessibility
658          * touch event.
659          *
660          * @param[in] touchEvent The touch event.
661          * @return true if the touch event has been consumed by this control
662          */
663         public virtual bool OnAccessibilityTouch(TouchEvent touchEvent)
664         {
665             return false;
666         }
667
668         /**
669          * @brief This method should be overridden by deriving classes when they wish to respond
670          * the accessibility up and down action (i.e. value change of slider control).
671          *
672          * @param[in] isIncrease Whether the value should be increased or decreased
673          * @return true if the value changed action has been consumed by this control
674          */
675         public virtual bool OnAccessibilityValueChange(bool isIncrease)
676         {
677             return false;
678         }
679
680         /**
681          * @brief This method should be overridden by deriving classes when they wish to respond
682          * the accessibility zoom action.
683          *
684          * @return true if the zoom action has been consumed by this control
685          */
686         public virtual bool OnAccessibilityZoom()
687         {
688             return false;
689         }
690
691         /**
692          * @brief This method should be overridden by deriving classes when they wish to respond
693          * the accessibility zoom action.
694          *
695          * @return true if the zoom action has been consumed by this control
696          */
697         public virtual void OnKeyInputFocusGained()
698         {
699         }
700
701         /**
702          * @brief Called when the control loses key input focus.
703          *
704          * Should be overridden by derived classes if they need to customize what happens when focus is lost.
705          */
706         public virtual void OnKeyInputFocusLost()
707         {
708         }
709
710         /**
711          * @brief Gets the next keyboard focusable actor in this control towards the given direction.
712          *
713          * A control needs to override this function in order to support two dimensional keyboard navigation.
714          * @param[in] currentFocusedActor The current focused actor.
715          * @param[in] direction The direction to move the focus towards.
716          * @param[in] loopEnabled Whether the focus movement should be looped within the control.
717          * @return the next keyboard focusable actor in this control or an empty handle if no actor can be focused.
718          */
719         public virtual Actor GetNextKeyboardFocusableActor(Actor currentFocusedActor, View.KeyboardFocus.Direction direction, bool loopEnabled)
720         {
721             return new Actor();
722         }
723
724         /**
725          * @brief Informs this control that its chosen focusable actor will be focused.
726          *
727          * This allows the application to preform any actions if wishes
728          * before the focus is actually moved to the chosen actor.
729          *
730          * @param[in] commitedFocusableActor The commited focusable actor.
731          */
732         public virtual void OnKeyboardFocusChangeCommitted(Actor commitedFocusableActor)
733         {
734         }
735
736         /**
737          * @brief This method is called when the control has enter pressed on it.
738          *
739          * Derived classes should override this to perform custom actions.
740          * @return true if this control supported this action.
741          */
742         public virtual bool OnKeyboardEnter()
743         {
744             return false;
745         }
746
747         /**
748          * @brief Called whenever a pinch gesture is detected on this control.
749          *
750          * This can be overridden by deriving classes when pinch detection
751          * is enabled.  The default behaviour is to scale the control by the
752          * pinch scale.
753          *
754          * @param[in]  pinch  The pinch gesture.
755          * @note If overridden, then the default behaviour will not occur.
756          * @note Pinch detection should be enabled via EnableGestureDetection().
757          * @see EnableGestureDetection
758          */
759         public virtual void OnPinch(PinchGesture pinch)
760         {
761         }
762
763         /**
764          * @brief Called whenever a pan gesture is detected on this control.
765          *
766          * This should be overridden by deriving classes when pan detection
767          * is enabled.
768          *
769          * @param[in]  pan  The pan gesture.
770          * @note There is no default behaviour with panning.
771          * @note Pan detection should be enabled via EnableGestureDetection().
772          * @see EnableGestureDetection
773          */
774         public virtual void OnPan(PanGesture pan)
775         {
776         }
777
778         /**
779          * @brief Called whenever a tap gesture is detected on this control.
780          *
781          * This should be overridden by deriving classes when tap detection
782          * is enabled.
783          *
784          * @param[in]  tap  The tap gesture.
785          * @note There is no default behaviour with a tap.
786          * @note Tap detection should be enabled via EnableGestureDetection().
787          * @see EnableGestureDetection
788          */
789         public virtual void OnTap(TapGesture tap)
790         {
791         }
792
793         /**
794          * @brief Called whenever a long press gesture is detected on this control.
795          *
796          * This should be overridden by deriving classes when long press
797          * detection is enabled.
798          *
799          * @param[in]  longPress  The long press gesture.
800          * @note There is no default behaviour associated with a long press.
801          * @note Long press detection should be enabled via EnableGestureDetection().
802          * @see EnableGestureDetection
803          */
804         public virtual void OnLongPress(LongPressGesture longPress)
805         {
806         }
807
808         private void SignalConnected(SlotObserver slotObserver, SWIGTYPE_p_Dali__CallbackBase callback)
809         {
810         }
811
812         private void SignalDisconnected(SlotObserver slotObserver, SWIGTYPE_p_Dali__CallbackBase callback)
813         {
814         }
815
816         private void OnControlChildAdd(Actor child)
817         {
818         }
819
820         private void OnControlChildRemove(Actor child)
821         {
822         }
823     }
824 }