63e4c48c65785ed0037a6ceda3d833cbe6633e54
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Common / FrameUpdateCallbackInterface.cs
1 /*
2  * Copyright(c) 2021 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
18 using System;
19 using System.ComponentModel;
20
21 namespace Tizen.NUI
22 {
23
24     /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
25     [EditorBrowsable(EditorBrowsableState.Never)]
26     public class FrameUpdateCallbackInterface : Disposable
27     {
28         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
29         [EditorBrowsable(EditorBrowsableState.Never)]
30         internal FrameUpdateCallbackInterface(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
31         {
32         }
33
34         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
35         [EditorBrowsable(EditorBrowsableState.Never)]
36         public FrameUpdateCallbackInterface() : this(Interop.FrameUpdateCallbackInterface.newFrameUpdateCallbackInterface(), true)
37         {
38             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
39             DirectorConnect();
40         }
41
42         private void DirectorConnect()
43         {
44             Delegate0 = new DelegateFrameUpdateCallbackInterface(DirectorOnUpdate);
45             Interop.FrameUpdateCallbackInterface.FrameUpdateCallbackInterfaceDirectorConnect(SwigCPtr, Delegate0);
46         }
47
48         private global::System.IntPtr proxyIntPtr;
49         private void DirectorOnUpdate(global::System.IntPtr proxy, float elapsedSeconds)
50         {
51             proxyIntPtr = proxy;
52             OnUpdate(elapsedSeconds);
53             return;
54         }
55
56         internal delegate void DelegateFrameUpdateCallbackInterface(global::System.IntPtr proxy, float elapsedSeconds);
57         private DelegateFrameUpdateCallbackInterface Delegate0;
58
59
60         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
61         [EditorBrowsable(EditorBrowsableState.Never)]
62         public virtual void OnUpdate(float elapsedSeconds)
63         {
64
65         }
66
67         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
68         [EditorBrowsable(EditorBrowsableState.Never)]
69         protected bool GetPosition(uint id, Vector3 position)
70         {
71             if (proxyIntPtr == IntPtr.Zero)
72             {
73                 return false;
74             }
75             bool ret = Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceGetPosition(proxyIntPtr, id, Vector3.getCPtr(position));
76             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
77             return ret;
78         }
79
80
81         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
82         [EditorBrowsable(EditorBrowsableState.Never)]
83         protected bool SetPosition(uint id, Vector3 position)
84         {
85             if (proxyIntPtr == IntPtr.Zero)
86             {
87                 return false;
88             }
89             bool ret = Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceSetPosition(proxyIntPtr, id, Vector3.getCPtr(position));
90             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
91             return ret;
92         }
93
94
95         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
96         [EditorBrowsable(EditorBrowsableState.Never)]
97         protected bool BakePosition(uint id, Vector3 position)
98         {
99             if (proxyIntPtr == IntPtr.Zero)
100             {
101                 return false;
102             }
103             bool ret = Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceBakePosition(proxyIntPtr, id, Vector3.getCPtr(position));
104             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
105             return ret;
106         }
107
108
109         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
110         [EditorBrowsable(EditorBrowsableState.Never)]
111         protected bool GetSize(uint id, Vector3 size)
112         {
113             if (proxyIntPtr == IntPtr.Zero)
114             {
115                 return false;
116             }
117             bool ret = Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceGetSize(proxyIntPtr, id, Vector3.getCPtr(size));
118             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
119             return ret;
120         }
121
122
123         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
124         [EditorBrowsable(EditorBrowsableState.Never)]
125         protected bool SetSize(uint id, Vector3 size)
126         {
127             if (proxyIntPtr == IntPtr.Zero)
128             {
129                 return false;
130             }
131             bool ret = Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceSetSize(proxyIntPtr, id, Vector3.getCPtr(size));
132             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
133             return ret;
134         }
135
136         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
137         [EditorBrowsable(EditorBrowsableState.Never)]
138         protected bool BakeSize(uint id, Vector3 size)
139         {
140             if (proxyIntPtr == IntPtr.Zero)
141             {
142                 return false;
143             }
144             bool ret = Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceBakeSize(proxyIntPtr, id, Vector3.getCPtr(size));
145             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
146             return ret;
147         }
148
149
150         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
151         [EditorBrowsable(EditorBrowsableState.Never)]
152         protected bool SetScale(uint id, Vector3 scale)
153         {
154             if (proxyIntPtr == IntPtr.Zero)
155             {
156                 return false;
157             }
158             bool ret = Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceSetScale(proxyIntPtr, id, Vector3.getCPtr(scale));
159             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
160             return ret;
161         }
162
163
164         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
165         [EditorBrowsable(EditorBrowsableState.Never)]
166         protected bool GetScale(uint id, Vector3 scale)
167         {
168             if (proxyIntPtr == IntPtr.Zero)
169             {
170                 return false;
171             }
172             bool ret = Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceSetScale(proxyIntPtr, id, Vector3.getCPtr(scale));
173             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
174             return ret;
175         }
176
177
178         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
179         [EditorBrowsable(EditorBrowsableState.Never)]
180         protected bool BakeScale(uint id, Vector3 scale)
181         {
182             if (proxyIntPtr == IntPtr.Zero)
183             {
184                 return false;
185             }
186             bool ret = Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceBakeScale(proxyIntPtr, id, Vector3.getCPtr(scale));
187             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
188             return ret;
189         }
190
191         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
192         [EditorBrowsable(EditorBrowsableState.Never)]
193         protected bool GetColor(uint id, Vector4 color)
194         {
195             if (proxyIntPtr == IntPtr.Zero)
196             {
197                 return false;
198             }
199             bool ret = Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceBakeScale(proxyIntPtr, id, Vector4.getCPtr(color));
200             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
201             return ret;
202         }
203
204         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
205         [EditorBrowsable(EditorBrowsableState.Never)]
206         protected bool SetColor(uint id, Vector4 color)
207         {
208             if (proxyIntPtr == IntPtr.Zero)
209             {
210                 return false;
211             }
212             bool ret = Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceBakeScale(proxyIntPtr, id, Vector4.getCPtr(color));
213             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
214             return ret;
215         }
216
217         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
218         [EditorBrowsable(EditorBrowsableState.Never)]
219         protected bool BakeColor(uint id, Vector4 color)
220         {
221             if (proxyIntPtr == IntPtr.Zero)
222             {
223                 return false;
224             }
225             bool ret = Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceBakeScale(proxyIntPtr, id, Vector4.getCPtr(color));
226             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
227             return ret;
228         }
229
230
231         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
232         [EditorBrowsable(EditorBrowsableState.Never)]
233         protected bool GetPositionAndSize(uint id, Vector3 Position, Vector3 Size)
234         {
235             if (proxyIntPtr == IntPtr.Zero)
236             {
237                 return false;
238             }
239             bool ret = Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceGetPositionAndSize(proxyIntPtr, id, Vector3.getCPtr(Position), Vector3.getCPtr(Size));
240             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
241             return ret;
242         }
243
244         internal void AddFrameUpdateCallback(global::System.Runtime.InteropServices.HandleRef windowCPtr, global::System.Runtime.InteropServices.HandleRef layerCPtr)
245         {
246             Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceAddFrameUpdateCallback(windowCPtr, SwigCPtr, layerCPtr);
247         }
248
249         internal void RemoveFrameUpdateCallback(global::System.Runtime.InteropServices.HandleRef windowCPtr)
250         {
251             Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceRemoveFrameUpdateCallback(windowCPtr, SwigCPtr);
252         }
253     }
254 }