/** Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
// This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
//------------------------------------------------------------------------------
//
//
// This file was automatically generated by SWIG (http://www.swig.org).
// Version 3.0.9
//
// Do not make changes to this file unless you know what you are doing--modify
// the SWIG interface file instead.
//------------------------------------------------------------------------------
namespace Dali {
using System;
using System.Runtime.InteropServices;
public class View : CustomActor {
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
internal View(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.View_SWIGUpcast(cPtr), cMemoryOwn) {
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(View obj) {
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
~View() {
Dispose();
}
public override void Dispose() {
lock(this) {
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
if (swigCMemOwn) {
swigCMemOwn = false;
NDalicPINVOKE.delete_View(swigCPtr);
}
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
global::System.GC.SuppressFinalize(this);
base.Dispose();
}
}
/**
* @brief Event arguments that passed via KeyInputFocusGained signal
*
*/
public class KeyInputFocusGainedEventArgs : EventArgs
{
private View _view;
/**
* @brief View - is the view that gets Key Input Focus
*
*/
public View View
{
get
{
return _view;
}
set
{
_view = value;
}
}
}
/**
* @brief Event arguments that passed via KeyInputFocusLost signal
*
*/
public class KeyInputFocusLostEventArgs : EventArgs
{
private View _view;
/**
* @brief View - is the view that loses Key Input Focus
*
*/
public View View
{
get
{
return _view;
}
set
{
_view = value;
}
}
}
/**
* @brief Event arguments that passed via KeyEvent signal
*
*/
public class KeyEventArgs : EventArgs
{
private View _view;
private KeyEvent _keyEvent;
/**
* @brief View - is the view that recieves the keyevent.
*
*/
public View View
{
get
{
return _view;
}
set
{
_view = value;
}
}
/**
* @brief KeyEvent - is the keyevent sent to the View.
*
*/
public KeyEvent KeyEvent
{
get
{
return _keyEvent;
}
set
{
_keyEvent = value;
}
}
}
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void KeyInputFocusGainedCallbackDelegate(IntPtr control);
private DaliEventHandler _KeyInputFocusGainedEventHandler;
private KeyInputFocusGainedCallbackDelegate _KeyInputFocusGainedCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void KeyInputFocusLostCallbackDelegate(IntPtr control);
private DaliEventHandler _KeyInputFocusLostEventHandler;
private KeyInputFocusLostCallbackDelegate _KeyInputFocusLostCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate bool KeyCallbackDelegate(IntPtr control, IntPtr keyEvent);
private DaliEventHandlerWithReturnType _KeyEventHandler;
private KeyCallbackDelegate _KeyCallbackDelegate;
/**
* @brief Event for KeyInputFocusGained signal which can be used to subscribe/unsubscribe the event handler
* (in the type of KeyInputFocusGainedEventHandler-DaliEventHandler)
* provided by the user. KeyInputFocusGained signal is emitted when the control gets Key Input Focus.
*/
public event DaliEventHandler KeyInputFocusGained
{
add
{
lock(this)
{
// Restricted to only one listener
if (_KeyInputFocusGainedEventHandler == null)
{
_KeyInputFocusGainedEventHandler += value;
_KeyInputFocusGainedCallbackDelegate = new KeyInputFocusGainedCallbackDelegate(OnKeyInputFocusGained);
this.KeyInputFocusGainedSignal().Connect(_KeyInputFocusGainedCallbackDelegate);
}
}
}
remove
{
lock(this)
{
if (_KeyInputFocusGainedEventHandler != null)
{
this.KeyInputFocusGainedSignal().Disconnect(_KeyInputFocusGainedCallbackDelegate);
}
_KeyInputFocusGainedEventHandler -= value;
}
}
}
private void OnKeyInputFocusGained(IntPtr view)
{
KeyInputFocusGainedEventArgs e = new KeyInputFocusGainedEventArgs();
// Populate all members of "e" (KeyInputFocusGainedEventArgs) with real data
e.View = Dali.View.GetViewFromPtr(view);
if (_KeyInputFocusGainedEventHandler != null)
{
//here we send all data to user event handlers
_KeyInputFocusGainedEventHandler(this, e);
}
}
/**
* @brief Event for KeyInputFocusLost signal which can be used to subscribe/unsubscribe the event handler
* (in the type of KeyInputFocusLostEventHandler-DaliEventHandler)
* provided by the user. KeyInputFocusLost signal is emitted when the control loses Key Input Focus.
*/
public event DaliEventHandler KeyInputFocusLost
{
add
{
lock(this)
{
// Restricted to only one listener
if (_KeyInputFocusLostEventHandler == null)
{
_KeyInputFocusLostEventHandler += value;
_KeyInputFocusLostCallbackDelegate = new KeyInputFocusLostCallbackDelegate(OnKeyInputFocusLost);
this.KeyInputFocusLostSignal().Connect(_KeyInputFocusLostCallbackDelegate);
}
}
}
remove
{
lock(this)
{
if (_KeyInputFocusLostEventHandler != null)
{
this.KeyInputFocusLostSignal().Disconnect(_KeyInputFocusLostCallbackDelegate);
}
_KeyInputFocusLostEventHandler -= value;
}
}
}
private void OnKeyInputFocusLost(IntPtr view)
{
KeyInputFocusLostEventArgs e = new KeyInputFocusLostEventArgs();
// Populate all members of "e" (KeyInputFocusLostEventArgs) with real data
e.View = Dali.View.GetViewFromPtr(view);
if (_KeyInputFocusLostEventHandler != null)
{
//here we send all data to user event handlers
_KeyInputFocusLostEventHandler(this, e);
}
}
/**
* @brief Event for KeyPressed signal which can be used to subscribe/unsubscribe the event handler
* (in the type of KeyEventEventHandler-DaliEventHandlerWithReturnType)
* provided by the user. KeyPressed signal is emitted when key event is received.
*/
public event DaliEventHandlerWithReturnType KeyPressed
{
add
{
lock(this)
{
// Restricted to only one listener
if (_KeyEventHandler == null)
{
_KeyEventHandler += value;
_KeyCallbackDelegate = new KeyCallbackDelegate(OnKeyEvent);
this.KeyEventSignal().Connect(_KeyCallbackDelegate);
}
}
}
remove
{
lock(this)
{
if (_KeyEventHandler != null)
{
this.KeyEventSignal().Disconnect(_KeyCallbackDelegate);
}
_KeyEventHandler -= value;
}
}
}
private bool OnKeyEvent(IntPtr view, IntPtr keyEvent)
{
KeyEventArgs e = new KeyEventArgs();
// Populate all members of "e" (KeyEventArgs) with real data
e.View = Dali.View.GetViewFromPtr(view);
e.KeyEvent = Dali.KeyEvent.GetKeyEventFromPtr(keyEvent);
if (_KeyEventHandler != null)
{
//here we send all data to user event handlers
return _KeyEventHandler(this, e, true);
}
return false;
}
public static View GetViewFromPtr(global::System.IntPtr cPtr) {
View ret = new View(cPtr, false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public class Property : global::System.IDisposable {
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
protected bool swigCMemOwn;
internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) {
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
~Property() {
Dispose();
}
public virtual void Dispose() {
lock(this) {
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
if (swigCMemOwn) {
swigCMemOwn = false;
NDalicPINVOKE.delete_View_Property(swigCPtr);
}
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
global::System.GC.SuppressFinalize(this);
}
}
public Property() : this(NDalicPINVOKE.new_View_Property(), true) {
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
public static readonly int STYLE_NAME = NDalicPINVOKE.View_Property_STYLE_NAME_get();
public static readonly int BACKGROUND_COLOR = NDalicPINVOKE.View_Property_BACKGROUND_COLOR_get();
public static readonly int BACKGROUND_IMAGE = NDalicPINVOKE.View_Property_BACKGROUND_IMAGE_get();
public static readonly int KEY_INPUT_FOCUS = NDalicPINVOKE.View_Property_KEY_INPUT_FOCUS_get();
public static readonly int BACKGROUND = NDalicPINVOKE.View_Property_BACKGROUND_get();
}
public class KeyboardFocus : global::System.IDisposable {
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
protected bool swigCMemOwn;
internal KeyboardFocus(global::System.IntPtr cPtr, bool cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(KeyboardFocus obj) {
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
~KeyboardFocus() {
Dispose();
}
public virtual void Dispose() {
lock(this) {
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
if (swigCMemOwn) {
swigCMemOwn = false;
NDalicPINVOKE.delete_View_KeyboardFocus(swigCPtr);
}
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
global::System.GC.SuppressFinalize(this);
}
}
public KeyboardFocus() : this(NDalicPINVOKE.new_View_KeyboardFocus(), true) {
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
public enum Direction {
LEFT,
RIGHT,
UP,
DOWN
}
}
public View () : this (NDalicPINVOKE.View_New(), true) {
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
public View(View uiControl) : this(NDalicPINVOKE.new_View__SWIG_1(View.getCPtr(uiControl)), true) {
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
public View Assign(View handle) {
View ret = new View(NDalicPINVOKE.View_Assign(swigCPtr, View.getCPtr(handle)), false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public new static View DownCast(BaseHandle handle) {
View ret = new View(NDalicPINVOKE.View_DownCast(BaseHandle.getCPtr(handle)), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public void SetKeyInputFocus() {
NDalicPINVOKE.View_SetKeyInputFocus(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
public bool HasKeyInputFocus() {
bool ret = NDalicPINVOKE.View_HasKeyInputFocus(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public void ClearKeyInputFocus() {
NDalicPINVOKE.View_ClearKeyInputFocus(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
public PinchGestureDetector GetPinchGestureDetector() {
PinchGestureDetector ret = new PinchGestureDetector(NDalicPINVOKE.View_GetPinchGestureDetector(swigCPtr), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public PanGestureDetector GetPanGestureDetector() {
PanGestureDetector ret = new PanGestureDetector(NDalicPINVOKE.View_GetPanGestureDetector(swigCPtr), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public TapGestureDetector GetTapGestureDetector() {
TapGestureDetector ret = new TapGestureDetector(NDalicPINVOKE.View_GetTapGestureDetector(swigCPtr), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public LongPressGestureDetector GetLongPressGestureDetector() {
LongPressGestureDetector ret = new LongPressGestureDetector(NDalicPINVOKE.View_GetLongPressGestureDetector(swigCPtr), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public void SetStyleName(string styleName) {
NDalicPINVOKE.View_SetStyleName(swigCPtr, styleName);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
public string GetStyleName() {
string ret = NDalicPINVOKE.View_GetStyleName(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public void SetBackgroundColor(Vector4 color) {
NDalicPINVOKE.View_SetBackgroundColor(swigCPtr, Vector4.getCPtr(color));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
public Vector4 GetBackgroundColor() {
Vector4 ret = new Vector4(NDalicPINVOKE.View_GetBackgroundColor(swigCPtr), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public void SetBackgroundImage(Image image) {
NDalicPINVOKE.View_SetBackgroundImage(swigCPtr, Image.getCPtr(image));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
public void ClearBackground() {
NDalicPINVOKE.View_ClearBackground(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
public ControlKeyEventSignal KeyEventSignal() {
ControlKeyEventSignal ret = new ControlKeyEventSignal(NDalicPINVOKE.View_KeyEventSignal(swigCPtr), false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public KeyInputFocusSignal KeyInputFocusGainedSignal() {
KeyInputFocusSignal ret = new KeyInputFocusSignal(NDalicPINVOKE.View_KeyInputFocusGainedSignal(swigCPtr), false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public KeyInputFocusSignal KeyInputFocusLostSignal() {
KeyInputFocusSignal ret = new KeyInputFocusSignal(NDalicPINVOKE.View_KeyInputFocusLostSignal(swigCPtr), false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public View(ViewImpl implementation) : this(NDalicPINVOKE.new_View__SWIG_2(ViewImpl.getCPtr(implementation)), true) {
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
public enum PropertyRange {
PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
CONTROL_PROPERTY_START_INDEX = PROPERTY_START_INDEX,
CONTROL_PROPERTY_END_INDEX = CONTROL_PROPERTY_START_INDEX+1000
}
}
}