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 TEXTEDITOR_EVENTHANDLER_TYPEMAP_EVENTARG(NameSpace, ClassName)
19 %typemap(csimports) NameSpace::ClassName %{
21 using System.Runtime.InteropServices;
27 %define TEXTEDITOR_EVENTHANDLER_TYPEMAP_HELPER(NameSpace, ClassName)
28 %typemap(cscode) NameSpace::ClassName %{
31 * @brief Event arguments that passed via TextChanged signal
34 public class TextChangedEventArgs : EventArgs
36 private TextEditor _textEditor;
38 * @brief TextEditor - is the texteditor control which has the text contents changed.
41 public TextEditor TextEditor
54 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
55 private delegate void TextChangedCallbackDelegate(IntPtr textEditor);
56 private DaliEventHandler<object,TextChangedEventArgs> _textEditorTextChangedEventHandler;
57 private TextChangedCallbackDelegate _textEditorTextChangedCallbackDelegate;
60 * @brief Event for TextChanged signal which can be used to subscribe/unsubscribe the event handler
61 * (in the type of TextChangedEventHandler-DaliEventHandler<object,TextChangedEventArgs>)
62 * provided by the user. TextChanged signal is emitted when the text changes.
64 public event DaliEventHandler<object,TextChangedEventArgs> TextChanged
70 // Restricted to only one listener
71 if (_textEditorTextChangedEventHandler == null)
73 _textEditorTextChangedEventHandler += value;
75 _textEditorTextChangedCallbackDelegate = new TextChangedCallbackDelegate(OnTextChanged);
76 this.TextChangedSignal().Connect(_textEditorTextChangedCallbackDelegate);
85 if (_textEditorTextChangedEventHandler != null)
87 this.TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate);
90 _textEditorTextChangedEventHandler -= value;
95 private void OnTextChanged(IntPtr textEditor)
97 TextChangedEventArgs e = new TextChangedEventArgs();
99 // Populate all members of "e" (TextChangedEventArgs) with real data
100 e.TextEditor = Dali.TextEditor.GetTextEditorFromPtr(textEditor);
102 if (_textEditorTextChangedEventHandler != null)
104 //here we send all data to user event handlers
105 _textEditorTextChangedEventHandler(this, e);
110 public static ClassName Get ## ClassName ## FromPtr(global::System.IntPtr cPtr) {
111 ClassName ret = new ClassName(cPtr, false);
112 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
116 /* Properties earlier added by Ruby Script */
118 public int RenderingBackend
123 GetProperty( TextEditor.Property.RENDERING_BACKEND).Get( ref temp );
128 SetProperty( TextEditor.Property.RENDERING_BACKEND, new Dali.Property.Value( value ) );
136 GetProperty( TextEditor.Property.TEXT).Get( out temp );
141 SetProperty( TextEditor.Property.TEXT, new Dali.Property.Value( value ) );
144 public Dali.CSharp.Color TextColor
148 Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);
149 GetProperty( TextEditor.Property.TEXT_COLOR).Get( temp );
150 Dali.CSharp.Color ret = new Dali.CSharp.Color(temp.r, temp.g, temp.b, temp.a);
155 SetProperty( TextEditor.Property.TEXT_COLOR, new Dali.Property.Value( value ) );
158 public string FontFamily
163 GetProperty( TextEditor.Property.FONT_FAMILY).Get( out temp );
168 SetProperty( TextEditor.Property.FONT_FAMILY, new Dali.Property.Value( value ) );
171 public Dali.Property.Map FontStyle
175 Dali.Property.Map temp = new Dali.Property.Map();
176 GetProperty( TextEditor.Property.FONT_STYLE).Get( temp );
181 SetProperty( TextEditor.Property.FONT_STYLE, new Dali.Property.Value( value ) );
184 public float PointSize
189 GetProperty( TextEditor.Property.POINT_SIZE).Get( ref temp );
194 SetProperty( TextEditor.Property.POINT_SIZE, new Dali.Property.Value( value ) );
197 public string HorizontalAlignment
202 GetProperty( TextEditor.Property.HORIZONTAL_ALIGNMENT).Get( out temp );
207 SetProperty( TextEditor.Property.HORIZONTAL_ALIGNMENT, new Dali.Property.Value( value ) );
210 public float ScrollThreshold
215 GetProperty( TextEditor.Property.SCROLL_THRESHOLD).Get( ref temp );
220 SetProperty( TextEditor.Property.SCROLL_THRESHOLD, new Dali.Property.Value( value ) );
223 public float ScrollSpeed
228 GetProperty( TextEditor.Property.SCROLL_SPEED).Get( ref temp );
233 SetProperty( TextEditor.Property.SCROLL_SPEED, new Dali.Property.Value( value ) );
236 public Dali.CSharp.Color PrimaryCursorColor
240 Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);
241 GetProperty( TextEditor.Property.PRIMARY_CURSOR_COLOR).Get( temp );
242 Dali.CSharp.Color ret = new Dali.CSharp.Color(temp.r, temp.g, temp.b, temp.a);
247 SetProperty( TextEditor.Property.PRIMARY_CURSOR_COLOR, new Dali.Property.Value( value ) );
250 public Dali.CSharp.Color SecondaryCursorColor
254 Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);
255 GetProperty( TextEditor.Property.SECONDARY_CURSOR_COLOR).Get( temp );
256 Dali.CSharp.Color ret = new Dali.CSharp.Color(temp.r, temp.g, temp.b, temp.a);
261 SetProperty( TextEditor.Property.SECONDARY_CURSOR_COLOR, new Dali.Property.Value( value ) );
264 public bool EnableCursorBlink
269 GetProperty( TextEditor.Property.ENABLE_CURSOR_BLINK).Get( ref temp );
274 SetProperty( TextEditor.Property.ENABLE_CURSOR_BLINK, new Dali.Property.Value( value ) );
277 public float CursorBlinkInterval
282 GetProperty( TextEditor.Property.CURSOR_BLINK_INTERVAL).Get( ref temp );
287 SetProperty( TextEditor.Property.CURSOR_BLINK_INTERVAL, new Dali.Property.Value( value ) );
290 public float CursorBlinkDuration
295 GetProperty( TextEditor.Property.CURSOR_BLINK_DURATION).Get( ref temp );
300 SetProperty( TextEditor.Property.CURSOR_BLINK_DURATION, new Dali.Property.Value( value ) );
303 public int CursorWidth
308 GetProperty( TextEditor.Property.CURSOR_WIDTH).Get( ref temp );
313 SetProperty( TextEditor.Property.CURSOR_WIDTH, new Dali.Property.Value( value ) );
316 public string GrabHandleImage
321 GetProperty( TextEditor.Property.GRAB_HANDLE_IMAGE).Get( out temp );
326 SetProperty( TextEditor.Property.GRAB_HANDLE_IMAGE, new Dali.Property.Value( value ) );
329 public string GrabHandlePressedImage
334 GetProperty( TextEditor.Property.GRAB_HANDLE_PRESSED_IMAGE).Get( out temp );
339 SetProperty( TextEditor.Property.GRAB_HANDLE_PRESSED_IMAGE, new Dali.Property.Value( value ) );
342 public Dali.Property.Map SelectionHandleImageLeft
346 Dali.Property.Map temp = new Dali.Property.Map();
347 GetProperty( TextEditor.Property.SELECTION_HANDLE_IMAGE_LEFT).Get( temp );
352 SetProperty( TextEditor.Property.SELECTION_HANDLE_IMAGE_LEFT, new Dali.Property.Value( value ) );
355 public Dali.Property.Map SelectionHandleImageRight
359 Dali.Property.Map temp = new Dali.Property.Map();
360 GetProperty( TextEditor.Property.SELECTION_HANDLE_IMAGE_RIGHT).Get( temp );
365 SetProperty( TextEditor.Property.SELECTION_HANDLE_IMAGE_RIGHT, new Dali.Property.Value( value ) );
368 public Dali.Property.Map SelectionHandlePressedImageLeft
372 Dali.Property.Map temp = new Dali.Property.Map();
373 GetProperty( TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT).Get( temp );
378 SetProperty( TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT, new Dali.Property.Value( value ) );
381 public Dali.Property.Map SelectionHandlePressedImageRight
385 Dali.Property.Map temp = new Dali.Property.Map();
386 GetProperty( TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT).Get( temp );
391 SetProperty( TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT, new Dali.Property.Value( value ) );
394 public Dali.Property.Map SelectionHandleMarkerImageLeft
398 Dali.Property.Map temp = new Dali.Property.Map();
399 GetProperty( TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT).Get( temp );
404 SetProperty( TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT, new Dali.Property.Value( value ) );
407 public Dali.Property.Map SelectionHandleMarkerImageRight
411 Dali.Property.Map temp = new Dali.Property.Map();
412 GetProperty( TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT).Get( temp );
417 SetProperty( TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT, new Dali.Property.Value( value ) );
420 public Dali.CSharp.Color SelectionHighlightColor
424 Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);
425 GetProperty( TextEditor.Property.SELECTION_HIGHLIGHT_COLOR).Get( temp );
426 Dali.CSharp.Color ret = new Dali.CSharp.Color(temp.r, temp.g, temp.b, temp.a);
431 SetProperty( TextEditor.Property.SELECTION_HIGHLIGHT_COLOR, new Dali.Property.Value( value ) );
434 public RectInteger DecorationBoundingBox
438 RectInteger temp = new RectInteger(0,0,0,0);
439 GetProperty( TextEditor.Property.DECORATION_BOUNDING_BOX).Get( temp );
444 SetProperty( TextEditor.Property.DECORATION_BOUNDING_BOX, new Dali.Property.Value( value ) );
447 public bool EnableMarkup
452 GetProperty( TextEditor.Property.ENABLE_MARKUP).Get( ref temp );
457 SetProperty( TextEditor.Property.ENABLE_MARKUP, new Dali.Property.Value( value ) );
460 public Dali.CSharp.Color InputColor
464 Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);
465 GetProperty( TextEditor.Property.INPUT_COLOR).Get( temp );
466 Dali.CSharp.Color ret = new Dali.CSharp.Color(temp.r, temp.g, temp.b, temp.a);
471 SetProperty( TextEditor.Property.INPUT_COLOR, new Dali.Property.Value( value ) );
474 public string InputFontFamily
479 GetProperty( TextEditor.Property.INPUT_FONT_FAMILY).Get( out temp );
484 SetProperty( TextEditor.Property.INPUT_FONT_FAMILY, new Dali.Property.Value( value ) );
487 public Dali.Property.Map InputFontStyle
491 Dali.Property.Map temp = new Dali.Property.Map();
492 GetProperty( TextEditor.Property.INPUT_FONT_STYLE).Get( temp );
497 SetProperty( TextEditor.Property.INPUT_FONT_STYLE, new Dali.Property.Value( value ) );
500 public float InputPointSize
505 GetProperty( TextEditor.Property.INPUT_POINT_SIZE).Get( ref temp );
510 SetProperty( TextEditor.Property.INPUT_POINT_SIZE, new Dali.Property.Value( value ) );
513 public float LineSpacing
518 GetProperty( TextEditor.Property.LINE_SPACING).Get( ref temp );
523 SetProperty( TextEditor.Property.LINE_SPACING, new Dali.Property.Value( value ) );
526 public float InputLineSpacing
531 GetProperty( TextEditor.Property.INPUT_LINE_SPACING).Get( ref temp );
536 SetProperty( TextEditor.Property.INPUT_LINE_SPACING, new Dali.Property.Value( value ) );
539 public Dali.Property.Map Underline
543 Dali.Property.Map temp = new Dali.Property.Map();
544 GetProperty( TextEditor.Property.UNDERLINE).Get( temp );
549 SetProperty( TextEditor.Property.UNDERLINE, new Dali.Property.Value( value ) );
552 public Dali.Property.Map InputUnderline
556 Dali.Property.Map temp = new Dali.Property.Map();
557 GetProperty( TextEditor.Property.INPUT_UNDERLINE).Get( temp );
562 SetProperty( TextEditor.Property.INPUT_UNDERLINE, new Dali.Property.Value( value ) );
565 public Dali.Property.Map Shadow
569 Dali.Property.Map temp = new Dali.Property.Map();
570 GetProperty( TextEditor.Property.SHADOW).Get( temp );
575 SetProperty( TextEditor.Property.SHADOW, new Dali.Property.Value( value ) );
578 public Dali.Property.Map InputShadow
582 Dali.Property.Map temp = new Dali.Property.Map();
583 GetProperty( TextEditor.Property.INPUT_SHADOW).Get( temp );
588 SetProperty( TextEditor.Property.INPUT_SHADOW, new Dali.Property.Value( value ) );
591 public Dali.Property.Map Emboss
595 Dali.Property.Map temp = new Dali.Property.Map();
596 GetProperty( TextEditor.Property.EMBOSS).Get( temp );
601 SetProperty( TextEditor.Property.EMBOSS, new Dali.Property.Value( value ) );
604 public Dali.Property.Map InputEmboss
608 Dali.Property.Map temp = new Dali.Property.Map();
609 GetProperty( TextEditor.Property.INPUT_EMBOSS).Get( temp );
614 SetProperty( TextEditor.Property.INPUT_EMBOSS, new Dali.Property.Value( value ) );
617 public Dali.Property.Map Outline
621 Dali.Property.Map temp = new Dali.Property.Map();
622 GetProperty( TextEditor.Property.OUTLINE).Get( temp );
627 SetProperty( TextEditor.Property.OUTLINE, new Dali.Property.Value( value ) );
630 public Dali.Property.Map InputOutline
634 Dali.Property.Map temp = new Dali.Property.Map();
635 GetProperty( TextEditor.Property.INPUT_OUTLINE).Get( temp );
640 SetProperty( TextEditor.Property.INPUT_OUTLINE, new Dali.Property.Value( value ) );
644 /* Properties ends */
650 %define DALI_TEXTEDITOR_EVENTHANDLER_PARAM( NameSpace, ClassName)
652 TEXTEDITOR_EVENTHANDLER_TYPEMAP_EVENTARG( NameSpace, ClassName);
653 TEXTEDITOR_EVENTHANDLER_TYPEMAP_HELPER( NameSpace, ClassName);
659 DALI_TEXTEDITOR_EVENTHANDLER_PARAM( Dali::Toolkit, TextEditor);