[EXaml] Support Dictionary
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / Window / WindowIntPair.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     /// <summary>
24     /// Simple class for window position pairs of  integers.
25     /// Use this for integer position with window coordinates.
26     /// </summary>
27     internal class IntPair : Disposable
28     {
29         internal IntPair(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
30         {
31         }
32
33         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
34         {
35             Interop.IntPair.DeleteIntPair(swigCPtr);
36         }
37
38         /// <summary>
39         /// Default constructor for the(0, 0) tuple.
40         /// </summary>
41         public IntPair() : this(Interop.IntPair.NewIntPair(), true)
42         {
43             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
44         }
45
46         /// <summary>
47         /// Default constructor for the(0, 0) tuple.
48         /// </summary>
49         /// <param name="x">The X dimension of the tuple.</param>
50         /// <param name="y">The Y dimension of the tuple.</param>
51         public IntPair(int x, int y) : this(Interop.IntPair.NewIntPair(x, y), true)
52         {
53             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
54         }
55
56         /// <summary>
57         /// Sets the x dimension.
58         /// </summary>
59         /// <param name="x">The x dimension to be stored in this 2-tuple.</param>
60         public void SetX(int x)
61         {
62             Interop.IntPair.SetX(SwigCPtr, x);
63             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
64         }
65
66         /// <summary>
67         /// Get the x dimension.
68         /// </summary>
69         /// <return>
70         /// The x dimension stored in this 2-tuple.
71         /// </return>
72         public int GetX()
73         {
74             int ret = Interop.IntPair.GetX(SwigCPtr);
75             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
76             return ret;
77         }
78
79         /// <summary>
80         /// Sets the y dimension.
81         /// </summary>
82         /// <param name="y">The y dimension to be stored in this 2-tuple.</param>
83         public void SetY(int y)
84         {
85             Interop.IntPair.SetY(SwigCPtr, y);
86             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
87         }
88
89         /// <summary>
90         /// Get the y dimension.
91         /// </summary>
92         /// <return>
93         /// The y dimension stored in this 2-tuple.
94         /// </return>
95         public int GetY()
96         {
97             int ret = Interop.IntPair.GetY(SwigCPtr);
98             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
99             return ret;
100         }
101     }
102 }