2 * Copyright(c) 2020 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 extern alias TizenSystemSettings;
19 using TizenSystemSettings.Tizen.System;
21 using System.ComponentModel;
24 namespace Tizen.NUI.BaseComponents
27 /// Class with the text and style parameters to be rendered into a pixel buffer.
29 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
30 [EditorBrowsable(EditorBrowsableState.Never)]
31 public class RendererParameters : Disposable
33 internal RendererParameters(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
37 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(RendererParameters obj)
39 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
45 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
47 Interop.RendererParameters.DeleteRendererParameters(swigCPtr);
51 /// Construct RendererParameters
53 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
54 [EditorBrowsable(EditorBrowsableState.Never)]
55 public RendererParameters() : this(Interop.RendererParameters.NewRendererParameters(), true)
57 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
61 /// The text to be rendered
63 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
64 [EditorBrowsable(EditorBrowsableState.Never)]
69 Interop.RendererParameters.TextSet(SwigCPtr, value);
70 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
74 string ret = Interop.RendererParameters.TextGet(SwigCPtr);
75 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
81 /// The horizontal alignment: one of HorizontalAlignment.
83 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
84 [EditorBrowsable(EditorBrowsableState.Never)]
85 public HorizontalAlignment HorizontalAlignment
89 string alignment = "begin";
92 case HorizontalAlignment.Begin:
97 case HorizontalAlignment.Center:
102 case HorizontalAlignment.End:
112 Interop.RendererParameters.HorizontalAlignmentSet(SwigCPtr, alignment);
113 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
117 string ret = Interop.RendererParameters.HorizontalAlignmentGet(SwigCPtr);
118 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
119 HorizontalAlignment alignment = HorizontalAlignment.Begin;
124 alignment = HorizontalAlignment.Begin;
129 alignment = HorizontalAlignment.Center;
134 alignment = HorizontalAlignment.End;
147 /// The vertical alignment: one of VerticalAlignment.
149 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
150 [EditorBrowsable(EditorBrowsableState.Never)]
151 public VerticalAlignment VerticalAlignment
155 string alignment = "top";
158 case VerticalAlignment.Top:
163 case VerticalAlignment.Center:
165 alignment = "center";
168 case VerticalAlignment.Bottom:
170 alignment = "bottom";
178 Interop.RendererParameters.VerticalAlignmentSet(SwigCPtr, alignment);
179 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
183 string ret = Interop.RendererParameters.VerticalAlignmentGet(SwigCPtr);
184 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
185 VerticalAlignment alignment = VerticalAlignment.Top;
190 alignment = VerticalAlignment.Top;
195 alignment = VerticalAlignment.Center;
200 alignment = VerticalAlignment.Bottom;
213 /// The font's family.
215 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
216 [EditorBrowsable(EditorBrowsableState.Never)]
217 public string FontFamily
221 Interop.RendererParameters.FontFamilySet(SwigCPtr, value);
222 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
226 string ret = Interop.RendererParameters.FontFamilyGet(SwigCPtr);
227 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
233 /// The font's weight: one of {"thin", "ultraLight", "extraLight", "light", "demiLight", "semiLight", "book", "normal", "regular", "medium", "demiBold", "semiBold", "bold", "ultraBold", "extraBold", "black", "heavy", "extraBlack"}.
235 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
236 [EditorBrowsable(EditorBrowsableState.Never)]
237 public string FontWeight
241 Interop.RendererParameters.FontWeightSet(SwigCPtr, value);
242 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
246 string ret = Interop.RendererParameters.FontWeightGet(SwigCPtr);
247 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
253 /// The font's width: one of {"ultraCondensed", "extraCondensed", "condensed", "semiCondensed", "normal", "semiExpanded", "expanded", "extraExpanded", "ultraExpanded"}.
255 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
256 [EditorBrowsable(EditorBrowsableState.Never)]
257 public string FontWidth
261 Interop.RendererParameters.FontWidthSet(SwigCPtr, value);
262 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
266 string ret = Interop.RendererParameters.FontWidthGet(SwigCPtr);
267 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
273 /// The font's slant. one of {"normal", "roman", "italic", "oblique"}
275 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
276 [EditorBrowsable(EditorBrowsableState.Never)]
277 public string FontSlant
281 Interop.RendererParameters.FontSlantSet(SwigCPtr, value);
282 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
286 string ret = Interop.RendererParameters.FontSlantGet(SwigCPtr);
287 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
293 /// The type of layout: one of TextLayout {"singleLine", "multiLine", "circular"}
295 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
296 [EditorBrowsable(EditorBrowsableState.Never)]
297 public TextLayout Layout
301 string textLayout = "singleLine";
304 case TextLayout.SingleLine:
306 textLayout = "singleLine";
309 case TextLayout.MultiLine:
311 textLayout = "multiLine";
314 case TextLayout.Circular:
316 textLayout = "circular";
324 Interop.RendererParameters.LayoutSet(SwigCPtr, textLayout);
325 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
329 string ret = Interop.RendererParameters.LayoutGet(SwigCPtr);
330 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
331 TextLayout textLayout = TextLayout.SingleLine;
336 textLayout = TextLayout.SingleLine;
341 textLayout = TextLayout.MultiLine;
346 textLayout = TextLayout.Circular;
359 /// The text alignment within the arc: one of CircularAlignment. The @p horizontalAlignment and @p verticalAlignment can be used to align the text within the text area.
361 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
362 [EditorBrowsable(EditorBrowsableState.Never)]
363 public CircularAlignment CircularAlignment
367 string alignment = "begin";
370 case CircularAlignment.Begin:
375 case CircularAlignment.Center:
377 alignment = "center";
380 case CircularAlignment.End:
390 Interop.RendererParameters.CircularAlignmentSet(SwigCPtr, alignment);
391 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
395 string ret = Interop.RendererParameters.CircularAlignmentGet(SwigCPtr);
396 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
397 CircularAlignment alignment = CircularAlignment.Begin;
402 alignment = CircularAlignment.Begin;
407 alignment = CircularAlignment.Center;
412 alignment = CircularAlignment.End;
425 /// The default text's color. Default is white.
427 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
428 [EditorBrowsable(EditorBrowsableState.Never)]
429 public Vector4 TextColor
433 Interop.RendererParameters.TextColorSet(SwigCPtr, Vector4.getCPtr(value));
434 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
438 Vector4 ret = new Vector4(Interop.RendererParameters.TextColorGet(SwigCPtr), true);
439 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
445 /// The font's size (in points).
447 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
448 [EditorBrowsable(EditorBrowsableState.Never)]
449 public float FontSize
453 Interop.RendererParameters.FontSizeSet(SwigCPtr, value);
454 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
458 float ret = Interop.RendererParameters.FontSizeGet(SwigCPtr);
459 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
465 /// The width in pixels of the boundaries where the text is going to be laid-out.
467 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
468 [EditorBrowsable(EditorBrowsableState.Never)]
469 public uint TextWidth
473 Interop.RendererParameters.TextWidthSet(SwigCPtr, value);
474 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
478 uint ret = Interop.RendererParameters.TextWidthGet(SwigCPtr);
479 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
485 /// The height in pixels of the boundaries where the text is going to be laid-out.
487 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
488 [EditorBrowsable(EditorBrowsableState.Never)]
489 public uint TextHeight
493 Interop.RendererParameters.TextHeightSet(SwigCPtr, value);
494 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
498 uint ret = Interop.RendererParameters.TextHeightGet(SwigCPtr);
499 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
505 /// The radius in pixels of the circular text.
507 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
508 [EditorBrowsable(EditorBrowsableState.Never)]
513 Interop.RendererParameters.RadiusSet(SwigCPtr, value);
514 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
518 uint ret = Interop.RendererParameters.RadiusGet(SwigCPtr);
519 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
525 /// The begin angle in degrees of the text area on the circle. The top of the circle is 0°, the right side 90°, the bottom 180° and the left 270°.
527 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
528 [EditorBrowsable(EditorBrowsableState.Never)]
529 public float BeginAngle
533 Interop.RendererParameters.BeginAngleSet(SwigCPtr, value);
534 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
538 float ret = Interop.RendererParameters.BeginAngleGet(SwigCPtr);
539 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
545 /// The increment angle in degrees of the text area on the circle. The @p incrementAngle defines a direction. If positive, the text will be laid out clockwise.
547 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
548 [EditorBrowsable(EditorBrowsableState.Never)]
549 public float IncrementAngle
553 Interop.RendererParameters.IncrementAngleSet(SwigCPtr, value);
554 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
558 float ret = Interop.RendererParameters.IncrementAngleGet(SwigCPtr);
559 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
565 /// Whether the ellipsis layout option is enabled.
567 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
568 [EditorBrowsable(EditorBrowsableState.Never)]
569 public bool EllipsisEnabled
573 Interop.RendererParameters.EllipsisEnabledSet(SwigCPtr, value);
574 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
578 bool ret = Interop.RendererParameters.EllipsisEnabledGet(SwigCPtr);
579 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
585 /// Whether the mark-up processor is enabled.
587 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
588 [EditorBrowsable(EditorBrowsableState.Never)]
589 public bool MarkupEnabled
593 Interop.RendererParameters.MarkupEnabledSet(SwigCPtr, value);
594 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
598 bool ret = Interop.RendererParameters.MarkupEnabledGet(SwigCPtr);
599 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
605 /// Whether a default color has been set.
607 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
608 [EditorBrowsable(EditorBrowsableState.Never)]
609 public bool IsTextColorSet
613 Interop.RendererParameters.IsTextColorSetSet(SwigCPtr, value);
614 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
618 bool ret = Interop.RendererParameters.IsTextColorSetGet(SwigCPtr);
619 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
625 /// Minimum size of line.
627 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
628 [EditorBrowsable(EditorBrowsableState.Never)]
629 public float MinLineSize
633 Interop.RendererParameters.MinLineSizeSet(SwigCPtr, value);
634 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
638 float ret = Interop.RendererParameters.MinLineSizeGet(SwigCPtr);
639 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
645 /// Padding of TextLabel.
647 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
648 [EditorBrowsable(EditorBrowsableState.Never)]
649 public Extents Padding
653 Interop.RendererParameters.PaddingSet(SwigCPtr, Extents.getCPtr(value));
654 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
658 Extents ret = new Extents(Interop.RendererParameters.PaddingGet(SwigCPtr), true);
659 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
667 /// Class with info of the embedded items layout.
669 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
670 [EditorBrowsable(EditorBrowsableState.Never)]
671 public class EmbeddedItemInfo : Disposable
674 internal EmbeddedItemInfo(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
678 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(EmbeddedItemInfo obj)
680 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
686 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
688 Interop.EmbeddedItemInfo.DeleteEmbeddedItemInfo(swigCPtr);
692 /// Construct EmbeddedItemInfo
694 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
695 [EditorBrowsable(EditorBrowsableState.Never)]
696 public EmbeddedItemInfo() : this(Interop.EmbeddedItemInfo.NewEmbeddedItemInfo(), true)
698 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
702 /// Index to the character within the string.
704 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
705 [EditorBrowsable(EditorBrowsableState.Never)]
706 public uint CharacterIndex
710 Interop.EmbeddedItemInfo.CharacterIndexSet(SwigCPtr, value);
711 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
715 uint ret = Interop.EmbeddedItemInfo.CharacterIndexGet(SwigCPtr);
716 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
722 /// Index to the glyph
724 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
725 [EditorBrowsable(EditorBrowsableState.Never)]
726 public uint GlyphIndex
730 Interop.EmbeddedItemInfo.GlyphIndexSet(SwigCPtr, value);
731 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
735 uint ret = Interop.EmbeddedItemInfo.GlyphIndexGet(SwigCPtr);
736 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
742 /// The layout position within the buffer (top, left corner).
744 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
745 [EditorBrowsable(EditorBrowsableState.Never)]
746 public Vector2 Position
750 Interop.EmbeddedItemInfo.PositionSet(SwigCPtr, Vector2.getCPtr(value));
751 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
755 Vector2 ret = new Vector2(Interop.EmbeddedItemInfo.PositionGet(SwigCPtr), SwigCMemOwn);
756 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
762 /// The size within the buffer of the embedded item.
764 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
765 [EditorBrowsable(EditorBrowsableState.Never)]
770 Interop.EmbeddedItemInfo.SizeSet(SwigCPtr, Size.getCPtr(value));
771 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
775 Size ret = new Size(Interop.EmbeddedItemInfo.SizeGet(SwigCPtr), SwigCMemOwn);
776 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
782 /// The rotated size within the buffer of the embedded item.
784 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
785 [EditorBrowsable(EditorBrowsableState.Never)]
786 public Size RotatedSize
790 Interop.EmbeddedItemInfo.RotatedSizeSet(SwigCPtr, Size.getCPtr(value));
791 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
795 Size ret = new Size(Interop.EmbeddedItemInfo.RotatedSizeGet(SwigCPtr), SwigCMemOwn);
796 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
802 /// Rotation angle of the pixel buffer in degrees.
804 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
805 [EditorBrowsable(EditorBrowsableState.Never)]
810 Interop.EmbeddedItemInfo.AngleSet(SwigCPtr, Degree.getCPtr(value));
811 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
815 Degree ret = new Degree(Interop.EmbeddedItemInfo.AngleGet(SwigCPtr), SwigCMemOwn);
816 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
822 /// Whether the color of the image is multiplied by the color of the text.
824 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
825 [EditorBrowsable(EditorBrowsableState.Never)]
826 public Tizen.NUI.ColorBlendingMode ColorBlendingMode
830 Interop.EmbeddedItemInfo.ColorBlendingModeSet(SwigCPtr, value);
831 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
835 Tizen.NUI.ColorBlendingMode ret = Interop.EmbeddedItemInfo.ColorBlendingModeGet(SwigCPtr);
836 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
843 /// Class with the parameters needed to build a shadow for the given pixel buffer.
845 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
846 [EditorBrowsable(EditorBrowsableState.Never)]
847 public class ShadowParameters : Disposable
850 internal ShadowParameters(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
854 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ShadowParameters obj)
856 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
862 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
864 Interop.ShadowParameters.DeleteShadowParameters(swigCPtr);
868 /// Construct ShadowParameters
870 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
871 [EditorBrowsable(EditorBrowsableState.Never)]
872 public ShadowParameters() : this(Interop.ShadowParameters.NewShadowParameters(), true)
874 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
878 /// The input pixel buffer used to create the shadow.
880 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
881 [EditorBrowsable(EditorBrowsableState.Never)]
882 public PixelBuffer Input
886 Interop.ShadowParameters.InputSet(SwigCPtr, PixelBuffer.getCPtr(value));
887 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
891 PixelBuffer ret = new PixelBuffer(Interop.ShadowParameters.InputGet(SwigCPtr), true);
892 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
898 /// The color of the text.
900 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
901 [EditorBrowsable(EditorBrowsableState.Never)]
902 public Vector4 TextColor
906 Interop.ShadowParameters.TextColorSet(SwigCPtr, Vector4.getCPtr(value));
907 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
911 Vector4 ret = new Vector4(Interop.ShadowParameters.TextColorGet(SwigCPtr), true);
912 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
918 /// The color of the shadow.
920 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
921 [EditorBrowsable(EditorBrowsableState.Never)]
926 Interop.ShadowParameters.ColorSet(SwigCPtr, Vector4.getCPtr(value));
927 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
931 Vector4 ret = new Vector4(Interop.ShadowParameters.ColorGet(SwigCPtr), true);
932 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
938 /// The offset of the shadow.
940 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
941 [EditorBrowsable(EditorBrowsableState.Never)]
942 public Vector2 Offset
946 Interop.ShadowParameters.OffsetSet(SwigCPtr, Vector2.getCPtr(value));
947 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
951 Vector2 ret = new Vector2(Interop.ShadowParameters.OffsetGet(SwigCPtr), true);
952 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
958 /// Whether to blend the shadow.
960 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
961 [EditorBrowsable(EditorBrowsableState.Never)]
962 public bool blendShadow
966 Interop.ShadowParameters.BlendShadowSet(SwigCPtr, value);
967 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
971 bool ret = Interop.ShadowParameters.BlendShadowGet(SwigCPtr);
972 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
980 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
981 [EditorBrowsable(EditorBrowsableState.Never)]
982 public static partial class TextUtils
985 /// Renders text into a pixel buffer.
986 /// @note: Can process a mark-up string.
987 /// @note: It does the font selection, RTL reordering, shaping and layouting.
988 /// @note: The width of the pixel buffer may be different to the given @e textWidth
989 /// due to some padding pixels added.
991 /// The text is laid-out for the given size @e (textWidth,textHeight).
992 /// If the @e multiLineEnabled option is enabled, the text will wrap in lines.
993 /// If the @e ellipsisEnabled option is enabled, the text will be ellided if
994 /// there is no more space for new lines.
996 /// It won't be rendered the parts of the text exceeding the boundaries of
997 /// the given width and height.
999 /// If the given @e textHeight is zero, a big enough pixel buffer will be created
1000 /// to render the full text.
1002 /// If the given @e textWidth is zero, the 'natural size' of the text will be
1003 /// used to create the pixel buffer to render the full text.
1005 /// If the radius is not zero, the text will be laid-out following a circular path.
1006 /// In that case the text is laid-out in a single line.
1008 /// If the mark-up string contains embedded items, the @p embeddedItemLayout vector
1009 /// contains the layout info of each embedded item.
1011 /// <param name="textParameters">The text and style options.</param>
1012 /// <param name="embeddedItemLayout">The layout info of the embedded items</param>
1013 /// <returns>A pixel buffer with the text rendered on it.</returns>
1014 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
1015 [EditorBrowsable(EditorBrowsableState.Never)]
1016 public static PixelBuffer Render(RendererParameters textParameters, ref EmbeddedItemInfo[] embeddedItemLayout)
1020 global::System.IntPtr returnItem = IntPtr.Zero;
1021 PixelBuffer ret = new PixelBuffer(Interop.TextUtils.Render(RendererParameters.getCPtr(textParameters), ref returnItem, ref count, ref length), true);
1023 embeddedItemLayout = new EmbeddedItemInfo[count];
1024 for (int i = 0; i < count; i++)
1026 IntPtr p = new IntPtr((returnItem.ToInt32() + i * length));
1027 embeddedItemLayout[i] = new EmbeddedItemInfo(p, false);
1029 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1034 /// Creates a shadow for the text given in the input pixel buffer.
1035 /// The function returns a RGBA8888 pixel buffer with the text and its shadow rendered on it.
1037 /// The pixel format of the @e input pixel buffer could be an A8 or an RGBA8888. If it's
1038 /// an A8 pixel buffer, it uses the given @e textColor to give color to the text. Otherwise
1039 /// it uses the color of the @e input pixel buffer.
1041 /// <param name="shadowParameters">The parameters needed to create the text's shadow.</param>
1042 /// <returns>A pixel buffer with the text and the shadow rendered on it.</returns>
1043 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
1044 [EditorBrowsable(EditorBrowsableState.Never)]
1045 public static PixelBuffer CreateShadow(ShadowParameters shadowParameters)
1047 PixelBuffer ret = new PixelBuffer(Interop.TextUtils.CreateShadow(ShadowParameters.getCPtr(shadowParameters)), true);
1048 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1053 /// Converts a @p pixelBuffer with pixel format A8 to RGBA8888 using the given @p color.
1054 /// @note Does nothing if the @p pixelBuffer is not A8.
1056 /// <param name="pixelBuffer">The pixel buffer with pixel format A8</param>
1057 /// <param name="color">The color used to convert to RGBA8888</param>
1058 /// <param name="multiplyByAlpha">multiplyByAlpha Whether to multiply the @p color with the alpha value of the @p pixel @p buffer.</param>
1059 /// <returns>The pixel buffer converted to RGBA8888.</returns>
1060 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
1061 [EditorBrowsable(EditorBrowsableState.Never)]
1062 public static PixelBuffer ConvertToRgba8888(PixelBuffer pixelBuffer, Vector4 color, bool multiplyByAlpha)
1064 PixelBuffer ret = new PixelBuffer(Interop.TextUtils.ConvertToRgba8888(PixelBuffer.getCPtr(pixelBuffer), Vector4.getCPtr(color), multiplyByAlpha), true);
1065 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1070 /// Updates the @p dst pixel buffer with the data from @p src pixel buffer.
1071 /// @note Both pixel buffers must have the same pixel format. Does nothing if both pixel format are different.
1072 /// @note The function does nothing if the @p src pixel buffer doesn't fit into the @p dst pixel buffer.
1074 /// The @p src pixel buffer could be blended with the @p dst pixel buffer if @p blend is set to @e true.
1076 /// <param name="src">The pixel buffer from where the data is read.</param>
1077 /// <param name="dst">The pixel buffer where the data is written.</param>
1078 /// <param name="x">The top left corner's X within the destination pixel buffer.</param>
1079 /// <param name="y">The top left corner's y within the destination pixel buffer.</param>
1080 /// <param name="blend">Whether to blend the source pixel buffer with the destination pixel buffer as background.</param>
1081 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
1082 [EditorBrowsable(EditorBrowsableState.Never)]
1083 public static void UpdateBuffer(PixelBuffer src, PixelBuffer dst, uint x, uint y, bool blend)
1085 Interop.TextUtils.UpdateBuffer(PixelBuffer.getCPtr(src), PixelBuffer.getCPtr(dst), x, y, blend);
1086 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1090 /// Splits the text in pages of the size given in @p textParameters
1091 /// @note The returned indices are indices to utf32 characters. The input text is encoded in utf8.
1092 /// <returns> An array with the indices of the last character of each page </returns>
1094 [EditorBrowsable(EditorBrowsableState.Never)]
1095 public static Tizen.NUI.PropertyArray GetLastCharacterIndex(RendererParameters textParameters)
1097 Tizen.NUI.PropertyArray ret = new Tizen.NUI.PropertyArray(Interop.TextUtils.GetLastCharacterIndex(RendererParameters.getCPtr(textParameters)), true);
1098 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1103 private const float FontSizeScaleSmall = 0.8f;
1104 private const float FontSizeScaleNormal = 1.0f;
1105 private const float FontSizeScaleLarge = 1.5f;
1106 private const float FontSizeScaleHuge = 1.9f;
1107 private const float FontSizeScaleGiant = 2.5f;
1108 #elif PROFILE_WEARABLE
1109 // The following values from 'system-settings/libutil/sstu.c'
1110 private const float FontSizeScaleSmall = 0.9f;
1111 private const float FontSizeScaleNormal = 1.0f;
1112 private const float FontSizeScaleLarge = 1.1f;
1113 private const float FontSizeScaleHuge = 1.9f;
1114 private const float FontSizeScaleGiant = 2.5f;
1115 #else // PROFILE_MOBILE and etc
1116 // The following values from 'system-settings/libutil/sstu.c'
1117 private const float FontSizeScaleSmall = 0.8f;
1118 private const float FontSizeScaleNormal = 1.0f;
1119 private const float FontSizeScaleLarge = 1.5f;
1120 private const float FontSizeScaleHuge = 1.9f;
1121 private const float FontSizeScaleGiant = 2.5f;
1125 /// It returns a float value according to SystemSettingsFontSize.
1126 /// The returned value can be used for FontSizeScale property.
1127 /// <param name="systemSettingsFontSize">The SystemSettingsFontSize enum value.</param>
1128 /// <returns> A float value for FontSizeScale property. </returns>
1130 [EditorBrowsable(EditorBrowsableState.Never)]
1131 public static float GetFontSizeScale(SystemSettingsFontSize systemSettingsFontSize)
1133 float ret = FontSizeScaleNormal;
1135 switch (systemSettingsFontSize)
1137 case SystemSettingsFontSize.Small:
1138 ret = FontSizeScaleSmall;
1140 case SystemSettingsFontSize.Normal:
1141 ret = FontSizeScaleNormal;
1143 case SystemSettingsFontSize.Large:
1144 ret = FontSizeScaleLarge;
1146 case SystemSettingsFontSize.Huge:
1147 ret = FontSizeScaleHuge;
1149 case SystemSettingsFontSize.Giant:
1150 ret = FontSizeScaleGiant;
1158 /// It returns a string value according to FontWidthType.
1159 /// The returned value can be used for FontStyle PropertyMap.
1160 /// <param name="fontWidthType">The FontWidthType enum value.</param>
1161 /// <returns> A string value for FontStyle.Width property. </returns>
1163 [EditorBrowsable(EditorBrowsableState.Never)]
1164 public static string GetFontWidthString(FontWidthType fontWidthType)
1166 string value = fontWidthType.ToString();
1167 if (!string.IsNullOrEmpty(value))
1169 char[] charArray = value.ToCharArray();
1170 charArray[0] = Char.ToLower(charArray[0]);
1171 value = new string(charArray);
1175 value = "none"; // The default value.
1182 /// It returns a string value according to FontWeightType.
1183 /// The returned value can be used for FontStyle PropertyMap.
1184 /// <param name="fontWeightType">The FontWeightType enum value.</param>
1185 /// <returns> A string value for FontStyle.Weight property. </returns>
1187 [EditorBrowsable(EditorBrowsableState.Never)]
1188 public static string GetFontWeightString(FontWeightType fontWeightType)
1190 string value = fontWeightType.ToString();
1191 if (!string.IsNullOrEmpty(value))
1193 char[] charArray = value.ToCharArray();
1194 charArray[0] = Char.ToLower(charArray[0]);
1195 value = new string(charArray);
1199 value = "none"; // The default value.
1206 /// It returns a string value according to FontSlantType.
1207 /// The returned value can be used for FontStyle PropertyMap.
1208 /// <param name="fontSlantType">The FontSlantType enum value.</param>
1209 /// <returns> A string value for FontStyle.Slant property. </returns>
1211 [EditorBrowsable(EditorBrowsableState.Never)]
1212 public static string GetFontSlantString(FontSlantType fontSlantType)
1214 string value = fontSlantType.ToString();
1215 if (!string.IsNullOrEmpty(value))
1217 char[] charArray = value.ToCharArray();
1218 charArray[0] = Char.ToLower(charArray[0]);
1219 value = new string(charArray);
1223 value = "none"; // The default value.
1230 /// It returns a FontWidthType value according to fontWidthString.
1231 /// The returned value can be used for FontStyle PropertyMap.
1232 /// <param name="fontWidthString">The FontWidth string value.</param>
1233 /// <returns> A FontWidthType value for FontStyle.Width property. </returns>
1235 [EditorBrowsable(EditorBrowsableState.Never)]
1236 public static FontWidthType GetFontWidthType(string fontWidthString)
1238 FontWidthType value;
1240 if (!(Enum.TryParse(fontWidthString, true, out value) && Enum.IsDefined(typeof(FontWidthType), value)))
1242 value = FontWidthType.None; // If parsing fails, set a default value.
1249 /// It returns a FontWeightType value according to fontWeightString.
1250 /// The returned value can be used for FontStyle PropertyMap.
1251 /// <param name="fontWeightString">The FontWeight string value.</param>
1252 /// <returns> A FontWeightType value for FontStyle.Weight property. </returns>
1254 [EditorBrowsable(EditorBrowsableState.Never)]
1255 public static FontWeightType GetFontWeightType(string fontWeightString)
1257 FontWeightType value;
1259 if (!(Enum.TryParse(fontWeightString, true, out value) && Enum.IsDefined(typeof(FontWeightType), value)))
1261 value = FontWeightType.None; // If parsing fails, set a default value.
1268 /// It returns a FontSlantType value according to fontSlantString.
1269 /// The returned value can be used for FontStyle PropertyMap.
1270 /// <param name="fontSlantString">The FontSlant string value.</param>
1271 /// <returns> A FontSlantType value for FontStyle.Slant property. </returns>
1273 [EditorBrowsable(EditorBrowsableState.Never)]
1274 public static FontSlantType GetFontSlantType(string fontSlantString)
1276 FontSlantType value;
1278 if (!(Enum.TryParse(fontSlantString, true, out value) && Enum.IsDefined(typeof(FontSlantType), value)))
1280 value = FontSlantType.None; // If parsing fails, set a default value.
1287 /// This method converts a FontStyle struct to a PropertyMap and returns it.
1288 /// The returned map can be used for set FontStyle PropertyMap in the SetFontStyle method.
1289 /// <param name="fontStyle">The FontStyle struct value.</param>
1290 /// <returns> A PropertyMap for FontStyle property. </returns>
1292 [EditorBrowsable(EditorBrowsableState.Never)]
1293 public static PropertyMap GetFontStyleMap(FontStyle fontStyle)
1295 var map = new PropertyMap();
1296 var width = new PropertyValue(GetFontWidthString(fontStyle.Width));
1297 var weight = new PropertyValue(GetFontWeightString(fontStyle.Weight));
1298 var slant = new PropertyValue(GetFontSlantString(fontStyle.Slant));
1300 map.Add("width", width);
1301 map.Add("weight", weight);
1302 map.Add("slant", slant);
1308 /// This method converts a FontStyle map to a struct and returns it.
1309 /// The returned struct can be returned to the user as a FontStyle in the GetFontStyle method.
1310 /// <param name="map">The FontStyle PropertyMap.</param>
1311 /// <returns> A FontStyle struct. </returns>
1313 [EditorBrowsable(EditorBrowsableState.Never)]
1314 public static FontStyle GetFontStyleStruct(PropertyMap map)
1316 string width = "none";
1317 string weight = "none";
1318 string slant = "none";
1319 map.Find(0, "width")?.Get(out width);
1320 map.Find(0, "weight")?.Get(out weight);
1321 map.Find(0, "slant")?.Get(out slant);
1323 var fontStyle = new FontStyle();
1324 fontStyle.Width = GetFontWidthType(width);
1325 fontStyle.Weight = GetFontWeightType(weight);
1326 fontStyle.Slant = GetFontSlantType(slant);
1332 /// This method converts a InputFilter struct to a PropertyMap and returns it. <br />
1333 /// The returned map can be used for set InputFilter PropertyMap in the SetInputFilter method. <br />
1334 /// <param name="inputFilter">The InputFilter struct value.</param>
1335 /// <returns> A PropertyMap for InputFilter property. </returns>
1337 [EditorBrowsable(EditorBrowsableState.Never)]
1338 public static PropertyMap GetInputFilterMap(InputFilter inputFilter)
1340 var map = new PropertyMap();
1341 var accepted = inputFilter.Accepted != null ? new PropertyValue(inputFilter.Accepted) : new PropertyValue("");
1342 var rejected = inputFilter.Rejected != null ? new PropertyValue(inputFilter.Rejected) : new PropertyValue("");
1343 map.Add(0, accepted);
1344 map.Add(1, rejected);
1350 /// This method converts a InputFilter map to a struct and returns it. <br />
1351 /// The returned struct can be returned to the user as a InputFilter in the GetInputFilter method. <br />
1352 /// <param name="map">The InputFilter PropertyMap.</param>
1353 /// <returns> A InputFilter struct. </returns>
1355 [EditorBrowsable(EditorBrowsableState.Never)]
1356 public static InputFilter GetInputFilterStruct(PropertyMap map)
1358 string accepted = "";
1359 string rejected = "";
1360 map.Find(0)?.Get(out accepted);
1361 map.Find(1)?.Get(out rejected);
1363 var inputFilter = new InputFilter();
1364 inputFilter.Accepted = accepted;
1365 inputFilter.Rejected = rejected;
1372 /// This method converts a Underline struct to a PropertyMap and returns it.
1373 /// The returned map can be used for set Underline PropertyMap in the SetUnderline method.
1374 /// <param name="underline">The Underline struct value.</param>
1375 /// <returns> A PropertyMap for Underline property. </returns>
1377 [EditorBrowsable(EditorBrowsableState.Never)]
1378 public static PropertyMap GetUnderlineMap(Underline underline)
1380 var map = new PropertyMap();
1382 map.Add("enable", new PropertyValue(underline.Enable));
1384 if (underline.Color != null)
1385 map.Add("color", new PropertyValue(underline.Color));
1387 if (underline.Height != null)
1388 map.Add("height", new PropertyValue((float)underline.Height));
1394 /// This method converts a Underline map to a struct and returns it.
1395 /// The returned struct can be returned to the user as a Underline in the GetUnderline method.
1396 /// <param name="map">The Underline PropertyMap.</param>
1397 /// <returns> A Underline struct. </returns>
1399 [EditorBrowsable(EditorBrowsableState.Never)]
1400 public static Underline GetUnderlineStruct(PropertyMap map)
1402 Color color = new Color();
1403 map.Find(0, "enable").Get(out bool enable);
1404 map.Find(0, "color").Get(color);
1405 map.Find(0, "height").Get(out float height);
1407 var underline = new Underline();
1408 underline.Enable = enable;
1409 underline.Color = color;
1410 underline.Height = height;
1416 /// This method converts a Shadow struct to a PropertyMap and returns it.
1417 /// The returned map can be used for set Shadow PropertyMap in the SetShadow method.
1418 /// <param name="shadow">The Shadow struct value.</param>
1419 /// <returns> A PropertyMap for Shadow property. </returns>
1421 [EditorBrowsable(EditorBrowsableState.Never)]
1422 public static PropertyMap GetShadowMap(Tizen.NUI.Text.Shadow shadow)
1424 var map = new PropertyMap();
1426 if (shadow.Offset != null)
1427 map.Add("offset", new PropertyValue(shadow.Offset));
1429 if (shadow.Color != null)
1430 map.Add("color", new PropertyValue(shadow.Color));
1432 if (shadow.BlurRadius != null)
1433 map.Add("blurRadius", new PropertyValue((float)shadow.BlurRadius));
1439 /// This method converts a Shadow map to a struct and returns it.
1440 /// The returned struct can be returned to the user as a Shadow in the GetShadow method.
1441 /// <param name="map">The Shadow PropertyMap.</param>
1442 /// <returns> A Shadow struct. </returns>
1444 [EditorBrowsable(EditorBrowsableState.Never)]
1445 public static Tizen.NUI.Text.Shadow GetShadowStruct(PropertyMap map)
1447 Vector2 offset = new Vector2();
1448 Color color = new Color();
1449 map.Find(0, "offset").Get(offset);
1450 map.Find(0, "color").Get(color);
1451 map.Find(0, "blurRadius").Get(out float blurRadius);
1453 var shadow = new Tizen.NUI.Text.Shadow();
1454 shadow.Offset = offset;
1455 shadow.Color = color;
1456 shadow.BlurRadius = blurRadius;
1462 /// This method converts a Outline struct to a PropertyMap and returns it.
1463 /// The returned map can be used for set Outline PropertyMap in the SetOutline method.
1464 /// <param name="outline">The Outline struct value.</param>
1465 /// <returns> A PropertyMap for Outline property. </returns>
1467 [EditorBrowsable(EditorBrowsableState.Never)]
1468 public static PropertyMap GetOutlineMap(Outline outline)
1470 var map = new PropertyMap();
1472 if (outline.Color != null)
1473 map.Add("color", new PropertyValue(outline.Color));
1475 if (outline.Width != null)
1476 map.Add("width", new PropertyValue((float)outline.Width));
1482 /// This method converts a Outline map to a struct and returns it.
1483 /// The returned struct can be returned to the user as a Outline in the GetOutline method.
1484 /// <param name="map">The Outline PropertyMap.</param>
1485 /// <returns> A Outline struct. </returns>
1487 [EditorBrowsable(EditorBrowsableState.Never)]
1488 public static Outline GetOutlineStruct(PropertyMap map)
1490 Color color = new Color();
1491 map.Find(0, "color").Get(color);
1492 map.Find(0, "width").Get(out float width);
1494 var outline = new Outline();
1495 outline.Color = color;
1496 outline.Width = width;
1502 /// It returns a string value according to FontSizeType.
1503 /// The returned value can be used for TextFit PropertyMap.
1504 /// <param name="fontSizeType">The FontSizeType enum value.</param>
1505 /// <returns> A string value for TextFit.FontSizeType property. </returns>
1507 [EditorBrowsable(EditorBrowsableState.Never)]
1508 public static string GetFontSizeString(FontSizeType fontSizeType)
1510 string value = fontSizeType.ToString();
1511 if (!string.IsNullOrEmpty(value))
1513 char[] charArray = value.ToCharArray();
1514 charArray[0] = Char.ToLower(charArray[0]);
1515 value = new string(charArray);
1519 value = "pointSize"; // The default value.
1526 /// It returns a FontSizeType value according to fontSizeString.
1527 /// The returned value can be used for FontStyle PropertyMap.
1528 /// <param name="fontSizeString">The FontSizeType string value.</param>
1529 /// <returns> A FontSizeType value for TextFit.FontSizeType property. </returns>
1531 [EditorBrowsable(EditorBrowsableState.Never)]
1532 public static FontSizeType GetFontSizeType(string fontSizeString)
1536 if (!(Enum.TryParse(fontSizeString, true, out value) && Enum.IsDefined(typeof(FontSizeType), value)))
1538 value = FontSizeType.PointSize; // If parsing fails, set a default value.
1545 /// This method converts a TextFit struct to a PropertyMap and returns it.
1546 /// The returned map can be used for set TextFit PropertyMap in the SetTextFit method.
1547 /// <param name="textFit">The TextFit struct value.</param>
1548 /// <returns> A PropertyMap for TextFit property. </returns>
1550 [EditorBrowsable(EditorBrowsableState.Never)]
1551 public static PropertyMap GetTextFitMap(TextFit textFit)
1553 var map = new PropertyMap();
1554 map.Add("enable", new PropertyValue(textFit.Enable));
1555 map.Add("fontSizeType", new PropertyValue(GetFontSizeString(textFit.FontSizeType)));
1557 if (textFit.MinSize != null)
1558 map.Add("minSize", new PropertyValue((float)textFit.MinSize));
1560 if (textFit.MaxSize != null)
1561 map.Add("maxSize", new PropertyValue((float)textFit.MaxSize));
1563 if (textFit.StepSize != null)
1564 map.Add("stepSize", new PropertyValue((float)textFit.StepSize));
1570 /// This method converts a TextFit map to a struct and returns it.
1571 /// The returned struct can be returned to the user as a TextFit in the GetTextFit method.
1572 /// <param name="map">The TextFit PropertyMap.</param>
1573 /// <returns> A TextFit struct. </returns>
1575 [EditorBrowsable(EditorBrowsableState.Never)]
1576 public static TextFit GetTextFitStruct(PropertyMap map)
1578 map.Find(0, "enable").Get(out bool enable);
1579 map.Find(0, "minSize").Get(out float minSize);
1580 map.Find(0, "maxSize").Get(out float maxSize);
1581 map.Find(0, "stepSize").Get(out float stepSize);
1582 map.Find(0, "fontSizeType").Get(out string fontSizeType);
1584 var textFit = new TextFit();
1585 textFit.Enable = enable;
1586 textFit.MinSize = minSize;
1587 textFit.MaxSize = maxSize;
1588 textFit.StepSize = stepSize;
1589 textFit.FontSizeType = GetFontSizeType(fontSizeType);
1595 /// This method converts a Placeholder struct to a PropertyMap and returns it.
1596 /// The returned map can be used for set Placeholder PropertyMap in the SetPlaceholder method.
1597 /// <param name="placeholder">The Placeholder struct value.</param>
1598 /// <returns> A PropertyMap for Placeholder property. </returns>
1600 [EditorBrowsable(EditorBrowsableState.Never)]
1601 public static PropertyMap GetPlaceholderMap(Placeholder placeholder)
1603 var map = new PropertyMap();
1605 if (placeholder.Text != null)
1606 map.Add("text", new PropertyValue(placeholder.Text));
1608 if (placeholder.TextFocused != null)
1609 map.Add("textFocused", new PropertyValue(placeholder.TextFocused));
1611 if (placeholder.Color != null)
1612 map.Add("color", new PropertyValue(placeholder.Color));
1614 if (placeholder.FontFamily != null)
1615 map.Add("fontFamily", new PropertyValue(placeholder.FontFamily));
1617 if (placeholder.FontStyle != null)
1618 map.Add("fontStyle", new PropertyValue(GetFontStyleMap((FontStyle)placeholder.FontStyle)));
1620 if (placeholder.PointSize != null && placeholder.PixelSize != null)
1621 map.Add("pointSize", new PropertyValue((float)placeholder.PointSize));
1623 else if (placeholder.PointSize != null)
1624 map.Add("pointSize", new PropertyValue((float)placeholder.PointSize));
1626 else if (placeholder.PixelSize != null)
1627 map.Add("pixelSize", new PropertyValue((float)placeholder.PixelSize));
1629 map.Add("ellipsis", new PropertyValue(placeholder.Ellipsis));
1635 /// This method converts a Placeholder map to a struct and returns it.
1636 /// The returned struct can be returned to the user as a Placeholder in the GetPlaceholder method.
1637 /// <param name="map">The Placeholder PropertyMap.</param>
1638 /// <returns> A Placeholder struct. </returns>
1640 [EditorBrowsable(EditorBrowsableState.Never)]
1641 public static Placeholder GetPlaceholderStruct(PropertyMap map)
1644 string textFocused = "";
1645 Color color = new Color();
1646 string fontFamily = null;
1647 var fontStyle = new PropertyMap();
1648 PropertyValue pointSizeValue = null;
1649 PropertyValue pixelSizeValue = null;
1650 bool ellipsis = false;
1652 map.Find(0)?.Get(out text);
1653 map.Find(1)?.Get(out textFocused);
1654 map.Find(2)?.Get(color);
1655 map.Find(3)?.Get(out fontFamily);
1656 map.Find(4)?.Get(fontStyle);
1657 pointSizeValue = map.Find(5);
1658 pixelSizeValue = map.Find(6);
1659 map.Find(7)?.Get(out ellipsis);
1661 var placeholder = new Placeholder();
1662 placeholder.Text = text;
1663 placeholder.TextFocused = textFocused;
1664 placeholder.Color = color;
1665 placeholder.FontFamily = fontFamily;
1666 placeholder.Ellipsis = ellipsis;
1667 placeholder.FontStyle = GetFontStyleStruct(fontStyle);
1669 if (pointSizeValue != null)
1671 pointSizeValue.Get(out float pointSize);
1672 placeholder.PointSize = pointSize;
1675 if (pixelSizeValue != null)
1677 pixelSizeValue.Get(out float pixelSize);
1678 placeholder.PixelSize = pixelSize;
1685 /// This method converts a HiddenInput struct to a PropertyMap and returns it.
1686 /// The returned map can be used for set HiddenInputSettings PropertyMap in the SetHiddenInput method.
1687 /// <param name="hiddenInput">The HiddenInput struct value.</param>
1688 /// <returns> A PropertyMap for HiddenInput property. </returns>
1690 [EditorBrowsable(EditorBrowsableState.Never)]
1691 public static PropertyMap GetHiddenInputMap(HiddenInput hiddenInput)
1693 var map = new PropertyMap();
1695 map.Add(0, new PropertyValue((int)hiddenInput.Mode));
1697 if (hiddenInput.SubstituteCharacter != null)
1698 map.Add(1, new PropertyValue(Convert.ToInt32(hiddenInput.SubstituteCharacter)));
1700 if (hiddenInput.SubstituteCount != null)
1701 map.Add(2, new PropertyValue((int)hiddenInput.SubstituteCount));
1703 if (hiddenInput.ShowLastCharacterDuration != null)
1704 map.Add(3, new PropertyValue((int)hiddenInput.ShowLastCharacterDuration));
1710 /// This method converts a HiddenInputSettings map to a struct and returns it.
1711 /// The returned struct can be returned to the user as a HiddenInput in the GetHiddenInput method.
1712 /// <param name="map">The HiddenInput PropertyMap.</param>
1713 /// <returns> A HiddenInput struct. </returns>
1715 [EditorBrowsable(EditorBrowsableState.Never)]
1716 public static HiddenInput GetHiddenInputStruct(PropertyMap map)
1718 PropertyValue value = null;
1720 var hiddenInput = new HiddenInput();
1722 value = map.Find(0);
1725 value.Get(out int mode);
1726 hiddenInput.Mode = (HiddenInputModeType)mode;
1729 value = map.Find(1);
1732 value.Get(out int substituteCharacter);
1733 hiddenInput.SubstituteCharacter = Convert.ToChar(substituteCharacter);
1736 value = map.Find(2);
1739 value.Get(out int substituteCount);
1740 hiddenInput.SubstituteCount = substituteCount;
1743 value = map.Find(3);
1746 value.Get(out int showLastCharacterDuration);
1747 hiddenInput.ShowLastCharacterDuration = showLastCharacterDuration;
1754 /// This method converts a fileName string to a PropertyMap and returns it.
1755 /// The returned map can be used for set SelectionHandleImageLeft, SelectionHandleImageRight PropertyMap in the SetSelectionHandleImage method.
1756 /// <param name="fileName">The file path string value for SelectionHandleImage.</param>
1757 /// <returns> A PropertyMap for SelectionHandleImageLeft, SelectionHandleImageRight properties. </returns>
1759 [EditorBrowsable(EditorBrowsableState.Never)]
1760 public static PropertyMap GetFileNameMap(string fileName)
1762 return new PropertyMap().Add("filename", new PropertyValue(fileName));
1766 /// This method converts a SelectionHandleImageLeft, SelectionHandleImageRight map to a struct and returns it.
1767 /// The returned struct can be returned to the user as a SelectionHandleImage in the GetSelectionHandleImage method.
1768 /// <param name="leftImageMap">The SelectionHandleImageLeft PropertyMap.</param>
1769 /// <param name="rightImageMap">The SelectionHandleImageRight PropertyMap.</param>
1770 /// <returns> A SelectionHandleImage struct. </returns>
1772 [EditorBrowsable(EditorBrowsableState.Never)]
1773 public static SelectionHandleImage GetSelectionHandleImageStruct(PropertyMap leftImageMap, PropertyMap rightImageMap)
1775 string leftImageUrl = null;
1776 string rightImageUrl = null;
1778 var selectionHandleImage = new SelectionHandleImage();
1780 leftImageMap.Find(0, "filename")?.Get(out leftImageUrl);
1781 rightImageMap.Find(0, "filename")?.Get(out rightImageUrl);
1783 selectionHandleImage.LeftImageUrl = leftImageUrl;
1784 selectionHandleImage.RightImageUrl = rightImageUrl;
1786 return selectionHandleImage;
1790 /// Copy the previously selected text into the clipboard and return the copied value.
1792 /// <param name="textView">The textEditor/textField control from which the text is copied.</param>
1793 /// <returns>The copied text.</returns>
1794 /// <since_tizen> 9 </since_tizen>
1795 public static string CopyToClipboard(View textView)
1797 string copiedText ="";
1798 Type textViewType = textView.GetType();
1800 if(textViewType.Equals(typeof(TextEditor))){
1801 copiedText = Interop.TextEditor.CopyText(textView.SwigCPtr);
1802 }else if(textViewType.Equals(typeof(TextField))){
1803 copiedText = Interop.TextField.CopyText(textView.SwigCPtr);
1806 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1811 /// Cut the previously selected text from the text control and into the clipboard and return the cut value.
1813 /// <param name="textView">The textEditor/textField control from which the text is cut.</param>
1814 /// <returns>The cut text.</returns>
1815 /// <since_tizen> 9 </since_tizen>
1816 public static string CutToClipboard(View textView)
1818 string cutText = "";
1819 Type textViewType = textView.GetType();
1821 if(textViewType.Equals(typeof(TextEditor))){
1822 cutText = Interop.TextEditor.CutText(textView.SwigCPtr);
1823 }else if(textViewType.Equals(typeof(TextField))){
1824 cutText = Interop.TextField.CutText(textView.SwigCPtr);
1827 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1832 /// Paste the most recently copied/cut text from the clipboard and into the text control.
1834 /// <param name="textView">The textEditor/textField control into which the text is pasted.</param>
1835 /// <since_tizen> 9 </since_tizen>
1836 public static void PasteTo(View textView)
1838 Type textViewType = textView.GetType();
1840 if(textViewType.Equals(typeof(TextEditor))){
1841 Interop.TextEditor.PasteText(textView.SwigCPtr);
1842 }else if(textViewType.Equals(typeof(TextField))){
1843 Interop.TextField.PasteText(textView.SwigCPtr);
1846 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();