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
14 // Copyright (c) 2017 Samsung Electronics Co., Ltd.
\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
20 // http://www.apache.org/licenses/LICENSE-2.0
\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
29 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
\r
30 // Some have been manually changed
\r
37 using System.Runtime.InteropServices;
\r
39 public class FocusManager : BaseHandle
\r
41 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
\r
43 internal FocusManager(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.FocusManager_SWIGUpcast(cPtr), cMemoryOwn)
\r
45 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
\r
48 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(FocusManager obj)
\r
50 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
\r
55 DisposeQueue.Instance.Add(this);
\r
58 public override void Dispose()
\r
60 if (!Stage.IsInstalled())
\r
62 DisposeQueue.Instance.Add(this);
\r
68 if (swigCPtr.Handle != global::System.IntPtr.Zero)
\r
72 swigCMemOwn = false;
\r
73 NDalicManualPINVOKE.delete_FocusManager(swigCPtr);
\r
75 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
\r
77 global::System.GC.SuppressFinalize(this);
\r
84 * @brief Event arguments that passed via PreFocusChange signal
\r
87 public class PreFocusChangeEventArgs : EventArgs
\r
89 private View _current;
\r
90 private View _proposed;
\r
91 private View.FocusDirection _direction;
\r
93 public View CurrentView
\r
105 public View ProposedView
\r
117 public View.FocusDirection Direction
\r
125 _direction = value;
\r
130 private EventHandlerWithReturnType<object, PreFocusChangeEventArgs, View> _preFocusChangeEventHandler;
\r
131 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
\r
132 internal delegate IntPtr PreFocusChangeEventCallback(IntPtr current, IntPtr proposed, View.FocusDirection direction);
\r
133 private PreFocusChangeEventCallback _preFocusChangeCallback;
\r
135 public event EventHandlerWithReturnType<object, PreFocusChangeEventArgs, View> PreFocusChange
\r
139 if (_preFocusChangeEventHandler == null)
\r
141 _preFocusChangeCallback = OnPreFocusChange;
\r
142 PreFocusChangeSignal().Connect(_preFocusChangeCallback);
\r
144 _preFocusChangeEventHandler += value;
\r
148 _preFocusChangeEventHandler -= value;
\r
149 if (_preFocusChangeEventHandler == null && _preFocusChangeCallback != null)
\r
151 PreFocusChangeSignal().Disconnect(_preFocusChangeCallback);
\r
156 private IntPtr OnPreFocusChange(IntPtr current, IntPtr proposed, View.FocusDirection direction)
\r
159 PreFocusChangeEventArgs e = new PreFocusChangeEventArgs();
\r
161 e.CurrentView = View.DownCast(Actor.GetActorFromPtr(current));
\r
162 e.ProposedView = View.DownCast(Actor.GetActorFromPtr(proposed));
\r
163 e.Direction = direction;
\r
165 if (_preFocusChangeEventHandler != null)
\r
167 view = _preFocusChangeEventHandler(this, e);
\r
169 return view.GetPtrfromView();
\r
174 * @brief Event arguments that passed via FocusChanged signal
\r
177 public class FocusChangedEventArgs : EventArgs
\r
179 private View _current;
\r
180 private View _next;
\r
182 public View CurrentView
\r
194 public View NextView
\r
207 private EventHandler<FocusChangedEventArgs> _focusChangedEventHandler;
\r
208 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
\r
209 internal delegate void FocusChangedEventCallback(IntPtr current, IntPtr next);
\r
210 private FocusChangedEventCallback _focusChangedEventCallback;
\r
212 public event EventHandler<FocusChangedEventArgs> FocusChanged
\r
216 if (_focusChangedEventCallback == null)
\r
218 _focusChangedEventCallback = OnFocusChanged;
\r
219 FocusChangedSignal().Connect(_focusChangedEventCallback);
\r
221 _focusChangedEventHandler += value;
\r
225 _focusChangedEventHandler -= value;
\r
227 if (_focusChangedEventCallback == null && _focusChangedEventCallback != null)
\r
229 FocusChangedSignal().Disconnect(_focusChangedEventCallback);
\r
234 private void OnFocusChanged(IntPtr current, IntPtr next)
\r
236 FocusChangedEventArgs e = new FocusChangedEventArgs();
\r
238 e.CurrentView = View.DownCast(Actor.GetActorFromPtr(current));
\r
239 e.NextView = View.DownCast(Actor.GetActorFromPtr(next));
\r
241 if (_focusChangedEventHandler != null)
\r
243 _focusChangedEventHandler(this, e);
\r
249 * @brief Event arguments that passed via FocusGroupChanged signal
\r
252 public class FocusGroupChangedEventArgs : EventArgs
\r
254 private View _current;
\r
255 private bool _forwardDirection;
\r
257 public View CurrentView
\r
269 public bool ForwardDirection
\r
273 return _forwardDirection;
\r
277 _forwardDirection = value;
\r
282 private EventHandler<FocusGroupChangedEventArgs> _focusGroupChangedEventHandler;
\r
283 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
\r
284 private delegate void FocusGroupChangedEventCallback(IntPtr current, bool forwardDirection);
\r
285 private FocusGroupChangedEventCallback _focusGroupChangedEventCallback;
\r
287 public event EventHandler<FocusGroupChangedEventArgs> FocusGroupChanged
\r
291 if (_focusGroupChangedEventCallback == null)
\r
293 _focusGroupChangedEventCallback = OnFocusGroupChanged;
\r
294 FocusGroupChangedSignal().Connect(_focusGroupChangedEventCallback);
\r
296 _focusGroupChangedEventHandler += value;
\r
300 _focusGroupChangedEventHandler -= value;
\r
302 if (_focusGroupChangedEventCallback == null && _focusGroupChangedEventCallback != null)
\r
304 FocusGroupChangedSignal().Disconnect(_focusGroupChangedEventCallback);
\r
309 private void OnFocusGroupChanged(IntPtr current, bool forwardDirection)
\r
311 FocusGroupChangedEventArgs e = new FocusGroupChangedEventArgs();
\r
313 e.CurrentView = View.DownCast(Actor.GetActorFromPtr(current));
\r
314 e.ForwardDirection = forwardDirection;
\r
316 if (_focusGroupChangedEventHandler != null)
\r
318 _focusGroupChangedEventHandler(this, e);
\r
324 * @brief Event arguments that passed via FocusedActorEnterKey signal
\r
327 public class FocusedViewEnterKeyEventArgs : EventArgs
\r
329 private View _view;
\r
344 private EventHandler<FocusedViewEnterKeyEventArgs> _focusedViewEnterKeyEventHandler;
\r
345 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
\r
346 private delegate void FocusedViewEnterKeyEventCallback(IntPtr view);
\r
347 private FocusedViewEnterKeyEventCallback _focusedViewEnterKeyEventCallback;
\r
349 public event EventHandler<FocusedViewEnterKeyEventArgs> FocusedViewEnterKeyPressed
\r
353 if (_focusedViewEnterKeyEventCallback == null)
\r
355 _focusedViewEnterKeyEventCallback = OnFocusedViewEnterKey;
\r
356 FocusedActorEnterKeySignal().Connect(_focusedViewEnterKeyEventCallback);
\r
358 _focusedViewEnterKeyEventHandler += value;
\r
362 _focusedViewEnterKeyEventHandler -= value;
\r
364 if (_focusedViewEnterKeyEventCallback == null && _focusedViewEnterKeyEventCallback != null)
\r
366 FocusedActorEnterKeySignal().Disconnect(_focusedViewEnterKeyEventCallback);
\r
371 private void OnFocusedViewEnterKey(IntPtr view)
\r
373 FocusedViewEnterKeyEventArgs e = new FocusedViewEnterKeyEventArgs();
\r
375 e.View = View.DownCast(Actor.GetActorFromPtr(view));
\r
377 if (_focusedViewEnterKeyEventHandler != null)
\r
379 _focusedViewEnterKeyEventHandler(this, e);
\r
384 internal FocusManager() : this(NDalicManualPINVOKE.new_FocusManager(), true)
\r
386 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
389 internal static FocusManager Get()
\r
391 FocusManager ret = new FocusManager(NDalicManualPINVOKE.FocusManager_Get(), true);
\r
392 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
396 public bool SetCurrentFocusView(View view)
\r
398 Actor actor = (Tizen.NUI.Actor)view;
\r
399 bool ret = NDalicManualPINVOKE.FocusManager_SetCurrentFocusActor(swigCPtr, Actor.getCPtr(actor));
\r
400 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
404 public View GetCurrentFocusView()
\r
406 Actor ret = new Actor(NDalicManualPINVOKE.FocusManager_GetCurrentFocusActor(swigCPtr), true);
\r
407 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
408 return View.DownCast(ret);
\r
411 public bool MoveFocus(View.FocusDirection direction)
\r
413 bool ret = NDalicManualPINVOKE.FocusManager_MoveFocus(swigCPtr, (int)direction);
\r
414 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
418 public void ClearFocus()
\r
420 NDalicManualPINVOKE.FocusManager_ClearFocus(swigCPtr);
\r
421 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
424 public bool FocusGroupLoop
\r
428 SetFocusGroupLoop(value);
\r
432 return GetFocusGroupLoop();
\r
436 internal void SetFocusGroupLoop(bool enabled)
\r
438 NDalicManualPINVOKE.FocusManager_SetFocusGroupLoop(swigCPtr, enabled);
\r
439 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
442 internal bool GetFocusGroupLoop()
\r
444 bool ret = NDalicManualPINVOKE.FocusManager_GetFocusGroupLoop(swigCPtr);
\r
445 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
449 public void SetAsFocusGroup(View view, bool isFocusGroup)
\r
451 Actor actor = (Tizen.NUI.Actor)view;
\r
452 NDalicManualPINVOKE.FocusManager_SetAsFocusGroup(swigCPtr, Actor.getCPtr(actor), isFocusGroup);
\r
453 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
456 public bool IsFocusGroup(View view)
\r
458 Actor actor = (Tizen.NUI.Actor)view;
\r
459 bool ret = NDalicManualPINVOKE.FocusManager_IsFocusGroup(swigCPtr, Actor.getCPtr(actor));
\r
460 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
464 public View GetFocusGroup(View view)
\r
466 Actor actor = (Tizen.NUI.Actor)view;
\r
467 Actor ret = new Actor(NDalicManualPINVOKE.FocusManager_GetFocusGroup(swigCPtr, Actor.getCPtr(actor)), true);
\r
468 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
469 return View.DownCast(ret);
\r
472 public View FocusIndicator
\r
476 SetFocusIndicatorView(value);
\r
480 return GetFocusIndicatorView();
\r
484 internal void SetFocusIndicatorView(View indicator)
\r
486 Actor actor = (Tizen.NUI.Actor)indicator;
\r
487 NDalicManualPINVOKE.FocusManager_SetFocusIndicatorActor(swigCPtr, Actor.getCPtr(actor));
\r
488 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
491 internal View GetFocusIndicatorView()
\r
493 Actor ret = new Actor(NDalicManualPINVOKE.FocusManager_GetFocusIndicatorActor(swigCPtr), true);
\r
494 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
495 return View.DownCast(ret);
\r
498 internal PreFocusChangeSignal PreFocusChangeSignal()
\r
500 PreFocusChangeSignal ret = new PreFocusChangeSignal(NDalicManualPINVOKE.FocusManager_PreFocusChangeSignal(swigCPtr), false);
\r
501 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
505 internal FocusChangedSignal FocusChangedSignal()
\r
507 FocusChangedSignal ret = new FocusChangedSignal(NDalicManualPINVOKE.FocusManager_FocusChangedSignal(swigCPtr), false);
\r
508 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
512 internal FocusGroupChangedSignal FocusGroupChangedSignal()
\r
514 FocusGroupChangedSignal ret = new FocusGroupChangedSignal(NDalicManualPINVOKE.FocusManager_FocusGroupChangedSignal(swigCPtr), false);
\r
515 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
519 internal ActorSignal FocusedActorEnterKeySignal()
\r
521 ActorSignal ret = new ActorSignal(NDalicManualPINVOKE.FocusManager_FocusedActorEnterKeySignal(swigCPtr), false);
\r
522 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
526 private static readonly FocusManager instance = FocusManager.Get();
\r
528 public static FocusManager Instance
\r