2 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 %define POPUP_EVENTHANDLER_TYPEMAP_EVENTARG(NameSpace, ClassName)
19 %typemap(csimports) NameSpace::ClassName %{
21 using System.Runtime.InteropServices;
28 %define POPUP_EVENTHANDLER_TYPEMAP_HELPER(NameSpace, ClassName)
29 %typemap(cscode) NameSpace::ClassName %{
31 public class OutsideTouchedEventArgs : EventArgs
35 public class ShowingEventArgs : EventArgs
39 public class ShownEventArgs : EventArgs
43 public class HidingEventArgs : EventArgs
47 public class HiddenEventArgs : EventArgs
51 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
52 private delegate void OutsideTouchedEventCallbackDelegate();
53 private DaliEventHandler<object,OutsideTouchedEventArgs> _popUpOutsideTouchedEventHandler;
54 private OutsideTouchedEventCallbackDelegate _popUpOutsideTouchedEventCallbackDelegate;
56 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
57 private delegate void ShowingEventCallbackDelegate();
58 private DaliEventHandler<object,ShowingEventArgs> _popUpShowingEventHandler;
59 private ShowingEventCallbackDelegate _popUpShowingEventCallbackDelegate;
61 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
62 private delegate void ShownEventCallbackDelegate();
63 private DaliEventHandler<object,ShownEventArgs> _popUpShownEventHandler;
64 private ShownEventCallbackDelegate _popUpShownEventCallbackDelegate;
66 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
67 private delegate void HidingEventCallbackDelegate();
68 private DaliEventHandler<object,HidingEventArgs> _popUpHidingEventHandler;
69 private HidingEventCallbackDelegate _popUpHidingEventCallbackDelegate;
71 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
72 private delegate void HiddenEventCallbackDelegate();
73 private DaliEventHandler<object,HiddenEventArgs> _popUpHiddenEventHandler;
74 private HiddenEventCallbackDelegate _popUpHiddenEventCallbackDelegate;
76 public event DaliEventHandler<object,OutsideTouchedEventArgs> OutsideTouched
82 // Restricted to only one listener
83 if (_popUpOutsideTouchedEventHandler == null)
85 _popUpOutsideTouchedEventHandler += value;
87 _popUpOutsideTouchedEventCallbackDelegate = new OutsideTouchedEventCallbackDelegate(OnOutsideTouched);
88 this.OutsideTouchedSignal().Connect(_popUpOutsideTouchedEventCallbackDelegate);
97 if (_popUpOutsideTouchedEventHandler != null)
99 this.OutsideTouchedSignal().Disconnect(_popUpOutsideTouchedEventCallbackDelegate);
102 _popUpOutsideTouchedEventHandler -= value;
107 // Callback for Popup OutsideTouchedSignal
108 private void OnOutsideTouched()
110 OutsideTouchedEventArgs e = new OutsideTouchedEventArgs();
112 if (_popUpOutsideTouchedEventHandler != null)
114 //here we send all data to user event handlers
115 _popUpOutsideTouchedEventHandler(this, e);
119 public event DaliEventHandler<object,ShowingEventArgs> Showing
125 // Restricted to only one listener
126 if (_popUpShowingEventHandler == null)
128 _popUpShowingEventHandler += value;
130 _popUpShowingEventCallbackDelegate = new ShowingEventCallbackDelegate(OnShowing);
131 this.ShowingSignal().Connect(_popUpShowingEventCallbackDelegate);
140 if (_popUpShowingEventHandler != null)
142 this.ShowingSignal().Disconnect(_popUpShowingEventCallbackDelegate);
145 _popUpShowingEventHandler -= value;
150 // Callback for ShowingSignal
151 private void OnShowing()
153 ShowingEventArgs e = new ShowingEventArgs();
155 if (_popUpShowingEventHandler != null)
157 //here we send all data to user event handlers
158 _popUpShowingEventHandler(this, e);
163 public event DaliEventHandler<object,ShownEventArgs> Shown
169 // Restricted to only one listener
170 if (_popUpShownEventHandler == null)
172 _popUpShownEventHandler += value;
174 _popUpShownEventCallbackDelegate = new ShownEventCallbackDelegate(OnShown);
175 this.ShownSignal().Connect(_popUpShownEventCallbackDelegate);
184 if (_popUpShownEventHandler != null)
186 this.ShownSignal().Disconnect(_popUpShownEventCallbackDelegate);
189 _popUpShownEventHandler -= value;
194 // Callback for ShownSignal
195 private void OnShown()
197 ShownEventArgs e = new ShownEventArgs();
199 if (_popUpShownEventHandler != null)
201 //here we send all data to user event handlers
202 _popUpShownEventHandler(this, e);
206 public event DaliEventHandler<object,HidingEventArgs> Hiding
212 // Restricted to only one listener
213 if (_popUpHidingEventHandler == null)
215 _popUpHidingEventHandler += value;
217 _popUpHidingEventCallbackDelegate = new HidingEventCallbackDelegate(OnHiding);
218 this.HidingSignal().Connect(_popUpHidingEventCallbackDelegate);
227 if (_popUpHidingEventHandler != null)
229 this.HidingSignal().Disconnect(_popUpHidingEventCallbackDelegate);
232 _popUpHidingEventHandler -= value;
237 // Callback for HidingSignal
238 private void OnHiding()
240 HidingEventArgs e = new HidingEventArgs();
242 if (_popUpHidingEventHandler != null)
244 //here we send all data to user event handlers
245 _popUpHidingEventHandler(this, e);
249 public event DaliEventHandler<object,HiddenEventArgs> Hidden
255 // Restricted to only one listener
256 if (_popUpHiddenEventHandler == null)
258 _popUpHiddenEventHandler += value;
260 _popUpHiddenEventCallbackDelegate = new HiddenEventCallbackDelegate(OnHidden);
261 this.HiddenSignal().Connect(_popUpHiddenEventCallbackDelegate);
270 if (_popUpHiddenEventHandler != null)
272 this.HiddenSignal().Disconnect(_popUpHiddenEventCallbackDelegate);
275 _popUpHiddenEventHandler -= value;
280 // Callback for HiddenSignal
281 private void OnHidden()
283 HiddenEventArgs e = new HiddenEventArgs();
285 if (_popUpHiddenEventHandler != null)
287 //here we send all data to user event handlers
288 _popUpHiddenEventHandler(this, e);
292 /* Properties earlier added by Ruby Script */
294 public Dali.Property.Map Title
298 Dali.Property.Map temp = new Dali.Property.Map();
299 GetProperty( Popup.Property.TITLE).Get( temp );
304 SetProperty( Popup.Property.TITLE, new Dali.Property.Value( value ) );
307 public Dali.Property.Map Content
311 Dali.Property.Map temp = new Dali.Property.Map();
312 GetProperty( Popup.Property.CONTENT).Get( temp );
317 SetProperty( Popup.Property.CONTENT, new Dali.Property.Value( value ) );
320 public Dali.Property.Map Footer
324 Dali.Property.Map temp = new Dali.Property.Map();
325 GetProperty( Popup.Property.FOOTER).Get( temp );
330 SetProperty( Popup.Property.FOOTER, new Dali.Property.Value( value ) );
333 public string DisplayState
338 GetProperty( Popup.Property.DISPLAY_STATE).Get( out temp );
343 SetProperty( Popup.Property.DISPLAY_STATE, new Dali.Property.Value( value ) );
346 public bool TouchTransparent
351 GetProperty( Popup.Property.TOUCH_TRANSPARENT).Get( ref temp );
356 SetProperty( Popup.Property.TOUCH_TRANSPARENT, new Dali.Property.Value( value ) );
359 public bool TailVisibility
364 GetProperty( Popup.Property.TAIL_VISIBILITY).Get( ref temp );
369 SetProperty( Popup.Property.TAIL_VISIBILITY, new Dali.Property.Value( value ) );
372 public Dali.CSharp.Position TailPosition
376 Vector3 temp = new Vector3(0.0f,0.0f,0.0f);
377 GetProperty( Popup.Property.TAIL_POSITION).Get( temp );
378 Dali.CSharp.Position ret = new Dali.CSharp.Position(temp.x, temp.y, temp.z);
383 SetProperty( Popup.Property.TAIL_POSITION, new Dali.Property.Value( value ) );
386 public string ContextualMode
391 GetProperty( Popup.Property.CONTEXTUAL_MODE).Get( out temp );
396 SetProperty( Popup.Property.CONTEXTUAL_MODE, new Dali.Property.Value( value ) );
399 public float AnimationDuration
404 GetProperty( Popup.Property.ANIMATION_DURATION).Get( ref temp );
409 SetProperty( Popup.Property.ANIMATION_DURATION, new Dali.Property.Value( value ) );
412 public string AnimationMode
417 GetProperty( Popup.Property.ANIMATION_MODE).Get( out temp );
422 SetProperty( Popup.Property.ANIMATION_MODE, new Dali.Property.Value( value ) );
425 public Dali.Property.Map EntryAnimation
429 Dali.Property.Map temp = new Dali.Property.Map();
430 GetProperty( Popup.Property.ENTRY_ANIMATION).Get( temp );
435 SetProperty( Popup.Property.ENTRY_ANIMATION, new Dali.Property.Value( value ) );
438 public Dali.Property.Map ExitAnimation
442 Dali.Property.Map temp = new Dali.Property.Map();
443 GetProperty( Popup.Property.EXIT_ANIMATION).Get( temp );
448 SetProperty( Popup.Property.EXIT_ANIMATION, new Dali.Property.Value( value ) );
451 public int AutoHideDelay
456 GetProperty( Popup.Property.AUTO_HIDE_DELAY).Get( ref temp );
461 SetProperty( Popup.Property.AUTO_HIDE_DELAY, new Dali.Property.Value( value ) );
464 public bool BackingEnabled
469 GetProperty( Popup.Property.BACKING_ENABLED).Get( ref temp );
474 SetProperty( Popup.Property.BACKING_ENABLED, new Dali.Property.Value( value ) );
477 public Dali.CSharp.Color BackingColor
481 Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);
482 GetProperty( Popup.Property.BACKING_COLOR).Get( temp );
483 Dali.CSharp.Color ret = new Dali.CSharp.Color(temp.r, temp.g, temp.b, temp.a);
488 SetProperty( Popup.Property.BACKING_COLOR, new Dali.Property.Value( value ) );
491 public string PopupBackgroundImage
496 GetProperty( Popup.Property.POPUP_BACKGROUND_IMAGE).Get( out temp );
501 SetProperty( Popup.Property.POPUP_BACKGROUND_IMAGE, new Dali.Property.Value( value ) );
504 public string TailUpImage
509 GetProperty( Popup.Property.TAIL_UP_IMAGE).Get( out temp );
514 SetProperty( Popup.Property.TAIL_UP_IMAGE, new Dali.Property.Value( value ) );
517 public string TailDownImage
522 GetProperty( Popup.Property.TAIL_DOWN_IMAGE).Get( out temp );
527 SetProperty( Popup.Property.TAIL_DOWN_IMAGE, new Dali.Property.Value( value ) );
530 public string TailLeftImage
535 GetProperty( Popup.Property.TAIL_LEFT_IMAGE).Get( out temp );
540 SetProperty( Popup.Property.TAIL_LEFT_IMAGE, new Dali.Property.Value( value ) );
543 public string TailRightImage
548 GetProperty( Popup.Property.TAIL_RIGHT_IMAGE).Get( out temp );
553 SetProperty( Popup.Property.TAIL_RIGHT_IMAGE, new Dali.Property.Value( value ) );
557 /* Properties ends */
562 %define DALI_POPUP_EVENTHANDLER_PARAM( NameSpace, ClassName)
563 POPUP_EVENTHANDLER_TYPEMAP_EVENTARG( NameSpace, ClassName);
564 POPUP_EVENTHANDLER_TYPEMAP_HELPER( NameSpace, ClassName);
569 DALI_POPUP_EVENTHANDLER_PARAM( Dali::Toolkit, Popup);