Support legacy way to create InputMethodContext
[platform/core/uifw/dali-csharp-binder.git] / dali-csharp-binder / src / widget_view_manager.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 #ifndef CSHARP_WIDGET_VIEW_MANAGER
18 #define CSHARP_WIDGET_VIEW_MANAGER
19 #endif
20
21 #include "common.h"
22 #include <widget_viewer_dali/public_api/widget_view_manager/widget_view_manager.h>
23 #include <widget_viewer_dali/public_api/widget_view/widget_view.h>
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 SWIGEXPORT Dali::BaseHandle * SWIGSTDCALL CSharp_Dali_WidgetViewManager_SWIGUpcast(Dali::WidgetView::WidgetViewManager *jarg1) {
30     return (Dali::BaseHandle *)jarg1;
31 }
32
33
34 SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_WidgetViewManager_New(void * jarg1, char * jarg2) {
35   void * jresult ;
36   Dali::Application arg1 ;
37   std::string *arg2 = 0 ;
38   Dali::Application *argp1 ;
39   Dali::WidgetView::WidgetViewManager result;
40   
41   argp1 = (Dali::Application *)jarg1; 
42   if (!argp1) {
43     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Application", 0);
44     return 0;
45   }
46   arg1 = *argp1; 
47   if (!jarg2) {
48     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0);
49     return 0;
50   }
51   std::string arg2_str(jarg2);
52   arg2 = &arg2_str; 
53   {
54     try {
55       result = Dali::WidgetView::WidgetViewManager::New(arg1,(std::string const &)*arg2);
56     } catch (std::out_of_range& e) {
57       {
58         SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return 0; 
59       };
60     } catch (std::exception& e) {
61       {
62         SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return 0; 
63       };
64     } catch (Dali::DaliException e) {
65       {
66         SWIG_CSharpException(SWIG_UnknownError, e.condition); return 0;
67       };
68     } catch (...) {
69       {
70         SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return 0;
71       };
72     }
73   }
74
75   jresult = new Dali::WidgetView::WidgetViewManager((const Dali::WidgetView::WidgetViewManager &)result); 
76   
77   //argout typemap for const std::string&
78   
79   return jresult;
80 }
81
82
83 SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_WidgetViewManager_DownCast(void * jarg1) {
84   void * jresult ;
85   Dali::BaseHandle arg1 ;
86   Dali::BaseHandle *argp1 ;
87   Dali::WidgetView::WidgetViewManager result;
88   
89   argp1 = (Dali::BaseHandle *)jarg1; 
90   if (!argp1) {
91     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::BaseHandle", 0);
92     return 0;
93   }
94   arg1 = *argp1; 
95   {
96     try {
97       result = Dali::WidgetView::WidgetViewManager::DownCast(arg1);
98     } catch (std::out_of_range& e) {
99       {
100         SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return 0; 
101       };
102     } catch (std::exception& e) {
103       {
104         SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return 0; 
105       };
106     } catch (Dali::DaliException e) {
107       {
108         SWIG_CSharpException(SWIG_UnknownError, e.condition); return 0;
109       };
110     } catch (...) {
111       {
112         SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return 0;
113       };
114     }
115   }
116
117   jresult = new Dali::WidgetView::WidgetViewManager((const Dali::WidgetView::WidgetViewManager &)result); 
118   return jresult;
119 }
120
121
122 SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_new_WidgetViewManager__SWIG_0() {
123   void * jresult ;
124   Dali::WidgetView::WidgetViewManager *result = 0 ;
125   
126   {
127     try {
128       result = (Dali::WidgetView::WidgetViewManager *)new Dali::WidgetView::WidgetViewManager();
129     } catch (std::out_of_range& e) {
130       {
131         SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return 0; 
132       };
133     } catch (std::exception& e) {
134       {
135         SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return 0; 
136       };
137     } catch (Dali::DaliException e) {
138       {
139         SWIG_CSharpException(SWIG_UnknownError, e.condition); return 0;
140       };
141     } catch (...) {
142       {
143         SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return 0;
144       };
145     }
146   }
147
148   jresult = (void *)result; 
149   return jresult;
150 }
151
152
153 SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_new_WidgetViewManager__SWIG_1(void * jarg1) {
154   void * jresult ;
155   Dali::WidgetView::WidgetViewManager *arg1 = 0 ;
156   Dali::WidgetView::WidgetViewManager *result = 0 ;
157   
158   arg1 = (Dali::WidgetView::WidgetViewManager *)jarg1;
159   if (!arg1) {
160     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::WidgetView::WidgetViewManager const & type is null", 0);
161     return 0;
162   } 
163   {
164     try {
165       result = (Dali::WidgetView::WidgetViewManager *)new Dali::WidgetView::WidgetViewManager((Dali::WidgetView::WidgetViewManager const &)*arg1);
166     } catch (std::out_of_range& e) {
167       {
168         SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return 0; 
169       };
170     } catch (std::exception& e) {
171       {
172         SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return 0; 
173       };
174     } catch (Dali::DaliException e) {
175       {
176         SWIG_CSharpException(SWIG_UnknownError, e.condition); return 0;
177       };
178     } catch (...) {
179       {
180         SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return 0;
181       };
182     }
183   }
184
185   jresult = (void *)result; 
186   return jresult;
187 }
188
189
190 SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_WidgetViewManager_Assign(void * jarg1, void * jarg2) {
191   void * jresult ;
192   Dali::WidgetView::WidgetViewManager *arg1 = (Dali::WidgetView::WidgetViewManager *) 0 ;
193   Dali::WidgetView::WidgetViewManager *arg2 = 0 ;
194   Dali::WidgetView::WidgetViewManager *result = 0 ;
195   
196   arg1 = (Dali::WidgetView::WidgetViewManager *)jarg1; 
197   arg2 = (Dali::WidgetView::WidgetViewManager *)jarg2;
198   if (!arg2) {
199     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::WidgetView::WidgetViewManager const & type is null", 0);
200     return 0;
201   } 
202   {
203     try {
204       result = (Dali::WidgetView::WidgetViewManager *) &(arg1)->operator =((Dali::WidgetView::WidgetViewManager const &)*arg2);
205     } catch (std::out_of_range& e) {
206       {
207         SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return 0; 
208       };
209     } catch (std::exception& e) {
210       {
211         SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return 0; 
212       };
213     } catch (Dali::DaliException e) {
214       {
215         SWIG_CSharpException(SWIG_UnknownError, e.condition); return 0;
216       };
217     } catch (...) {
218       {
219         SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return 0;
220       };
221     }
222   }
223
224   jresult = (void *)result; 
225   return jresult;
226 }
227
228
229 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_delete_WidgetViewManager(void * jarg1) {
230   Dali::WidgetView::WidgetViewManager *arg1 = (Dali::WidgetView::WidgetViewManager *) 0 ;
231   
232   arg1 = (Dali::WidgetView::WidgetViewManager *)jarg1; 
233   {
234     try {
235       delete arg1;
236     } catch (std::out_of_range& e) {
237       {
238         SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return ; 
239       };
240     } catch (std::exception& e) {
241       {
242         SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return ; 
243       };
244     } catch (Dali::DaliException e) {
245       {
246         SWIG_CSharpException(SWIG_UnknownError, e.condition); return ;
247       };
248     } catch (...) {
249       {
250         SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return ;
251       };
252     }
253   }
254
255 }
256
257 SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_WidgetViewManager_AddWidget(void * jarg1, char * jarg2, char * jarg3, int jarg4, int jarg5, float jarg6) {
258   void * jresult ;
259   Dali::WidgetView::WidgetViewManager *arg1 = (Dali::WidgetView::WidgetViewManager *) 0 ;
260   std::string *arg2 = 0 ;
261   std::string *arg3 = 0 ;
262   int arg4 ;
263   int arg5 ;
264   float arg6 ;
265   Dali::WidgetView::WidgetView result;
266   
267   arg1 = (Dali::WidgetView::WidgetViewManager *)jarg1; 
268   if (!jarg2) {
269     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0);
270     return 0;
271   }
272   std::string arg2_str(jarg2);
273   arg2 = &arg2_str; 
274   if (!jarg3) {
275     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0);
276     return 0;
277   }
278   std::string arg3_str(jarg3);
279   arg3 = &arg3_str; 
280   arg4 = (int)jarg4; 
281   arg5 = (int)jarg5; 
282   arg6 = (float)jarg6; 
283   {
284     try {
285       result = (arg1)->AddWidget((std::string const &)*arg2,(std::string const &)*arg3,arg4,arg5,arg6);
286     } catch (std::out_of_range& e) {
287       {
288         SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return 0; 
289       };
290     } catch (std::exception& e) {
291       {
292         SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return 0; 
293       };
294     } catch (Dali::DaliException e) {
295       {
296         SWIG_CSharpException(SWIG_UnknownError, e.condition); return 0;
297       };
298     } catch (...) {
299       {
300         SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return 0;
301       };
302     }
303   }
304
305   jresult = new Dali::WidgetView::WidgetView((const Dali::WidgetView::WidgetView &)result); 
306   return jresult;
307 }
308
309 #ifdef __cplusplus
310 }
311 #endif
312