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