sync with devel/master branch
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / ApplicationExtensions.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 Tizen.NUI
12 {
13
14     internal class ApplicationExtensions : global::System.IDisposable
15     {
16         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
17         protected bool swigCMemOwn;
18
19         internal ApplicationExtensions(global::System.IntPtr cPtr, bool cMemoryOwn)
20         {
21             swigCMemOwn = cMemoryOwn;
22             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
23         }
24
25         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ApplicationExtensions obj)
26         {
27             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
28         }
29
30         //A Flag to check who called Dispose(). (By User or DisposeQueue)
31         private bool isDisposeQueued = false;
32         //A Flat to check if it is already disposed.
33         protected bool disposed = false;
34
35         ~ApplicationExtensions()
36         {
37             if (!isDisposeQueued)
38             {
39                 isDisposeQueued = true;
40                 DisposeQueue.Instance.Add(this);
41             }
42         }
43
44         public void Dispose()
45         {
46             //Throw excpetion if Dispose() is called in separate thread.
47             if (!Window.IsInstalled())
48             {
49                 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
50             }
51
52             if (isDisposeQueued)
53             {
54                 Dispose(DisposeTypes.Implicit);
55             }
56             else
57             {
58                 Dispose(DisposeTypes.Explicit);
59                 System.GC.SuppressFinalize(this);
60             }
61         }
62
63         protected virtual void Dispose(DisposeTypes type)
64         {
65             if (disposed)
66             {
67                 return;
68             }
69
70             if (type == DisposeTypes.Explicit)
71             {
72                 //Called by User
73                 //Release your own managed resources here.
74                 //You should release all of your own disposable objects here.
75
76             }
77
78             //Release your own unmanaged resources here.
79             //You should not access any managed member here except static instance.
80             //because the execution order of Finalizes is non-deterministic.
81
82             if (swigCPtr.Handle != global::System.IntPtr.Zero)
83             {
84                 if (swigCMemOwn)
85                 {
86                     swigCMemOwn = false;
87                     NDalicPINVOKE.delete_ApplicationExtensions(swigCPtr);
88                 }
89                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
90             }
91
92             disposed = true;
93         }
94
95
96         public ApplicationExtensions() : this(NDalicPINVOKE.new_ApplicationExtensions__SWIG_0(), true)
97         {
98             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
99         }
100
101         public ApplicationExtensions(Application application) : this(NDalicPINVOKE.new_ApplicationExtensions__SWIG_1(Application.getCPtr(application)), true)
102         {
103             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
104         }
105
106         public void Init()
107         {
108             NDalicPINVOKE.ApplicationExtensions_Init(swigCPtr);
109             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
110         }
111
112         public void Terminate()
113         {
114             NDalicPINVOKE.ApplicationExtensions_Terminate(swigCPtr);
115             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
116         }
117
118         public void Pause()
119         {
120             NDalicPINVOKE.ApplicationExtensions_Pause(swigCPtr);
121             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
122         }
123
124         public void Resume()
125         {
126             NDalicPINVOKE.ApplicationExtensions_Resume(swigCPtr);
127             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
128         }
129
130         public void LanguageChange()
131         {
132             NDalicPINVOKE.ApplicationExtensions_LanguageChange(swigCPtr);
133             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
134         }
135
136     }
137
138 }