Usage of CustomeView for ScrollContainer and code refactoring accordingly. Also added...
[platform/core/uifw/dali-toolkit.git] / plugins / dali-swig / automatic / csharp / PropertyNotification.cs
1 //------------------------------------------------------------------------------
2 // <auto-generated />
3 //
4 // This file was automatically generated by SWIG (http://www.swig.org).
5 // Version 3.0.9
6 //
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
10
11 namespace Dali {
12
13 using System;
14 using System.Runtime.InteropServices;
15
16
17 public class PropertyNotification : BaseHandle {
18   private global::System.Runtime.InteropServices.HandleRef swigCPtr;
19
20   internal PropertyNotification(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PropertyNotification_SWIGUpcast(cPtr), cMemoryOwn) {
21     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
22   }
23
24   internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyNotification obj) {
25     return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
26   }
27
28   ~PropertyNotification() {
29     Dispose();
30   }
31
32   public override void Dispose() {
33     lock(this) {
34       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
35         if (swigCMemOwn) {
36           swigCMemOwn = false;
37           NDalicPINVOKE.delete_PropertyNotification(swigCPtr);
38         }
39         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
40       }
41       global::System.GC.SuppressFinalize(this);
42       base.Dispose();
43     }
44   }
45
46
47 /**
48   * @brief Event arguments that passed via Notify signal
49   *
50   */
51 public class NotifyEventArgs : EventArgs
52 {
53    private PropertyNotification _propertyNotification;
54
55    /**
56      * @brief PropertyNotification - is the PropertyNotification handle that has the notification properties.
57      *
58      */
59    public PropertyNotification PropertyNotification
60    {
61       get
62       {
63          return _propertyNotification;
64       }
65       set
66       {
67          _propertyNotification = value;
68       }
69    }
70 }
71
72   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
73   private delegate void NotifyEventCallbackDelegate(IntPtr propertyNotification);
74   private DaliEventHandler<object,NotifyEventArgs> _propertyNotificationNotifyEventHandler;
75   private NotifyEventCallbackDelegate _propertyNotificationNotifyEventCallbackDelegate;
76
77   /**
78     * @brief Event for Notified signal which can be used to subscribe/unsubscribe the event handler
79     * (in the type of NotifyEventHandler-DaliEventHandler<object,NotifyEventArgs>) provided by the user.
80     * Notified signal is emitted when the notification upon a condition of the property being met, has occurred.
81     */
82   public event DaliEventHandler<object,NotifyEventArgs> Notified
83   {
84      add
85      {
86         lock(this)
87         {
88            // Restricted to only one listener
89            if (_propertyNotificationNotifyEventHandler == null)
90            {
91               _propertyNotificationNotifyEventHandler += value;
92
93               _propertyNotificationNotifyEventCallbackDelegate = new NotifyEventCallbackDelegate(OnPropertyNotificationNotify);
94               this.NotifySignal().Connect(_propertyNotificationNotifyEventCallbackDelegate);
95            }
96         }
97      }
98
99      remove
100      {
101         lock(this)
102         {
103            if (_propertyNotificationNotifyEventHandler != null)
104            {
105               this.NotifySignal().Disconnect(_propertyNotificationNotifyEventCallbackDelegate);
106            }
107
108            _propertyNotificationNotifyEventHandler -= value;
109         }
110      }
111   }
112
113   // Callback for PropertyNotification NotifySignal
114   private void OnPropertyNotificationNotify(IntPtr propertyNotification)
115   {
116      NotifyEventArgs e = new NotifyEventArgs();
117      e.PropertyNotification  = GetPropertyNotificationFromPtr(propertyNotification);
118
119      if (_propertyNotificationNotifyEventHandler != null)
120      {
121         //here we send all data to user event handlers
122         _propertyNotificationNotifyEventHandler(this, e);
123      }
124   }
125
126   public static PropertyNotification GetPropertyNotificationFromPtr(global::System.IntPtr cPtr) {
127     PropertyNotification ret = new PropertyNotification(cPtr, false);
128    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
129     return ret;
130   }
131
132
133   public PropertyNotification() : this(NDalicPINVOKE.new_PropertyNotification__SWIG_0(), true) {
134     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
135   }
136
137   public static PropertyNotification DownCast(BaseHandle handle) {
138     PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.PropertyNotification_DownCast(BaseHandle.getCPtr(handle)), true);
139     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
140     return ret;
141   }
142
143   public PropertyNotification(PropertyNotification handle) : this(NDalicPINVOKE.new_PropertyNotification__SWIG_1(PropertyNotification.getCPtr(handle)), true) {
144     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
145   }
146
147   public PropertyNotification Assign(PropertyNotification rhs) {
148     PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.PropertyNotification_Assign(swigCPtr, PropertyNotification.getCPtr(rhs)), false);
149     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
150     return ret;
151   }
152
153   public PropertyCondition GetCondition() {
154     PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.PropertyNotification_GetCondition__SWIG_0(swigCPtr), true);
155     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
156     return ret;
157   }
158
159   public Handle GetTarget() {
160     Handle ret = new Handle(NDalicPINVOKE.PropertyNotification_GetTarget(swigCPtr), true);
161     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
162     return ret;
163   }
164
165   public int GetTargetProperty() {
166     int ret = NDalicPINVOKE.PropertyNotification_GetTargetProperty(swigCPtr);
167     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168     return ret;
169   }
170
171   public void SetNotifyMode(PropertyNotification.NotifyMode mode) {
172     NDalicPINVOKE.PropertyNotification_SetNotifyMode(swigCPtr, (int)mode);
173     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
174   }
175
176   public PropertyNotification.NotifyMode GetNotifyMode() {
177     PropertyNotification.NotifyMode ret = (PropertyNotification.NotifyMode)NDalicPINVOKE.PropertyNotification_GetNotifyMode(swigCPtr);
178     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
179     return ret;
180   }
181
182   public bool GetNotifyResult() {
183     bool ret = NDalicPINVOKE.PropertyNotification_GetNotifyResult(swigCPtr);
184     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
185     return ret;
186   }
187
188   public PropertyNotifySignal NotifySignal() {
189     PropertyNotifySignal ret = new PropertyNotifySignal(NDalicPINVOKE.PropertyNotification_NotifySignal(swigCPtr), false);
190     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
191     return ret;
192   }
193
194   public enum NotifyMode {
195     Disabled,
196     NotifyOnTrue,
197     NotifyOnFalse,
198     NotifyOnChanged
199   }
200
201 }
202
203 }