Revert "[NUI] Fix ConvertIdToView (#877)" (#889)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Xaml / src / public / Forms / BaseComponents / CustomView.cs
1 /*
2  * Copyright (c) 2017 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 using System.ComponentModel;
18 using Tizen.NUI;
19 using Tizen.NUI.XamlBinding;
20
21 namespace Tizen.NUI.Xaml.Forms.BaseComponents
22 {
23     internal class InternalCustomeView : Tizen.NUI.BaseComponents.CustomView
24     {
25         public InternalCustomeView(string typeName, CustomViewBehaviour behaviour) : base(typeName, behaviour)
26         {
27
28         }
29         /// <summary>
30         /// Requests a relayout, which means performing a size negotiation on this view, its parent, and children (and potentially whole scene).<br />
31         /// This method can also be called from a derived class every time it needs a different size.<br />
32         /// At the end of event processing, the relayout process starts and all controls which requested relayout will have their sizes (re)negotiated.<br />
33         /// It can be called multiple times; the size negotiation is still only performed once, i.e., there is no need to keep track of this in the calling side.<br />
34         /// </summary>
35         /// <since_tizen> 6 </since_tizen>
36         public new void RelayoutRequest()
37         {
38             base.RelayoutRequest();
39         }
40
41         /// <summary>
42         /// Provides the view implementation of GetHeightForWidth.
43         /// </summary>
44         /// <param name="width">The width to use.</param>
45         /// <returns>The height based on the width.</returns>
46         /// <since_tizen> 6 </since_tizen>
47         public new float GetHeightForWidthBase(float width)
48         {
49             return base.GetHeightForWidthBase(width);
50         }
51
52         /// <summary>
53         /// Provides the view implementation of GetWidthForHeight.
54         /// </summary>
55         /// <param name="height">The height to use.</param>
56         /// <returns>The width based on the height.</returns>
57         /// <since_tizen> 6 </since_tizen>
58         public new float GetWidthForHeightBase(float height)
59         {
60             return base.GetWidthForHeightBase(height);
61         }
62
63         /// <summary>
64         /// Calculates the size for a child using the base view object.
65         /// </summary>
66         /// <param name="child">The child view to calculate the size for.</param>
67         /// <param name="dimension">The dimension to calculate the size, for example, the width or the height.</param>
68         /// <returns>Return the calculated size for the given dimension. If more than one dimension is requested, just return the first one found.</returns>
69         /// <since_tizen> 6 </since_tizen>
70         public float CalculateChildSizeBase(View child, DimensionType dimension)
71         {
72             return base.CalculateChildSizeBase(child.ViewInstance, dimension);
73         }
74
75         /// <summary>
76         /// Determines if this view is dependent on it's children for relayout from the base class.
77         /// </summary>
78         /// <param name="dimension">The dimension(s) to check for.</param>
79         /// <returns>Return if the view is dependent on it's children.</returns>
80         /// <since_tizen> 6 </since_tizen>
81         public new bool RelayoutDependentOnChildrenBase(DimensionType dimension)
82         {
83             return base.RelayoutDependentOnChildrenBase(dimension);
84         }
85
86         /// <summary>
87         /// Determines if this view is dependent on it's children for relayout from the base class.
88         /// </summary>
89         /// <returns>Return if the view is dependent on it's children.</returns>
90         /// <since_tizen> 6 </since_tizen>
91         public new bool RelayoutDependentOnChildrenBase()
92         {
93             return base.RelayoutDependentOnChildrenBase();
94         }
95
96         /// <summary>
97         /// Registers a visual by property index, linking a view to visual when required.<br />
98         /// In the case of the visual being a view or control deeming visual not required, then the visual should be an empty handle.<br />
99         /// No parenting is done during registration, this should be done by a derived class.<br />
100         /// </summary>
101         /// <param name="index">The property index of the visual used to reference visual.</param>
102         /// <param name="visual">The visual to register.</param>
103         /// <since_tizen> 6 </since_tizen>
104         public new void RegisterVisual(int index, VisualBase visual)
105         {
106             base.RegisterVisual(index, visual);
107         }
108
109         /// <summary>
110         /// Registers a visual by the property index, linking a view to visual when required.<br />
111         /// In the case of the visual being a view or control deeming visual not required, then the visual should be an empty handle.<br />
112         /// If enabled is false, then the visual is not set on the stage until enabled by the derived class.<br />
113         /// </summary>
114         /// <param name="index">The property index of the visual used to reference visual.</param>
115         /// <param name="visual">The visual to register.</param>
116         /// <param name="enabled">False if derived class wants to control when the visual is set on the stage.</param>
117         /// <since_tizen> 6 </since_tizen>
118         public new void RegisterVisual(int index, VisualBase visual, bool enabled)
119         {
120             base.RegisterVisual(index, visual, enabled);
121         }
122
123         /// <summary>
124         /// Erases the entry matching the given index from the list of registered visuals.
125         /// </summary>
126         /// <param name="index">The property index of the visual used to reference visual.</param>
127         /// <since_tizen> 6 </since_tizen>
128         public new void UnregisterVisual(int index)
129         {
130             base.UnregisterVisual(index);
131         }
132
133         /// <summary>
134         /// Retrieves the visual associated with the given property index.<br />
135         /// For managing the object lifecycle, do not store the returned visual as a member which increments its reference count.<br />
136         /// </summary>
137         /// <param name="index">The property index of the visual used to reference visual.</param>
138         /// <returns>The registered visual if exists, otherwise an empty handle.</returns>
139         /// <since_tizen> 6 </since_tizen>
140         public new VisualBase GetVisual(int index)
141         {
142             return base.GetVisual(index);
143         }
144
145         /// <summary>
146         /// Sets the given visual to be displayed or not when parent staged.<br />
147         /// For managing the object lifecycle, do not store the returned visual as a member which increments its reference count.<br />
148         /// </summary>
149         /// <param name="index">The property index of the visual, used to reference visual.</param>
150         /// <param name="enable">Flag set to enabled or disabled.</param>
151         /// <since_tizen> 6 </since_tizen>
152         public new void EnableVisual(int index, bool enable)
153         {
154             base.EnableVisual(index, enable);
155         }
156
157         /// <summary>
158         /// Queries if the given visual is to be displayed when parent staged.<br />
159         /// For managing the object lifecycle, do not store the returned visual as a member which increments its reference count.<br />
160         /// </summary>
161         /// <param name="index">The property index of the visual.</param>
162         /// <returns>Whether visual is enabled or not.</returns>
163         /// <since_tizen> 6 </since_tizen>
164         public new bool IsVisualEnabled(int index)
165         {
166             return base.IsVisualEnabled(index);
167         }
168
169         /// <summary>
170         /// Creates a transition effect on the control.
171         /// </summary>
172         /// <param name="transitionData">The transition data describing the effect to create.</param>
173         /// <returns>A handle to an animation defined with the given effect, or an empty handle if no properties match.</returns>
174         /// <since_tizen> 6 </since_tizen>
175         public new Animation CreateTransition(TransitionData transitionData)
176         {
177             return base.CreateTransition(transitionData);
178         }
179
180         /// <summary>
181         /// Emits the KeyInputFocusGained signal if true, else, emits the KeyInputFocusLost signal.<br />
182         /// Should be called last by the control after it acts on the input focus change.<br />
183         /// </summary>
184         /// <param name="focusGained">True if gained, false if lost.</param>
185         /// <since_tizen> 6 </since_tizen>
186         public new void EmitFocusSignal(bool focusGained)
187         {
188             base.EmitFocusSignal(focusGained);
189         }
190     }
191
192     /// <summary>
193     /// CustomView provides some common functionality required by all views.
194     /// </summary>
195     /// <since_tizen> 6 </since_tizen>
196     [EditorBrowsable(EditorBrowsableState.Never)]
197     public class CustomView : View
198     {
199         private InternalCustomeView _customView;
200         internal InternalCustomeView customView
201         {
202             get
203             {
204                 if (null == _customView)
205                 {
206                     _customView = handleInstance as InternalCustomeView;
207                 }
208
209                 return _customView;
210             }
211         }
212
213         /// <summary>
214         /// Creates a new instance of a Xaml CustomView.
215         /// </summary>
216         /// <since_tizen> 6 </since_tizen>
217         [EditorBrowsable(EditorBrowsableState.Never)]
218         public CustomView(string typeName, CustomViewBehaviour behaviour) : this(new Tizen.NUI.BaseComponents.CustomView(typeName, behaviour))
219         {
220         }
221
222         internal CustomView(Tizen.NUI.BaseComponents.CustomView nuiInstance) : base(nuiInstance)
223         {
224             SetNUIInstance(nuiInstance);
225         }
226
227         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
228         [EditorBrowsable(EditorBrowsableState.Never)]
229         public static readonly BindableProperty FocusNavigationSupportProperty = BindableProperty.Create("FocusNavigationSupport", typeof(bool), typeof(CustomView), false, propertyChanged: (bindable, oldValue, newValue) =>
230         {
231             var customView = ((CustomView)bindable).customView;
232             customView.FocusNavigationSupport = (bool)newValue;
233         },
234         defaultValueCreator:(bindable) =>
235         {
236             var customView = ((CustomView)bindable).customView;
237             return customView.FocusNavigationSupport;
238         });
239         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
240         [EditorBrowsable(EditorBrowsableState.Never)]
241         public static readonly BindableProperty FocusGroupProperty = BindableProperty.Create("FocusGroup", typeof(bool), typeof(CustomView), false, propertyChanged: (bindable, oldValue, newValue) =>
242         {
243             var customView = ((CustomView)bindable).customView;
244             customView.FocusGroup = (bool)newValue;
245         },
246         defaultValueCreator:(bindable) =>
247         {
248             var customView = ((CustomView)bindable).customView;
249             return customView.FocusGroup;
250         });
251
252         /// <summary>
253         /// Sets the background with a property map.
254         /// </summary>
255         /// <param name="map">The background property map.</param>
256         /// <since_tizen> 6 </since_tizen>
257         [EditorBrowsable(EditorBrowsableState.Never)]
258         public void SetBackground(PropertyMap map)
259         {
260             customView.SetBackground(map);
261         }
262
263         /// <summary>
264         /// Allows deriving classes to enable any of the gesture detectors that are available.<br />
265         /// Gesture detection can be enabled one at a time or in a bitwise format.<br />
266         /// </summary>
267         /// <param name="type">The gesture type(s) to enable.</param>
268         /// <since_tizen> 6 </since_tizen>
269         [EditorBrowsable(EditorBrowsableState.Never)]
270         public void EnableGestureDetection(Gesture.GestureType type)
271         {
272             customView.EnableGestureDetection(type);
273         }
274
275         /// <summary>
276         /// Sets whether this control supports two dimensional keyboard navigation
277         /// (i.e., whether it knows how to handle the keyboard focus movement between its child views).<br />
278         /// The control doesn't support it by default.<br />
279         /// </summary>
280         /// <since_tizen> 6 </since_tizen>
281         [EditorBrowsable(EditorBrowsableState.Never)]
282         public bool FocusNavigationSupport
283         {
284             get
285             {
286                 return (bool)GetValue(FocusNavigationSupportProperty);
287             }
288             set
289             {
290                 SetValue(FocusNavigationSupportProperty, value);
291             }
292         }
293
294         /// <summary>
295         /// Sets or gets whether this control is a focus group for keyboard navigation.
296         /// </summary>
297         /// <returns>True if this control is set as a focus group for keyboard navigation.</returns>
298         /// <since_tizen> 6 </since_tizen>
299         [EditorBrowsable(EditorBrowsableState.Never)]
300         public bool FocusGroup
301         {
302             get
303             {
304                 return (bool)GetValue(FocusGroupProperty);
305             }
306             set
307             {
308                 SetValue(FocusGroupProperty, value);
309             }
310         }
311
312         /// <summary>
313         /// This method is called after the control has been initialized.<br />
314         /// Derived classes should do any second phase initialization by overriding this method.<br />
315         /// </summary>
316         /// <since_tizen> 6 </since_tizen>
317         [EditorBrowsable(EditorBrowsableState.Never)]
318         public virtual void OnInitialize()
319         {
320         }
321
322         /// <summary>
323         /// Called after the view has been connected to the stage.<br />
324         /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
325         /// The root view is provided automatically by Tizen.NUI.Stage, and is always considered to be connected.<br />
326         /// When the parent of a set of views is connected to the stage, then all of the children will receive this callback.<br />
327         /// </summary>
328         /// <param name="depth">The depth in the hierarchy for the view.</param>
329         /// <since_tizen> 6 </since_tizen>
330         [EditorBrowsable(EditorBrowsableState.Never)]
331         public virtual void OnStageConnection(int depth)
332         {
333         }
334
335         /// <summary>
336         /// Called after the view has been disconnected from the stage.<br />
337         /// If a view is disconnected, it either has no parent, or is parented to a disconnected view.<br />
338         /// When the parent of a set of views is disconnected to the stage, then all of the children will receive this callback, starting with the leaf views.<br />
339         /// </summary>
340         /// <since_tizen> 6 </since_tizen>
341         [EditorBrowsable(EditorBrowsableState.Never)]
342         public virtual void OnStageDisconnection()
343         {
344         }
345
346         /// <summary>
347         /// Called after a child has been added to the owning view.
348         /// </summary>
349         /// <param name="view">The child which has been added.</param>
350         /// <since_tizen> 6 </since_tizen>
351         [EditorBrowsable(EditorBrowsableState.Never)]
352         public virtual void OnChildAdd(View view)
353         {
354         }
355
356         /// <summary>
357         /// Called after the owning view has attempted to remove a child( regardless of whether it succeeded or not ).
358         /// </summary>
359         /// <param name="view">The child being removed.</param>
360         /// <since_tizen> 6 </since_tizen>
361         [EditorBrowsable(EditorBrowsableState.Never)]
362         public virtual void OnChildRemove(View view)
363         {
364         }
365
366         /// <summary>
367         /// Called when the owning view property is set.
368         /// </summary>
369         /// <param name="index">The property index that was set.</param>
370         /// <param name="propertyValue">The value to set.</param>
371         /// <since_tizen> 6 </since_tizen>
372         [EditorBrowsable(EditorBrowsableState.Never)]
373         public virtual void OnPropertySet(int index, PropertyValue propertyValue)
374         {
375         }
376
377         /// <summary>
378         /// Called when the owning view's size is set, for example, using View.SetSize().
379         /// </summary>
380         /// <param name="targetSize">The target size.</param>
381         /// <since_tizen> 6 </since_tizen>
382         [EditorBrowsable(EditorBrowsableState.Never)]
383         public virtual void OnSizeSet(Vector3 targetSize)
384         {
385         }
386
387         /// <summary>
388         /// Called when the owning view's size is animated, for example, using Animation::AnimateTo( Property ( view, View::Property::SIZE ), ... ).
389         /// </summary>
390         /// <param name="animation">The object which is animating the owning view.</param>
391         /// <param name="targetSize">The target size.</param>
392         /// <since_tizen> 6 </since_tizen>
393         [EditorBrowsable(EditorBrowsableState.Never)]
394         public virtual void OnSizeAnimation(Animation animation, Vector3 targetSize)
395         {
396         }
397
398         /// <summary>
399         /// Called after a touch event is received by the owning view.<br />
400         /// CustomViewBehaviour.REQUIRES_TOUCH_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).<br />
401         /// </summary>
402         /// <param name="touch">The touch event.</param>
403         /// <returns>True if the event should be consumed.</returns>
404         /// <since_tizen> 6 </since_tizen>
405         [EditorBrowsable(EditorBrowsableState.Never)]
406         public virtual bool OnTouch(Touch touch)
407         {
408             return false; // Do not consume
409         }
410
411         /// <summary>
412         /// Called after a hover event is received by the owning view.<br />
413         /// CustomViewBehaviour.REQUIRES_HOVER_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).<br />
414         /// </summary>
415         /// <param name="hover">The hover event.</param>
416         /// <returns>True if the hover event should be consumed.</returns>
417         /// <since_tizen> 6 </since_tizen>
418         [EditorBrowsable(EditorBrowsableState.Never)]
419         public virtual bool OnHover(Hover hover)
420         {
421             return false; // Do not consume
422         }
423
424         /// <summary>
425         /// Called after a key event is received by the view that has had its focus set.
426         /// </summary>
427         /// <param name="key">The key event.</param>
428         /// <returns>True if the key event should be consumed.</returns>
429         /// <since_tizen> 6 </since_tizen>
430         [EditorBrowsable(EditorBrowsableState.Never)]
431         public virtual bool OnKey(Key key)
432         {
433             return false; // Do not consume
434         }
435
436         /// <summary>
437         /// Called after a wheel event is received by the owning view.<br />
438         /// CustomViewBehaviour.REQUIRES_WHEEL_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).<br />
439         /// </summary>
440         /// <param name="wheel">The wheel event.</param>
441         /// <returns>True if the wheel event should be consumed.</returns>
442         /// <since_tizen> 6 </since_tizen>
443         [EditorBrowsable(EditorBrowsableState.Never)]
444         public virtual bool OnWheel(Wheel wheel)
445         {
446             return false; // Do not consume
447         }
448
449         /// <summary>
450         /// Called after the size negotiation has been finished for this control.<br />
451         /// The control is expected to assign this given size to itself or its children.<br />
452         /// Should be overridden by derived classes if they need to layout views differently after certain operations like add or remove views, resize, or after changing specific properties.<br />
453         /// As this function is called from inside the size negotiation algorithm, you cannot call RequestRelayout (the call would just be ignored).<br />
454         /// </summary>
455         /// <param name="size">The allocated size.</param>
456         /// <param name="container">The control should add views to this container that it is not able to allocate a size for.</param>
457         /// <since_tizen> 6 </since_tizen>
458         [EditorBrowsable(EditorBrowsableState.Never)]
459         public virtual void OnRelayout(Vector2 size, RelayoutContainer container)
460         {
461         }
462
463         /// <summary>
464         /// Notification for deriving classes.
465         /// </summary>
466         /// <param name="policy">The policy being set.</param>
467         /// <param name="dimension">The policy is being set for.</param>
468         /// <since_tizen> 6 </since_tizen>
469         [EditorBrowsable(EditorBrowsableState.Never)]
470         public virtual void OnSetResizePolicy(ResizePolicyType policy, DimensionType dimension)
471         {
472         }
473
474         /// <summary>
475         /// Returns the natural size of the view.
476         /// </summary>
477         /// <returns>The view's natural size</returns>
478         /// <since_tizen> 6 </since_tizen>
479         [EditorBrowsable(EditorBrowsableState.Never)]
480         public virtual Size2D GetNaturalSize()
481         {
482             return new Size2D(0, 0);
483         }
484
485         /// <summary>
486         /// Calculates the size for a child.
487         /// </summary>
488         /// <param name="child">The child view to calculate the size for.</param>
489         /// <param name="dimension">The dimension to calculate the size, for example, the width or the height.</param>
490         /// <returns>Return the calculated size for the given dimension. If more than one dimension is requested, just return the first one found.</returns>
491         /// <since_tizen> 6 </since_tizen>
492         [EditorBrowsable(EditorBrowsableState.Never)]
493         public virtual float CalculateChildSize(View child, DimensionType dimension)
494         {
495             return customView.CalculateChildSize(child.view, dimension);
496         }
497
498         /// <summary>
499         /// This method is called during size negotiation when a height is required for a given width.<br />
500         /// Derived classes should override this if they wish to customize the height returned.<br />
501         /// </summary>
502         /// <param name="width">Width to use</param>
503         /// <returns>The height based on the width</returns>
504         /// <since_tizen> 6 </since_tizen>
505         [EditorBrowsable(EditorBrowsableState.Never)]
506         public new virtual float GetHeightForWidth(float width)
507         {
508             return customView.GetHeightForWidth(width);
509         }
510
511         /// <summary>
512         /// This method is called during size negotiation when a width is required for a given height.<br />
513         /// Derived classes should override this if they wish to customize the width returned.<br />
514         /// </summary>
515         /// <param name="height">Height to use</param>
516         /// <returns>The width based on the width</returns>
517         /// <since_tizen> 6 </since_tizen>
518         [EditorBrowsable(EditorBrowsableState.Never)]
519         public new virtual float GetWidthForHeight(float height)
520         {
521             return customView.GetWidthForHeight(height);
522         }
523
524         /// <summary>
525         /// Determines if this view is dependent on it's children for relayout.
526         /// </summary>
527         /// <param name="dimension">The dimension(s) to check for.</param>
528         /// <returns>Return if the view is dependent on it's children.</returns>
529         /// <since_tizen> 6 </since_tizen>
530         [EditorBrowsable(EditorBrowsableState.Never)]
531         public virtual bool RelayoutDependentOnChildren(DimensionType dimension)
532         {
533             return customView.RelayoutDependentOnChildren(dimension);
534         }
535
536         /// <summary>
537         /// Determines if this view is dependent on it's children for relayout from the base class.
538         /// </summary>
539         /// <returns>Return true if the view is dependent on it's children.</returns>
540         /// <since_tizen> 6 </since_tizen>
541         [EditorBrowsable(EditorBrowsableState.Never)]
542         public virtual bool RelayoutDependentOnChildren()
543         {
544             return customView.RelayoutDependentOnChildren();
545         }
546
547         /// <summary>
548         /// The virtual method to notify deriving classes that relayout dependencies have been
549         /// met and the size for this object is about to be calculated for the given dimension.
550         /// </summary>
551         /// <param name="dimension">The dimension that is about to be calculated.</param>
552         /// <since_tizen> 6 </since_tizen>
553         [EditorBrowsable(EditorBrowsableState.Never)]
554         public virtual void OnCalculateRelayoutSize(DimensionType dimension)
555         {
556         }
557
558         /// <summary>
559         /// The virtual method to notify deriving classes that the size for a dimension has just been negotiated.
560         /// </summary>
561         /// <param name="size">The new size for the given dimension.</param>
562         /// <param name="dimension">The dimension that was just negotiated.</param>
563         /// <since_tizen> 6 </since_tizen>
564         [EditorBrowsable(EditorBrowsableState.Never)]
565         public virtual void OnLayoutNegotiated(float size, DimensionType dimension)
566         {
567         }
568
569         /// <summary>
570         /// This method should be overridden by deriving classes requiring notifications when the style changes.
571         /// </summary>
572         /// <param name="styleManager">The StyleManager object.</param>
573         /// <param name="change">Information denoting what has changed.</param>
574         /// <since_tizen> 6 </since_tizen>
575         [EditorBrowsable(EditorBrowsableState.Never)]
576         public virtual void OnStyleChange(StyleManager styleManager, StyleChangeType change)
577         {
578         }
579
580         /// <summary>
581         /// Called when the control gain key input focus. Should be overridden by derived classes if they need to customize what happens when the focus is gained.
582         /// </summary>
583         /// <since_tizen> 6 </since_tizen>
584         [EditorBrowsable(EditorBrowsableState.Never)]
585         public virtual void OnFocusGained()
586         {
587         }
588
589         /// <summary>
590         /// Called when the control loses key input focus. Should be overridden by derived classes if they need to customize what happens when the focus is lost.
591         /// </summary>
592         /// <since_tizen> 6 </since_tizen>
593         [EditorBrowsable(EditorBrowsableState.Never)]
594         public virtual void OnFocusLost()
595         {
596         }
597
598         /// <summary>
599         /// Gets the next keyboard focusable view in this control towards the given direction.<br />
600         /// A control needs to override this function in order to support two dimensional keyboard navigation.<br />
601         /// </summary>
602         /// <param name="currentFocusedView">The current focused view.</param>
603         /// <param name="direction">The direction to move the focus towards.</param>
604         /// <param name="loopEnabled">Whether the focus movement should be looped within the control.</param>
605         /// <returns>The next keyboard focusable view in this control or an empty handle if no view can be focused.</returns>
606         /// <since_tizen> 6 </since_tizen>
607         [EditorBrowsable(EditorBrowsableState.Never)]
608         public virtual View GetNextFocusableView(View currentFocusedView, Tizen.NUI.BaseComponents.View.FocusDirection direction, bool loopEnabled)
609         {
610             return new View();
611         }
612
613         /// <summary>
614         /// Informs this control that its chosen focusable view will be focused.<br />
615         /// This allows the application to preform any actions it wishes before the focus is actually moved to the chosen view.<br />
616         /// </summary>
617         /// <param name="commitedFocusableView">The commited focused view.</param>
618         /// <since_tizen> 6 </since_tizen>
619         [EditorBrowsable(EditorBrowsableState.Never)]
620         public virtual void OnFocusChangeCommitted(View commitedFocusableView)
621         {
622         }
623
624         /// <summary>
625         /// This method is called when the control has enter pressed on it.<br />
626         /// Derived classes should override this to perform custom actions.<br />
627         /// </summary>
628         /// <returns>True if this control supported this action.</returns>
629         /// <since_tizen> 6 </since_tizen>
630         [EditorBrowsable(EditorBrowsableState.Never)]
631         public virtual bool OnKeyboardEnter()
632         {
633             return false;
634         }
635
636         /// <summary>
637         /// Called whenever a pan gesture is detected on this control.<br />
638         /// This should be overridden by deriving classes when pan detection is enabled.<br />
639         /// There is no default behavior with panning.<br />
640         /// Pan detection should be enabled via EnableGestureDetection().<br />
641         /// </summary>
642         /// <param name="pan">The pan gesture.</param>
643         /// <since_tizen> 6 </since_tizen>
644         [EditorBrowsable(EditorBrowsableState.Never)]
645         public virtual void OnPan(PanGesture pan)
646         {
647         }
648
649         /// <summary>
650         /// Called whenever a tap gesture is detected on this control.<br />
651         /// This should be overridden by deriving classes when tap detection is enabled.<br />
652         /// There is no default behavior with a tap.<br />
653         /// Tap detection should be enabled via EnableGestureDetection().<br />
654         /// </summary>
655         /// <param name="tap">The tap gesture.</param>
656         /// <since_tizen> 6 </since_tizen>
657         [EditorBrowsable(EditorBrowsableState.Never)]
658         public virtual void OnTap(TapGesture tap)
659         {
660         }
661
662         /// <summary>
663         /// Requests a relayout, which means performing a size negotiation on this view, its parent, and children (and potentially whole scene).<br />
664         /// This method can also be called from a derived class every time it needs a different size.<br />
665         /// At the end of event processing, the relayout process starts and all controls which requested relayout will have their sizes (re)negotiated.<br />
666         /// It can be called multiple times; the size negotiation is still only performed once, i.e., there is no need to keep track of this in the calling side.<br />
667         /// </summary>
668         /// <since_tizen> 6 </since_tizen>
669         [EditorBrowsable(EditorBrowsableState.Never)]
670         protected void RelayoutRequest()
671         {
672             customView.RelayoutRequest();
673         }
674
675         /// <summary>
676         /// Provides the view implementation of GetHeightForWidth.
677         /// </summary>
678         /// <param name="width">The width to use.</param>
679         /// <returns>The height based on the width.</returns>
680         /// <since_tizen> 6 </since_tizen>
681         [EditorBrowsable(EditorBrowsableState.Never)]
682         protected float GetHeightForWidthBase(float width)
683         {
684             return customView.GetHeightForWidthBase(width);
685         }
686
687         /// <summary>
688         /// Provides the view implementation of GetWidthForHeight.
689         /// </summary>
690         /// <param name="height">The height to use.</param>
691         /// <returns>The width based on the height.</returns>
692         /// <since_tizen> 6 </since_tizen>
693         [EditorBrowsable(EditorBrowsableState.Never)]
694         protected float GetWidthForHeightBase(float height)
695         {
696             return customView.GetWidthForHeightBase(height);
697         }
698
699         /// <summary>
700         /// Calculates the size for a child using the base view object.
701         /// </summary>
702         /// <param name="child">The child view to calculate the size for.</param>
703         /// <param name="dimension">The dimension to calculate the size, for example, the width or the height.</param>
704         /// <returns>Return the calculated size for the given dimension. If more than one dimension is requested, just return the first one found.</returns>
705         /// <since_tizen> 6 </since_tizen>
706         [EditorBrowsable(EditorBrowsableState.Never)]
707         protected float CalculateChildSizeBase(View child, DimensionType dimension)
708         {
709             return customView.CalculateChildSizeBase(child, dimension);
710         }
711
712         /// <summary>
713         /// Determines if this view is dependent on it's children for relayout from the base class.
714         /// </summary>
715         /// <param name="dimension">The dimension(s) to check for.</param>
716         /// <returns>Return if the view is dependent on it's children.</returns>
717         /// <since_tizen> 6 </since_tizen>
718         [EditorBrowsable(EditorBrowsableState.Never)]
719         protected bool RelayoutDependentOnChildrenBase(DimensionType dimension)
720         {
721             return customView.RelayoutDependentOnChildrenBase(dimension);
722         }
723
724         /// <summary>
725         /// Determines if this view is dependent on it's children for relayout from the base class.
726         /// </summary>
727         /// <returns>Return if the view is dependent on it's children.</returns>
728         /// <since_tizen> 6 </since_tizen>
729         [EditorBrowsable(EditorBrowsableState.Never)]
730         protected bool RelayoutDependentOnChildrenBase()
731         {
732             return customView.RelayoutDependentOnChildrenBase();
733         }
734
735         /// <summary>
736         /// Registers a visual by property index, linking a view to visual when required.<br />
737         /// In the case of the visual being a view or control deeming visual not required, then the visual should be an empty handle.<br />
738         /// No parenting is done during registration, this should be done by a derived class.<br />
739         /// </summary>
740         /// <param name="index">The property index of the visual used to reference visual.</param>
741         /// <param name="visual">The visual to register.</param>
742         /// <since_tizen> 6 </since_tizen>
743         [EditorBrowsable(EditorBrowsableState.Never)]
744         protected void RegisterVisual(int index, VisualBase visual)
745         {
746             customView.RegisterVisual(index, visual);
747         }
748
749         /// <summary>
750         /// Registers a visual by the property index, linking a view to visual when required.<br />
751         /// In the case of the visual being a view or control deeming visual not required, then the visual should be an empty handle.<br />
752         /// If enabled is false, then the visual is not set on the stage until enabled by the derived class.<br />
753         /// </summary>
754         /// <param name="index">The property index of the visual used to reference visual.</param>
755         /// <param name="visual">The visual to register.</param>
756         /// <param name="enabled">False if derived class wants to control when the visual is set on the stage.</param>
757         /// <since_tizen> 6 </since_tizen>
758         [EditorBrowsable(EditorBrowsableState.Never)]
759         protected void RegisterVisual(int index, VisualBase visual, bool enabled)
760         {
761             customView.RegisterVisual(index, visual, enabled);
762         }
763
764         /// <summary>
765         /// Erases the entry matching the given index from the list of registered visuals.
766         /// </summary>
767         /// <param name="index">The property index of the visual used to reference visual.</param>
768         /// <since_tizen> 6 </since_tizen>
769         [EditorBrowsable(EditorBrowsableState.Never)]
770         protected void UnregisterVisual(int index)
771         {
772             customView.UnregisterVisual(index);
773         }
774
775         /// <summary>
776         /// Retrieves the visual associated with the given property index.<br />
777         /// For managing the object lifecycle, do not store the returned visual as a member which increments its reference count.<br />
778         /// </summary>
779         /// <param name="index">The property index of the visual used to reference visual.</param>
780         /// <returns>The registered visual if exists, otherwise an empty handle.</returns>
781         /// <since_tizen> 6 </since_tizen>
782         [EditorBrowsable(EditorBrowsableState.Never)]
783         protected VisualBase GetVisual(int index)
784         {
785             return customView.GetVisual(index);
786         }
787
788         /// <summary>
789         /// Sets the given visual to be displayed or not when parent staged.<br />
790         /// For managing the object lifecycle, do not store the returned visual as a member which increments its reference count.<br />
791         /// </summary>
792         /// <param name="index">The property index of the visual, used to reference visual.</param>
793         /// <param name="enable">Flag set to enabled or disabled.</param>
794         /// <since_tizen> 6 </since_tizen>
795         [EditorBrowsable(EditorBrowsableState.Never)]
796         protected void EnableVisual(int index, bool enable)
797         {
798             customView.EnableVisual(index, enable);
799         }
800
801         /// <summary>
802         /// Queries if the given visual is to be displayed when parent staged.<br />
803         /// For managing the object lifecycle, do not store the returned visual as a member which increments its reference count.<br />
804         /// </summary>
805         /// <param name="index">The property index of the visual.</param>
806         /// <returns>Whether visual is enabled or not.</returns>
807         /// <since_tizen> 6 </since_tizen>
808         [EditorBrowsable(EditorBrowsableState.Never)]
809         protected bool IsVisualEnabled(int index)
810         {
811             return customView.IsVisualEnabled(index);
812         }
813
814         /// <summary>
815         /// Creates a transition effect on the control.
816         /// </summary>
817         /// <param name="transitionData">The transition data describing the effect to create.</param>
818         /// <returns>A handle to an animation defined with the given effect, or an empty handle if no properties match.</returns>
819         /// <since_tizen> 6 </since_tizen>
820         [EditorBrowsable(EditorBrowsableState.Never)]
821         protected Animation CreateTransition(TransitionData transitionData)
822         {
823             return customView.CreateTransition(transitionData);
824         }
825
826         /// <summary>
827         /// Emits the KeyInputFocusGained signal if true, else, emits the KeyInputFocusLost signal.<br />
828         /// Should be called last by the control after it acts on the input focus change.<br />
829         /// </summary>
830         /// <param name="focusGained">True if gained, false if lost.</param>
831         /// <since_tizen> 6 </since_tizen>
832         [EditorBrowsable(EditorBrowsableState.Never)]
833         protected void EmitFocusSignal(bool focusGained)
834         {
835             customView.EmitFocusSignal(focusGained);
836         }
837     }
838 }