Support legacy way to create InputMethodContext
[platform/core/uifw/dali-csharp-binder.git] / dali-csharp-binder / src / input-method-options.cpp
1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 *
15 */
16
17 #include "common.h"
18 #include <dali/devel-api/adaptor-framework/input-method-options.h>
19
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25
26 SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_new_InputMethodOptions() {
27   void * jresult ;
28   Dali::InputMethodOptions *result = 0 ;
29
30   {
31     try {
32       result = (Dali::InputMethodOptions *)new Dali::InputMethodOptions();
33     } catch (std::out_of_range& e) {
34       {
35         SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return 0;
36       };
37     } catch (std::exception& e) {
38       {
39         SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return 0;
40       };
41     } catch (Dali::DaliException e) {
42       {
43         SWIG_CSharpException(SWIG_UnknownError, e.condition); return 0;
44       };
45     } catch (...) {
46       {
47         SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return 0;
48       };
49     }
50   }
51
52   jresult = (void *)result;
53   return jresult;
54 }
55
56
57 SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Dali_InputMethodOptions_IsPassword(void * jarg1) {
58   unsigned int jresult ;
59   Dali::InputMethodOptions *arg1 = (Dali::InputMethodOptions *) 0 ;
60   bool result;
61
62   arg1 = (Dali::InputMethodOptions *)jarg1;
63   {
64     try {
65       result = (bool)(arg1)->IsPassword();
66     } catch (std::out_of_range& e) {
67       {
68         SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return 0;
69       };
70     } catch (std::exception& e) {
71       {
72         SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return 0;
73       };
74     } catch (Dali::DaliException e) {
75       {
76         SWIG_CSharpException(SWIG_UnknownError, e.condition); return 0;
77       };
78     } catch (...) {
79       {
80         SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return 0;
81       };
82     }
83   }
84
85   jresult = result;
86   return jresult;
87 }
88
89
90 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_InputMethodOptions_ApplyProperty(void * jarg1, void * jarg2) {
91   Dali::InputMethodOptions *arg1 = (Dali::InputMethodOptions *) 0 ;
92   Dali::Property::Map *arg2 = 0 ;
93
94   arg1 = (Dali::InputMethodOptions *)jarg1;
95   arg2 = (Dali::Property::Map *)jarg2;
96   if (!arg2) {
97     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::Property::Map const & type is null", 0);
98     return ;
99   }
100   {
101     try {
102       (arg1)->ApplyProperty((Dali::Property::Map const &)*arg2);
103     } catch (std::out_of_range& e) {
104       {
105         SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return ;
106       };
107     } catch (std::exception& e) {
108       {
109         SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return ;
110       };
111     } catch (Dali::DaliException e) {
112       {
113         SWIG_CSharpException(SWIG_UnknownError, e.condition); return ;
114       };
115     } catch (...) {
116       {
117         SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return ;
118       };
119     }
120   }
121
122 }
123
124
125 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_InputMethodOptions_RetrieveProperty(void * jarg1, void * jarg2) {
126   Dali::InputMethodOptions *arg1 = (Dali::InputMethodOptions *) 0 ;
127   Dali::Property::Map *arg2 = 0 ;
128
129   arg1 = (Dali::InputMethodOptions *)jarg1;
130   arg2 = (Dali::Property::Map *)jarg2;
131   if (!arg2) {
132     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::Property::Map & type is null", 0);
133     return ;
134   }
135   {
136     try {
137       (arg1)->RetrieveProperty(*arg2);
138     } catch (std::out_of_range& e) {
139       {
140         SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return ;
141       };
142     } catch (std::exception& e) {
143       {
144         SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return ;
145       };
146     } catch (Dali::DaliException e) {
147       {
148         SWIG_CSharpException(SWIG_UnknownError, e.condition); return ;
149       };
150     } catch (...) {
151       {
152         SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return ;
153       };
154     }
155   }
156
157 }
158
159
160 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_delete_InputMethodOptions(void * jarg1) {
161   Dali::InputMethodOptions *arg1 = (Dali::InputMethodOptions *) 0 ;
162
163   arg1 = (Dali::InputMethodOptions *)jarg1;
164   {
165     try {
166       delete arg1;
167     } catch (std::out_of_range& e) {
168       {
169         SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return ;
170       };
171     } catch (std::exception& e) {
172       {
173         SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return ;
174       };
175     } catch (Dali::DaliException e) {
176       {
177         SWIG_CSharpException(SWIG_UnknownError, e.condition); return ;
178       };
179     } catch (...) {
180       {
181         SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return ;
182       };
183     }
184   }
185
186 }
187
188 #ifdef __cplusplus
189 }
190 #endif
191