Add C# bindings for Actor's POSITION_USES_ANCHOR_POINT property
[platform/core/uifw/dali-toolkit.git] / plugins / dali-swig / SWIG / events / actor-event.i
1 /*
2  * Copyright (c) 2017 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 %define ACTOR_EVENTHANDLER_TYPEMAP_EVENTARG(NameSpace, ClassName)
19 %typemap(csimports) NameSpace::ClassName %{
20     using System;
21     using System.Runtime.InteropServices;
22 %}
23
24 %enddef
25
26 %define ACTOR_EVENTHANDLER_TYPEMAP_HELPER(NameSpace, ClassName)
27   %typemap(cscode) NameSpace::ClassName %{
28
29     public static ClassName Get ## ClassName ## FromPtr(global::System.IntPtr cPtr) {
30       ClassName ret = new ClassName(cPtr, false);
31       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
32       return ret;
33     }
34
35     public IntPtr GetPtrfrom ## ClassName ()
36     {
37        return (IntPtr)swigCPtr;
38     }
39
40     public Position CurrentPosition
41     {
42       get
43       {
44         return GetCurrentPosition();
45       }
46     }
47
48     public Size3D CurrentSize
49     {
50       get
51       {
52         return GetCurrentSize();
53       }
54     }
55
56     public Actor Parent
57     {
58       get
59       {
60         return GetParent();
61       }
62     }
63
64    public bool Visibility
65    {
66       get
67       {
68         return IsVisible();
69       }
70    }
71
72     public float Opacity
73     {
74       get
75       {
76         float temp = 0;
77         GetProperty( Actor.Property.OPACITY ).Get( ref temp );
78         return temp;
79       }
80       set
81       {
82         SetProperty( Actor.Property.OPACITY, new Dali.Property.Value( value ) );
83       }
84     }
85
86     public Vector2 ScreenPosition
87     {
88       get
89       {
90         Vector2 temp = new Vector2( 0.0f, 0.0f );
91         GetProperty( Actor.Property.SCREEN_POSITION ).Get( temp );
92         return temp;
93       }
94     }
95
96     protected bool PositionUsesAnchorPoint
97     {
98       get
99       {
100         bool temp = false;
101         GetProperty( Actor.Property.POSITION_USES_ANCHOR_POINT ).Get( ref temp );
102         return temp;
103       }
104       set
105       {
106         SetProperty( Actor.Property.POSITION_USES_ANCHOR_POINT, new Dali.Property.Value( value ) );
107       }
108     }
109
110     public bool StateFocusEnable
111     {
112       get
113       {
114         return IsKeyboardFocusable();
115       }
116       set
117       {
118         SetKeyboardFocusable(value);
119       }
120     }
121
122     public bool IsOnStage
123     {
124       get
125       {
126         return OnStage();
127       }
128     }
129
130     public int SiblingOrder
131     {
132       get
133       {
134         int temp = 0;
135         GetProperty( Actor.Property.SIBLING_ORDER ).Get( ref temp );
136         return temp;
137       }
138       set
139       {
140         SetProperty( Actor.Property.SIBLING_ORDER, new Dali.Property.Value( value ) );
141       }
142     }
143
144     public void Show()
145     {
146       SetVisible(true);
147     }
148
149     public void Hide()
150     {
151       SetVisible(false);
152     }
153
154     public void Raise()
155     {
156       NDalicPINVOKE.Raise(swigCPtr);
157       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
158     }
159
160     public void Lower()
161     {
162       NDalicPINVOKE.Lower(swigCPtr);
163       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
164     }
165
166     public void RaiseToTop()
167     {
168       NDalicPINVOKE.RaiseToTop(swigCPtr);
169       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
170     }
171
172     public void LowerToBottom()
173     {
174       NDalicPINVOKE.LowerToBottom(swigCPtr);
175       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
176     }
177
178     public void RaiseAbove(Actor target)
179     {
180       NDalicPINVOKE.RaiseAbove(swigCPtr, Actor.getCPtr(target));
181       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
182     }
183
184     public void LowerBelow(Actor target)
185     {
186       NDalicPINVOKE.RaiseAbove(swigCPtr, Actor.getCPtr(target));
187       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
188     }
189
190 %}
191
192 %enddef
193
194 %define DALI_ACTOR_EVENTHANDLER_PARAM( NameSpace, ClassName)
195
196 ACTOR_EVENTHANDLER_TYPEMAP_EVENTARG( NameSpace, ClassName);
197 ACTOR_EVENTHANDLER_TYPEMAP_HELPER( NameSpace, ClassName);
198
199 %enddef
200
201 namespace Dali
202 {
203   DALI_ACTOR_EVENTHANDLER_PARAM( Dali, Actor);
204 }