f4d6d1c62e22b7fe3c8153ef1c246ab2097d7941
[platform/core/uifw/dali-toolkit.git] / plugins / dali-swig / SWIG / events / actor-event.i
1 /*
2  * Copyright (c) 2016 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 bool StateFocusEnable
87     {
88       set
89       {
90         SetKeyboardFocusable(value);
91       }
92       get
93       {
94         return IsKeyboardFocusable();
95       }
96     }
97
98     public bool IsOnStage
99     {
100       get
101       {
102         return OnStage();
103       }
104     }
105
106     public int SiblingOrder
107     {
108       get
109       {
110         int temp = 0;
111         GetProperty( Actor.Property.SIBLING_ORDER ).Get( ref temp );
112         return temp;
113       }
114       set
115       {
116         SetProperty( Actor.Property.SIBLING_ORDER, new Dali.Property.Value( value ) );
117       }
118     }
119
120     public void Show()
121     {
122       SetVisible(true);
123     }
124
125     public void Hide()
126     {
127       SetVisible(false);
128     }
129 %}
130
131 %enddef
132
133 %define DALI_ACTOR_EVENTHANDLER_PARAM( NameSpace, ClassName)
134
135 ACTOR_EVENTHANDLER_TYPEMAP_EVENTARG( NameSpace, ClassName);
136 ACTOR_EVENTHANDLER_TYPEMAP_HELPER( NameSpace, ClassName);
137
138 %enddef
139
140 namespace Dali
141 {
142   DALI_ACTOR_EVENTHANDLER_PARAM( Dali, Actor);
143 }