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)
40 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
42 Interop.RendererParameters.DeleteRendererParameters(swigCPtr);
46 /// Construct RendererParameters
48 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
49 [EditorBrowsable(EditorBrowsableState.Never)]
50 public RendererParameters() : this(Interop.RendererParameters.NewRendererParameters(), true)
52 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
56 /// The text to be rendered
58 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
59 [EditorBrowsable(EditorBrowsableState.Never)]
64 Interop.RendererParameters.TextSet(SwigCPtr, value);
65 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
69 string ret = Interop.RendererParameters.TextGet(SwigCPtr);
70 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
76 /// The horizontal alignment: one of HorizontalAlignment.
78 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
79 [EditorBrowsable(EditorBrowsableState.Never)]
80 public HorizontalAlignment HorizontalAlignment
84 string alignment = "begin";
87 case HorizontalAlignment.Begin:
92 case HorizontalAlignment.Center:
97 case HorizontalAlignment.End:
107 Interop.RendererParameters.HorizontalAlignmentSet(SwigCPtr, alignment);
108 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
112 string ret = Interop.RendererParameters.HorizontalAlignmentGet(SwigCPtr);
113 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
114 HorizontalAlignment alignment = HorizontalAlignment.Begin;
119 alignment = HorizontalAlignment.Begin;
124 alignment = HorizontalAlignment.Center;
129 alignment = HorizontalAlignment.End;
142 /// The vertical alignment: one of VerticalAlignment.
144 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
145 [EditorBrowsable(EditorBrowsableState.Never)]
146 public VerticalAlignment VerticalAlignment
150 string alignment = "top";
153 case VerticalAlignment.Top:
158 case VerticalAlignment.Center:
160 alignment = "center";
163 case VerticalAlignment.Bottom:
165 alignment = "bottom";
173 Interop.RendererParameters.VerticalAlignmentSet(SwigCPtr, alignment);
174 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
178 string ret = Interop.RendererParameters.VerticalAlignmentGet(SwigCPtr);
179 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
180 VerticalAlignment alignment = VerticalAlignment.Top;
185 alignment = VerticalAlignment.Top;
190 alignment = VerticalAlignment.Center;
195 alignment = VerticalAlignment.Bottom;
208 /// The font's family.
210 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
211 [EditorBrowsable(EditorBrowsableState.Never)]
212 public string FontFamily
216 Interop.RendererParameters.FontFamilySet(SwigCPtr, value);
217 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
221 string ret = Interop.RendererParameters.FontFamilyGet(SwigCPtr);
222 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
228 /// The font's weight: one of {"thin", "ultraLight", "extraLight", "light", "demiLight", "semiLight", "book", "normal", "regular", "medium", "demiBold", "semiBold", "bold", "ultraBold", "extraBold", "black", "heavy", "extraBlack"}.
230 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
231 [EditorBrowsable(EditorBrowsableState.Never)]
232 public string FontWeight
236 Interop.RendererParameters.FontWeightSet(SwigCPtr, value);
237 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
241 string ret = Interop.RendererParameters.FontWeightGet(SwigCPtr);
242 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
248 /// The font's width: one of {"ultraCondensed", "extraCondensed", "condensed", "semiCondensed", "normal", "semiExpanded", "expanded", "extraExpanded", "ultraExpanded"}.
250 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
251 [EditorBrowsable(EditorBrowsableState.Never)]
252 public string FontWidth
256 Interop.RendererParameters.FontWidthSet(SwigCPtr, value);
257 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
261 string ret = Interop.RendererParameters.FontWidthGet(SwigCPtr);
262 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
268 /// The font's slant. one of {"normal", "roman", "italic", "oblique"}
270 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
271 [EditorBrowsable(EditorBrowsableState.Never)]
272 public string FontSlant
276 Interop.RendererParameters.FontSlantSet(SwigCPtr, value);
277 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
281 string ret = Interop.RendererParameters.FontSlantGet(SwigCPtr);
282 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
288 /// The type of layout: one of TextLayout {"singleLine", "multiLine", "circular"}
290 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
291 [EditorBrowsable(EditorBrowsableState.Never)]
292 public TextLayout Layout
296 string textLayout = "singleLine";
299 case TextLayout.SingleLine:
301 textLayout = "singleLine";
304 case TextLayout.MultiLine:
306 textLayout = "multiLine";
309 case TextLayout.Circular:
311 textLayout = "circular";
319 Interop.RendererParameters.LayoutSet(SwigCPtr, textLayout);
320 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
324 string ret = Interop.RendererParameters.LayoutGet(SwigCPtr);
325 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
326 TextLayout textLayout = TextLayout.SingleLine;
331 textLayout = TextLayout.SingleLine;
336 textLayout = TextLayout.MultiLine;
341 textLayout = TextLayout.Circular;
354 /// 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.
356 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
357 [EditorBrowsable(EditorBrowsableState.Never)]
358 public CircularAlignment CircularAlignment
362 string alignment = "begin";
365 case CircularAlignment.Begin:
370 case CircularAlignment.Center:
372 alignment = "center";
375 case CircularAlignment.End:
385 Interop.RendererParameters.CircularAlignmentSet(SwigCPtr, alignment);
386 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
390 string ret = Interop.RendererParameters.CircularAlignmentGet(SwigCPtr);
391 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
392 CircularAlignment alignment = CircularAlignment.Begin;
397 alignment = CircularAlignment.Begin;
402 alignment = CircularAlignment.Center;
407 alignment = CircularAlignment.End;
420 /// The default text's color. Default is white.
422 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
423 [EditorBrowsable(EditorBrowsableState.Never)]
424 public Vector4 TextColor
428 Interop.RendererParameters.TextColorSet(SwigCPtr, Vector4.getCPtr(value));
429 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
433 Vector4 ret = new Vector4(Interop.RendererParameters.TextColorGet(SwigCPtr), true);
434 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
440 /// The font's size (in points).
442 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
443 [EditorBrowsable(EditorBrowsableState.Never)]
444 public float FontSize
448 Interop.RendererParameters.FontSizeSet(SwigCPtr, value);
449 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
453 float ret = Interop.RendererParameters.FontSizeGet(SwigCPtr);
454 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
460 /// The width in pixels of the boundaries where the text is going to be laid-out.
462 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
463 [EditorBrowsable(EditorBrowsableState.Never)]
464 public uint TextWidth
468 Interop.RendererParameters.TextWidthSet(SwigCPtr, value);
469 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
473 uint ret = Interop.RendererParameters.TextWidthGet(SwigCPtr);
474 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
480 /// The height in pixels of the boundaries where the text is going to be laid-out.
482 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
483 [EditorBrowsable(EditorBrowsableState.Never)]
484 public uint TextHeight
488 Interop.RendererParameters.TextHeightSet(SwigCPtr, value);
489 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
493 uint ret = Interop.RendererParameters.TextHeightGet(SwigCPtr);
494 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
500 /// The radius in pixels of the circular text.
502 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
503 [EditorBrowsable(EditorBrowsableState.Never)]
508 Interop.RendererParameters.RadiusSet(SwigCPtr, value);
509 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
513 uint ret = Interop.RendererParameters.RadiusGet(SwigCPtr);
514 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
520 /// 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°.
522 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
523 [EditorBrowsable(EditorBrowsableState.Never)]
524 public float BeginAngle
528 Interop.RendererParameters.BeginAngleSet(SwigCPtr, value);
529 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
533 float ret = Interop.RendererParameters.BeginAngleGet(SwigCPtr);
534 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
540 /// 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.
542 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
543 [EditorBrowsable(EditorBrowsableState.Never)]
544 public float IncrementAngle
548 Interop.RendererParameters.IncrementAngleSet(SwigCPtr, value);
549 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
553 float ret = Interop.RendererParameters.IncrementAngleGet(SwigCPtr);
554 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
560 /// Whether the ellipsis layout option is enabled.
562 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
563 [EditorBrowsable(EditorBrowsableState.Never)]
564 public bool EllipsisEnabled
568 Interop.RendererParameters.EllipsisEnabledSet(SwigCPtr, value);
569 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
573 bool ret = Interop.RendererParameters.EllipsisEnabledGet(SwigCPtr);
574 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
580 /// Whether the mark-up processor is enabled.
582 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
583 [EditorBrowsable(EditorBrowsableState.Never)]
584 public bool MarkupEnabled
588 Interop.RendererParameters.MarkupEnabledSet(SwigCPtr, value);
589 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
593 bool ret = Interop.RendererParameters.MarkupEnabledGet(SwigCPtr);
594 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
600 /// Whether a default color has been set.
602 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
603 [EditorBrowsable(EditorBrowsableState.Never)]
604 public bool IsTextColorSet
608 Interop.RendererParameters.IsTextColorSetSet(SwigCPtr, value);
609 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
613 bool ret = Interop.RendererParameters.IsTextColorSetGet(SwigCPtr);
614 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
620 /// Minimum size of line.
622 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
623 [EditorBrowsable(EditorBrowsableState.Never)]
624 public float MinLineSize
628 Interop.RendererParameters.MinLineSizeSet(SwigCPtr, value);
629 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
633 float ret = Interop.RendererParameters.MinLineSizeGet(SwigCPtr);
634 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
640 /// Padding of TextLabel.
642 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
643 [EditorBrowsable(EditorBrowsableState.Never)]
644 public Extents Padding
648 Interop.RendererParameters.PaddingSet(SwigCPtr, Extents.getCPtr(value));
649 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
653 Extents ret = new Extents(Interop.RendererParameters.PaddingGet(SwigCPtr), true);
654 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
662 /// Class with info of the embedded items layout.
664 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
665 [EditorBrowsable(EditorBrowsableState.Never)]
666 public class EmbeddedItemInfo : Disposable
669 internal EmbeddedItemInfo(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
676 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
678 Interop.EmbeddedItemInfo.DeleteEmbeddedItemInfo(swigCPtr);
682 /// Construct EmbeddedItemInfo
684 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
685 [EditorBrowsable(EditorBrowsableState.Never)]
686 public EmbeddedItemInfo() : this(Interop.EmbeddedItemInfo.NewEmbeddedItemInfo(), true)
688 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
692 /// Index to the character within the string.
694 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
695 [EditorBrowsable(EditorBrowsableState.Never)]
696 public uint CharacterIndex
700 Interop.EmbeddedItemInfo.CharacterIndexSet(SwigCPtr, value);
701 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
705 uint ret = Interop.EmbeddedItemInfo.CharacterIndexGet(SwigCPtr);
706 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
712 /// Index to the glyph
714 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
715 [EditorBrowsable(EditorBrowsableState.Never)]
716 public uint GlyphIndex
720 Interop.EmbeddedItemInfo.GlyphIndexSet(SwigCPtr, value);
721 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
725 uint ret = Interop.EmbeddedItemInfo.GlyphIndexGet(SwigCPtr);
726 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
732 /// The layout position within the buffer (top, left corner).
734 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
735 [EditorBrowsable(EditorBrowsableState.Never)]
736 public Vector2 Position
740 Interop.EmbeddedItemInfo.PositionSet(SwigCPtr, Vector2.getCPtr(value));
741 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
745 Vector2 ret = new Vector2(Interop.EmbeddedItemInfo.PositionGet(SwigCPtr), SwigCMemOwn);
746 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
752 /// The size within the buffer of the embedded item.
754 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
755 [EditorBrowsable(EditorBrowsableState.Never)]
760 Interop.EmbeddedItemInfo.SizeSet(SwigCPtr, Size.getCPtr(value));
761 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
765 Size ret = new Size(Interop.EmbeddedItemInfo.SizeGet(SwigCPtr), SwigCMemOwn);
766 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
772 /// The rotated size within the buffer of the embedded item.
774 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
775 [EditorBrowsable(EditorBrowsableState.Never)]
776 public Size RotatedSize
780 Interop.EmbeddedItemInfo.RotatedSizeSet(SwigCPtr, Size.getCPtr(value));
781 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
785 Size ret = new Size(Interop.EmbeddedItemInfo.RotatedSizeGet(SwigCPtr), SwigCMemOwn);
786 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
792 /// Rotation angle of the pixel buffer in degrees.
794 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
795 [EditorBrowsable(EditorBrowsableState.Never)]
800 Interop.EmbeddedItemInfo.AngleSet(SwigCPtr, Degree.getCPtr(value));
801 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
805 Degree ret = new Degree(Interop.EmbeddedItemInfo.AngleGet(SwigCPtr), SwigCMemOwn);
806 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
812 /// Whether the color of the image is multiplied by the color of the text.
814 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
815 [EditorBrowsable(EditorBrowsableState.Never)]
816 public Tizen.NUI.ColorBlendingMode ColorBlendingMode
820 Interop.EmbeddedItemInfo.ColorBlendingModeSet(SwigCPtr, value);
821 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
825 Tizen.NUI.ColorBlendingMode ret = Interop.EmbeddedItemInfo.ColorBlendingModeGet(SwigCPtr);
826 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
833 /// Class with the parameters needed to build a shadow for the given pixel buffer.
835 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
836 [EditorBrowsable(EditorBrowsableState.Never)]
837 public class ShadowParameters : Disposable
840 internal ShadowParameters(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
847 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
849 Interop.ShadowParameters.DeleteShadowParameters(swigCPtr);
853 /// Construct ShadowParameters
855 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
856 [EditorBrowsable(EditorBrowsableState.Never)]
857 public ShadowParameters() : this(Interop.ShadowParameters.NewShadowParameters(), true)
859 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
863 /// The input pixel buffer used to create the shadow.
865 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
866 [EditorBrowsable(EditorBrowsableState.Never)]
867 public PixelBuffer Input
871 Interop.ShadowParameters.InputSet(SwigCPtr, PixelBuffer.getCPtr(value));
872 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
876 PixelBuffer ret = new PixelBuffer(Interop.ShadowParameters.InputGet(SwigCPtr), true);
877 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
883 /// The color of the text.
885 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
886 [EditorBrowsable(EditorBrowsableState.Never)]
887 public Vector4 TextColor
891 Interop.ShadowParameters.TextColorSet(SwigCPtr, Vector4.getCPtr(value));
892 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
896 Vector4 ret = new Vector4(Interop.ShadowParameters.TextColorGet(SwigCPtr), true);
897 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
903 /// The color of the shadow.
905 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
906 [EditorBrowsable(EditorBrowsableState.Never)]
911 Interop.ShadowParameters.ColorSet(SwigCPtr, Vector4.getCPtr(value));
912 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
916 Vector4 ret = new Vector4(Interop.ShadowParameters.ColorGet(SwigCPtr), true);
917 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
923 /// The offset of the shadow.
925 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
926 [EditorBrowsable(EditorBrowsableState.Never)]
927 public Vector2 Offset
931 Interop.ShadowParameters.OffsetSet(SwigCPtr, Vector2.getCPtr(value));
932 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
936 Vector2 ret = new Vector2(Interop.ShadowParameters.OffsetGet(SwigCPtr), true);
937 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
943 /// Whether to blend the shadow.
945 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
946 [EditorBrowsable(EditorBrowsableState.Never)]
947 public bool blendShadow
951 Interop.ShadowParameters.BlendShadowSet(SwigCPtr, value);
952 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
956 bool ret = Interop.ShadowParameters.BlendShadowGet(SwigCPtr);
957 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
965 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
966 [EditorBrowsable(EditorBrowsableState.Never)]
967 public static partial class TextUtils
970 /// Renders text into a pixel buffer.
971 /// @note: Can process a mark-up string.
972 /// @note: It does the font selection, RTL reordering, shaping and layouting.
973 /// @note: The width of the pixel buffer may be different to the given @e textWidth
974 /// due to some padding pixels added.
976 /// The text is laid-out for the given size @e (textWidth,textHeight).
977 /// If the @e multiLineEnabled option is enabled, the text will wrap in lines.
978 /// If the @e ellipsisEnabled option is enabled, the text will be ellided if
979 /// there is no more space for new lines.
981 /// It won't be rendered the parts of the text exceeding the boundaries of
982 /// the given width and height.
984 /// If the given @e textHeight is zero, a big enough pixel buffer will be created
985 /// to render the full text.
987 /// If the given @e textWidth is zero, the 'natural size' of the text will be
988 /// used to create the pixel buffer to render the full text.
990 /// If the radius is not zero, the text will be laid-out following a circular path.
991 /// In that case the text is laid-out in a single line.
993 /// If the mark-up string contains embedded items, the @p embeddedItemLayout vector
994 /// contains the layout info of each embedded item.
996 /// <param name="textParameters">The text and style options.</param>
997 /// <param name="embeddedItemLayout">The layout info of the embedded items</param>
998 /// <returns>A pixel buffer with the text rendered on it.</returns>
999 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
1000 [EditorBrowsable(EditorBrowsableState.Never)]
1001 public static PixelBuffer Render(RendererParameters textParameters, ref EmbeddedItemInfo[] embeddedItemLayout)
1005 global::System.IntPtr returnItem = IntPtr.Zero;
1006 PixelBuffer ret = new PixelBuffer(Interop.TextUtils.Render(RendererParameters.getCPtr(textParameters), ref returnItem, ref count, ref length), true);
1008 embeddedItemLayout = new EmbeddedItemInfo[count];
1009 for (int i = 0; i < count; i++)
1011 IntPtr p = new IntPtr((returnItem.ToInt32() + i * length));
1012 embeddedItemLayout[i] = new EmbeddedItemInfo(p, false);
1014 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1019 /// Creates a shadow for the text given in the input pixel buffer.
1020 /// The function returns a RGBA8888 pixel buffer with the text and its shadow rendered on it.
1022 /// The pixel format of the @e input pixel buffer could be an A8 or an RGBA8888. If it's
1023 /// an A8 pixel buffer, it uses the given @e textColor to give color to the text. Otherwise
1024 /// it uses the color of the @e input pixel buffer.
1026 /// <param name="shadowParameters">The parameters needed to create the text's shadow.</param>
1027 /// <returns>A pixel buffer with the text and the shadow rendered on it.</returns>
1028 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
1029 [EditorBrowsable(EditorBrowsableState.Never)]
1030 public static PixelBuffer CreateShadow(ShadowParameters shadowParameters)
1032 PixelBuffer ret = new PixelBuffer(Interop.TextUtils.CreateShadow(ShadowParameters.getCPtr(shadowParameters)), true);
1033 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1038 /// Converts a @p pixelBuffer with pixel format A8 to RGBA8888 using the given @p color.
1039 /// @note Does nothing if the @p pixelBuffer is not A8.
1041 /// <param name="pixelBuffer">The pixel buffer with pixel format A8</param>
1042 /// <param name="color">The color used to convert to RGBA8888</param>
1043 /// <param name="multiplyByAlpha">multiplyByAlpha Whether to multiply the @p color with the alpha value of the @p pixel @p buffer.</param>
1044 /// <returns>The pixel buffer converted to RGBA8888.</returns>
1045 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
1046 [EditorBrowsable(EditorBrowsableState.Never)]
1047 public static PixelBuffer ConvertToRgba8888(PixelBuffer pixelBuffer, Vector4 color, bool multiplyByAlpha)
1049 PixelBuffer ret = new PixelBuffer(Interop.TextUtils.ConvertToRgba8888(PixelBuffer.getCPtr(pixelBuffer), Vector4.getCPtr(color), multiplyByAlpha), true);
1050 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1055 /// Updates the @p dst pixel buffer with the data from @p src pixel buffer.
1056 /// @note Both pixel buffers must have the same pixel format. Does nothing if both pixel format are different.
1057 /// @note The function does nothing if the @p src pixel buffer doesn't fit into the @p dst pixel buffer.
1059 /// The @p src pixel buffer could be blended with the @p dst pixel buffer if @p blend is set to @e true.
1061 /// <param name="src">The pixel buffer from where the data is read.</param>
1062 /// <param name="dst">The pixel buffer where the data is written.</param>
1063 /// <param name="x">The top left corner's X within the destination pixel buffer.</param>
1064 /// <param name="y">The top left corner's y within the destination pixel buffer.</param>
1065 /// <param name="blend">Whether to blend the source pixel buffer with the destination pixel buffer as background.</param>
1066 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
1067 [EditorBrowsable(EditorBrowsableState.Never)]
1068 public static void UpdateBuffer(PixelBuffer src, PixelBuffer dst, uint x, uint y, bool blend)
1070 Interop.TextUtils.UpdateBuffer(PixelBuffer.getCPtr(src), PixelBuffer.getCPtr(dst), x, y, blend);
1071 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1075 /// Splits the text in pages of the size given in @p textParameters
1076 /// @note The returned indices are indices to utf32 characters. The input text is encoded in utf8.
1077 /// <returns> An array with the indices of the last character of each page </returns>
1079 [EditorBrowsable(EditorBrowsableState.Never)]
1080 public static Tizen.NUI.PropertyArray GetLastCharacterIndex(RendererParameters textParameters)
1082 Tizen.NUI.PropertyArray ret = new Tizen.NUI.PropertyArray(Interop.TextUtils.GetLastCharacterIndex(RendererParameters.getCPtr(textParameters)), true);
1083 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1088 private const float FontSizeScaleSmall = 0.8f;
1089 private const float FontSizeScaleNormal = 1.0f;
1090 private const float FontSizeScaleLarge = 1.5f;
1091 private const float FontSizeScaleHuge = 1.9f;
1092 private const float FontSizeScaleGiant = 2.5f;
1093 #elif PROFILE_WEARABLE
1094 // The following values from 'system-settings/libutil/sstu.c'
1095 private const float FontSizeScaleSmall = 0.9f;
1096 private const float FontSizeScaleNormal = 1.0f;
1097 private const float FontSizeScaleLarge = 1.1f;
1098 private const float FontSizeScaleHuge = 1.9f;
1099 private const float FontSizeScaleGiant = 2.5f;
1100 #else // PROFILE_MOBILE and etc
1101 // The following values from 'system-settings/libutil/sstu.c'
1102 private const float FontSizeScaleSmall = 0.8f;
1103 private const float FontSizeScaleNormal = 1.0f;
1104 private const float FontSizeScaleLarge = 1.5f;
1105 private const float FontSizeScaleHuge = 1.9f;
1106 private const float FontSizeScaleGiant = 2.5f;
1110 /// It returns a float value according to SystemSettingsFontSize.
1111 /// The returned value can be used for FontSizeScale property.
1112 /// <param name="systemSettingsFontSize">The SystemSettingsFontSize enum value.</param>
1113 /// <returns> A float value for FontSizeScale property. </returns>
1115 [EditorBrowsable(EditorBrowsableState.Never)]
1116 public static float GetFontSizeScale(SystemSettingsFontSize systemSettingsFontSize)
1118 float ret = FontSizeScaleNormal;
1120 switch (systemSettingsFontSize)
1122 case SystemSettingsFontSize.Small:
1123 ret = FontSizeScaleSmall;
1125 case SystemSettingsFontSize.Normal:
1126 ret = FontSizeScaleNormal;
1128 case SystemSettingsFontSize.Large:
1129 ret = FontSizeScaleLarge;
1131 case SystemSettingsFontSize.Huge:
1132 ret = FontSizeScaleHuge;
1134 case SystemSettingsFontSize.Giant:
1135 ret = FontSizeScaleGiant;
1143 /// It returns a string value according to FontWidthType.
1144 /// The returned value can be used for FontStyle PropertyMap.
1145 /// <param name="fontWidthType">The FontWidthType enum value.</param>
1146 /// <returns> A string value for FontStyle.Width property. </returns>
1148 [EditorBrowsable(EditorBrowsableState.Never)]
1149 public static string GetFontWidthString(FontWidthType fontWidthType)
1151 string value = fontWidthType.ToString();
1152 if (!string.IsNullOrEmpty(value))
1154 char[] charArray = value.ToCharArray();
1155 charArray[0] = Char.ToLower(charArray[0]);
1156 value = new string(charArray);
1160 value = "none"; // The default value.
1167 /// It returns a string value according to FontWeightType.
1168 /// The returned value can be used for FontStyle PropertyMap.
1169 /// <param name="fontWeightType">The FontWeightType enum value.</param>
1170 /// <returns> A string value for FontStyle.Weight property. </returns>
1172 [EditorBrowsable(EditorBrowsableState.Never)]
1173 public static string GetFontWeightString(FontWeightType fontWeightType)
1175 string value = fontWeightType.ToString();
1176 if (!string.IsNullOrEmpty(value))
1178 char[] charArray = value.ToCharArray();
1179 charArray[0] = Char.ToLower(charArray[0]);
1180 value = new string(charArray);
1184 value = "none"; // The default value.
1191 /// It returns a string value according to FontSlantType.
1192 /// The returned value can be used for FontStyle PropertyMap.
1193 /// <param name="fontSlantType">The FontSlantType enum value.</param>
1194 /// <returns> A string value for FontStyle.Slant property. </returns>
1196 [EditorBrowsable(EditorBrowsableState.Never)]
1197 public static string GetFontSlantString(FontSlantType fontSlantType)
1199 string value = fontSlantType.ToString();
1200 if (!string.IsNullOrEmpty(value))
1202 char[] charArray = value.ToCharArray();
1203 charArray[0] = Char.ToLower(charArray[0]);
1204 value = new string(charArray);
1208 value = "none"; // The default value.
1215 /// It returns a FontWidthType value according to fontWidthString.
1216 /// The returned value can be used for FontStyle PropertyMap.
1217 /// <param name="fontWidthString">The FontWidth string value.</param>
1218 /// <returns> A FontWidthType value for FontStyle.Width property. </returns>
1220 [EditorBrowsable(EditorBrowsableState.Never)]
1221 public static FontWidthType GetFontWidthType(string fontWidthString)
1223 FontWidthType value;
1225 if (!(Enum.TryParse(fontWidthString, true, out value) && Enum.IsDefined(typeof(FontWidthType), value)))
1227 value = FontWidthType.None; // If parsing fails, set a default value.
1234 /// It returns a FontWeightType value according to fontWeightString.
1235 /// The returned value can be used for FontStyle PropertyMap.
1236 /// <param name="fontWeightString">The FontWeight string value.</param>
1237 /// <returns> A FontWeightType value for FontStyle.Weight property. </returns>
1239 [EditorBrowsable(EditorBrowsableState.Never)]
1240 public static FontWeightType GetFontWeightType(string fontWeightString)
1242 FontWeightType value;
1244 if (!(Enum.TryParse(fontWeightString, true, out value) && Enum.IsDefined(typeof(FontWeightType), value)))
1246 value = FontWeightType.None; // If parsing fails, set a default value.
1253 /// It returns a FontSlantType value according to fontSlantString.
1254 /// The returned value can be used for FontStyle PropertyMap.
1255 /// <param name="fontSlantString">The FontSlant string value.</param>
1256 /// <returns> A FontSlantType value for FontStyle.Slant property. </returns>
1258 [EditorBrowsable(EditorBrowsableState.Never)]
1259 public static FontSlantType GetFontSlantType(string fontSlantString)
1261 FontSlantType value;
1263 if (!(Enum.TryParse(fontSlantString, true, out value) && Enum.IsDefined(typeof(FontSlantType), value)))
1265 value = FontSlantType.None; // If parsing fails, set a default value.
1272 /// This method converts a FontStyle struct to a PropertyMap and returns it.
1273 /// The returned map can be used for set FontStyle PropertyMap in the SetFontStyle method.
1274 /// <param name="fontStyle">The FontStyle struct value.</param>
1275 /// <returns> A PropertyMap for FontStyle property. </returns>
1277 [EditorBrowsable(EditorBrowsableState.Never)]
1278 public static PropertyMap GetFontStyleMap(FontStyle fontStyle)
1280 var map = new PropertyMap();
1281 var width = new PropertyValue(GetFontWidthString(fontStyle.Width));
1282 var weight = new PropertyValue(GetFontWeightString(fontStyle.Weight));
1283 var slant = new PropertyValue(GetFontSlantString(fontStyle.Slant));
1285 map.Add("width", width);
1286 map.Add("weight", weight);
1287 map.Add("slant", slant);
1293 /// This method converts a FontStyle map to a struct and returns it.
1294 /// The returned struct can be returned to the user as a FontStyle in the GetFontStyle method.
1295 /// <param name="map">The FontStyle PropertyMap.</param>
1296 /// <returns> A FontStyle struct. </returns>
1298 [EditorBrowsable(EditorBrowsableState.Never)]
1299 public static FontStyle GetFontStyleStruct(PropertyMap map)
1301 string width = "none";
1302 string weight = "none";
1303 string slant = "none";
1304 map.Find(0, "width")?.Get(out width);
1305 map.Find(0, "weight")?.Get(out weight);
1306 map.Find(0, "slant")?.Get(out slant);
1308 var fontStyle = new FontStyle();
1309 fontStyle.Width = GetFontWidthType(width);
1310 fontStyle.Weight = GetFontWeightType(weight);
1311 fontStyle.Slant = GetFontSlantType(slant);
1317 /// This method converts a InputFilter struct to a PropertyMap and returns it. <br />
1318 /// The returned map can be used for set InputFilter PropertyMap in the SetInputFilter method. <br />
1319 /// <param name="inputFilter">The InputFilter struct value.</param>
1320 /// <returns> A PropertyMap for InputFilter property. </returns>
1322 [EditorBrowsable(EditorBrowsableState.Never)]
1323 public static PropertyMap GetInputFilterMap(InputFilter inputFilter)
1325 var map = new PropertyMap();
1326 var accepted = inputFilter.Accepted != null ? new PropertyValue(inputFilter.Accepted) : new PropertyValue("");
1327 var rejected = inputFilter.Rejected != null ? new PropertyValue(inputFilter.Rejected) : new PropertyValue("");
1328 map.Add(0, accepted);
1329 map.Add(1, rejected);
1335 /// This method converts a InputFilter map to a struct and returns it. <br />
1336 /// The returned struct can be returned to the user as a InputFilter in the GetInputFilter method. <br />
1337 /// <param name="map">The InputFilter PropertyMap.</param>
1338 /// <returns> A InputFilter struct. </returns>
1340 [EditorBrowsable(EditorBrowsableState.Never)]
1341 public static InputFilter GetInputFilterStruct(PropertyMap map)
1343 string accepted = "";
1344 string rejected = "";
1345 map.Find(0)?.Get(out accepted);
1346 map.Find(1)?.Get(out rejected);
1348 var inputFilter = new InputFilter();
1349 inputFilter.Accepted = accepted;
1350 inputFilter.Rejected = rejected;
1357 /// This method converts a Underline struct to a PropertyMap and returns it.
1358 /// The returned map can be used for set Underline PropertyMap in the SetUnderline method.
1359 /// <param name="underline">The Underline struct value.</param>
1360 /// <returns> A PropertyMap for Underline property. </returns>
1362 [EditorBrowsable(EditorBrowsableState.Never)]
1363 public static PropertyMap GetUnderlineMap(Underline underline)
1365 var map = new PropertyMap();
1367 map.Add("enable", new PropertyValue(underline.Enable));
1369 if (underline.Color != null)
1370 map.Add("color", new PropertyValue(underline.Color));
1372 if (underline.Height != null)
1373 map.Add("height", new PropertyValue((float)underline.Height));
1379 /// This method converts a Underline map to a struct and returns it.
1380 /// The returned struct can be returned to the user as a Underline in the GetUnderline method.
1381 /// <param name="map">The Underline PropertyMap.</param>
1382 /// <returns> A Underline struct. </returns>
1384 [EditorBrowsable(EditorBrowsableState.Never)]
1385 public static Underline GetUnderlineStruct(PropertyMap map)
1387 Color color = new Color();
1388 map.Find(0, "enable").Get(out bool enable);
1389 map.Find(0, "color").Get(color);
1390 map.Find(0, "height").Get(out float height);
1392 var underline = new Underline();
1393 underline.Enable = enable;
1394 underline.Color = color;
1395 underline.Height = height;
1401 /// This method converts a Shadow struct to a PropertyMap and returns it.
1402 /// The returned map can be used for set Shadow PropertyMap in the SetShadow method.
1403 /// <param name="shadow">The Shadow struct value.</param>
1404 /// <returns> A PropertyMap for Shadow property. </returns>
1406 [EditorBrowsable(EditorBrowsableState.Never)]
1407 public static PropertyMap GetShadowMap(Tizen.NUI.Text.Shadow shadow)
1409 var map = new PropertyMap();
1411 if (shadow.Offset != null)
1412 map.Add("offset", new PropertyValue(shadow.Offset));
1414 if (shadow.Color != null)
1415 map.Add("color", new PropertyValue(shadow.Color));
1417 if (shadow.BlurRadius != null)
1418 map.Add("blurRadius", new PropertyValue((float)shadow.BlurRadius));
1424 /// This method converts a Shadow map to a struct and returns it.
1425 /// The returned struct can be returned to the user as a Shadow in the GetShadow method.
1426 /// <param name="map">The Shadow PropertyMap.</param>
1427 /// <returns> A Shadow struct. </returns>
1429 [EditorBrowsable(EditorBrowsableState.Never)]
1430 public static Tizen.NUI.Text.Shadow GetShadowStruct(PropertyMap map)
1432 Vector2 offset = new Vector2();
1433 Color color = new Color();
1434 map.Find(0, "offset").Get(offset);
1435 map.Find(0, "color").Get(color);
1436 map.Find(0, "blurRadius").Get(out float blurRadius);
1438 var shadow = new Tizen.NUI.Text.Shadow();
1439 shadow.Offset = offset;
1440 shadow.Color = color;
1441 shadow.BlurRadius = blurRadius;
1447 /// This method converts a Outline struct to a PropertyMap and returns it.
1448 /// The returned map can be used for set Outline PropertyMap in the SetOutline method.
1449 /// <param name="outline">The Outline struct value.</param>
1450 /// <returns> A PropertyMap for Outline property. </returns>
1452 [EditorBrowsable(EditorBrowsableState.Never)]
1453 public static PropertyMap GetOutlineMap(Outline outline)
1455 var map = new PropertyMap();
1457 if (outline.Color != null)
1458 map.Add("color", new PropertyValue(outline.Color));
1460 if (outline.Width != null)
1461 map.Add("width", new PropertyValue((float)outline.Width));
1467 /// This method converts a Outline map to a struct and returns it.
1468 /// The returned struct can be returned to the user as a Outline in the GetOutline method.
1469 /// <param name="map">The Outline PropertyMap.</param>
1470 /// <returns> A Outline struct. </returns>
1472 [EditorBrowsable(EditorBrowsableState.Never)]
1473 public static Outline GetOutlineStruct(PropertyMap map)
1475 Color color = new Color();
1476 map.Find(0, "color").Get(color);
1477 map.Find(0, "width").Get(out float width);
1479 var outline = new Outline();
1480 outline.Color = color;
1481 outline.Width = width;
1487 /// It returns a string value according to FontSizeType.
1488 /// The returned value can be used for TextFit PropertyMap.
1489 /// <param name="fontSizeType">The FontSizeType enum value.</param>
1490 /// <returns> A string value for TextFit.FontSizeType property. </returns>
1492 [EditorBrowsable(EditorBrowsableState.Never)]
1493 public static string GetFontSizeString(FontSizeType fontSizeType)
1495 string value = fontSizeType.ToString();
1496 if (!string.IsNullOrEmpty(value))
1498 char[] charArray = value.ToCharArray();
1499 charArray[0] = Char.ToLower(charArray[0]);
1500 value = new string(charArray);
1504 value = "pointSize"; // The default value.
1511 /// It returns a FontSizeType value according to fontSizeString.
1512 /// The returned value can be used for FontStyle PropertyMap.
1513 /// <param name="fontSizeString">The FontSizeType string value.</param>
1514 /// <returns> A FontSizeType value for TextFit.FontSizeType property. </returns>
1516 [EditorBrowsable(EditorBrowsableState.Never)]
1517 public static FontSizeType GetFontSizeType(string fontSizeString)
1521 if (!(Enum.TryParse(fontSizeString, true, out value) && Enum.IsDefined(typeof(FontSizeType), value)))
1523 value = FontSizeType.PointSize; // If parsing fails, set a default value.
1530 /// This method converts a TextFit struct to a PropertyMap and returns it.
1531 /// The returned map can be used for set TextFit PropertyMap in the SetTextFit method.
1532 /// <param name="textFit">The TextFit struct value.</param>
1533 /// <returns> A PropertyMap for TextFit property. </returns>
1535 [EditorBrowsable(EditorBrowsableState.Never)]
1536 public static PropertyMap GetTextFitMap(TextFit textFit)
1538 var map = new PropertyMap();
1539 map.Add("enable", new PropertyValue(textFit.Enable));
1540 map.Add("fontSizeType", new PropertyValue(GetFontSizeString(textFit.FontSizeType)));
1542 if (textFit.MinSize != null)
1543 map.Add("minSize", new PropertyValue((float)textFit.MinSize));
1545 if (textFit.MaxSize != null)
1546 map.Add("maxSize", new PropertyValue((float)textFit.MaxSize));
1548 if (textFit.StepSize != null)
1549 map.Add("stepSize", new PropertyValue((float)textFit.StepSize));
1555 /// This method converts a TextFit map to a struct and returns it.
1556 /// The returned struct can be returned to the user as a TextFit in the GetTextFit method.
1557 /// <param name="map">The TextFit PropertyMap.</param>
1558 /// <returns> A TextFit struct. </returns>
1560 [EditorBrowsable(EditorBrowsableState.Never)]
1561 public static TextFit GetTextFitStruct(PropertyMap map)
1563 map.Find(0, "enable").Get(out bool enable);
1564 map.Find(0, "minSize").Get(out float minSize);
1565 map.Find(0, "maxSize").Get(out float maxSize);
1566 map.Find(0, "stepSize").Get(out float stepSize);
1567 map.Find(0, "fontSizeType").Get(out string fontSizeType);
1569 var textFit = new TextFit();
1570 textFit.Enable = enable;
1571 textFit.MinSize = minSize;
1572 textFit.MaxSize = maxSize;
1573 textFit.StepSize = stepSize;
1574 textFit.FontSizeType = GetFontSizeType(fontSizeType);
1580 /// This method converts a Placeholder struct to a PropertyMap and returns it.
1581 /// The returned map can be used for set Placeholder PropertyMap in the SetPlaceholder method.
1582 /// <param name="placeholder">The Placeholder struct value.</param>
1583 /// <returns> A PropertyMap for Placeholder property. </returns>
1585 [EditorBrowsable(EditorBrowsableState.Never)]
1586 public static PropertyMap GetPlaceholderMap(Placeholder placeholder)
1588 var map = new PropertyMap();
1590 if (placeholder.Text != null)
1591 map.Add("text", new PropertyValue(placeholder.Text));
1593 if (placeholder.TextFocused != null)
1594 map.Add("textFocused", new PropertyValue(placeholder.TextFocused));
1596 if (placeholder.Color != null)
1597 map.Add("color", new PropertyValue(placeholder.Color));
1599 if (placeholder.FontFamily != null)
1600 map.Add("fontFamily", new PropertyValue(placeholder.FontFamily));
1602 if (placeholder.FontStyle != null)
1603 map.Add("fontStyle", new PropertyValue(GetFontStyleMap((FontStyle)placeholder.FontStyle)));
1605 if (placeholder.PointSize != null && placeholder.PixelSize != null)
1606 map.Add("pointSize", new PropertyValue((float)placeholder.PointSize));
1608 else if (placeholder.PointSize != null)
1609 map.Add("pointSize", new PropertyValue((float)placeholder.PointSize));
1611 else if (placeholder.PixelSize != null)
1612 map.Add("pixelSize", new PropertyValue((float)placeholder.PixelSize));
1614 map.Add("ellipsis", new PropertyValue(placeholder.Ellipsis));
1620 /// This method converts a Placeholder map to a struct and returns it.
1621 /// The returned struct can be returned to the user as a Placeholder in the GetPlaceholder method.
1622 /// <param name="map">The Placeholder PropertyMap.</param>
1623 /// <returns> A Placeholder struct. </returns>
1625 [EditorBrowsable(EditorBrowsableState.Never)]
1626 public static Placeholder GetPlaceholderStruct(PropertyMap map)
1629 string textFocused = "";
1630 Color color = new Color();
1631 string fontFamily = null;
1632 var fontStyle = new PropertyMap();
1633 PropertyValue pointSizeValue = null;
1634 PropertyValue pixelSizeValue = null;
1635 bool ellipsis = false;
1637 map.Find(0)?.Get(out text);
1638 map.Find(1)?.Get(out textFocused);
1639 map.Find(2)?.Get(color);
1640 map.Find(3)?.Get(out fontFamily);
1641 map.Find(4)?.Get(fontStyle);
1642 pointSizeValue = map.Find(5);
1643 pixelSizeValue = map.Find(6);
1644 map.Find(7)?.Get(out ellipsis);
1646 var placeholder = new Placeholder();
1647 placeholder.Text = text;
1648 placeholder.TextFocused = textFocused;
1649 placeholder.Color = color;
1650 placeholder.FontFamily = fontFamily;
1651 placeholder.Ellipsis = ellipsis;
1652 placeholder.FontStyle = GetFontStyleStruct(fontStyle);
1654 if (pointSizeValue != null)
1656 pointSizeValue.Get(out float pointSize);
1657 placeholder.PointSize = pointSize;
1660 if (pixelSizeValue != null)
1662 pixelSizeValue.Get(out float pixelSize);
1663 placeholder.PixelSize = pixelSize;
1670 /// This method converts a HiddenInput struct to a PropertyMap and returns it.
1671 /// The returned map can be used for set HiddenInputSettings PropertyMap in the SetHiddenInput method.
1672 /// <param name="hiddenInput">The HiddenInput struct value.</param>
1673 /// <returns> A PropertyMap for HiddenInput property. </returns>
1675 [EditorBrowsable(EditorBrowsableState.Never)]
1676 public static PropertyMap GetHiddenInputMap(HiddenInput hiddenInput)
1678 var map = new PropertyMap();
1680 map.Add(0, new PropertyValue((int)hiddenInput.Mode));
1682 if (hiddenInput.SubstituteCharacter != null)
1683 map.Add(1, new PropertyValue(Convert.ToInt32(hiddenInput.SubstituteCharacter)));
1685 if (hiddenInput.SubstituteCount != null)
1686 map.Add(2, new PropertyValue((int)hiddenInput.SubstituteCount));
1688 if (hiddenInput.ShowLastCharacterDuration != null)
1689 map.Add(3, new PropertyValue((int)hiddenInput.ShowLastCharacterDuration));
1695 /// This method converts a HiddenInputSettings map to a struct and returns it.
1696 /// The returned struct can be returned to the user as a HiddenInput in the GetHiddenInput method.
1697 /// <param name="map">The HiddenInput PropertyMap.</param>
1698 /// <returns> A HiddenInput struct. </returns>
1700 [EditorBrowsable(EditorBrowsableState.Never)]
1701 public static HiddenInput GetHiddenInputStruct(PropertyMap map)
1703 PropertyValue value = null;
1705 var hiddenInput = new HiddenInput();
1707 value = map.Find(0);
1710 value.Get(out int mode);
1711 hiddenInput.Mode = (HiddenInputModeType)mode;
1714 value = map.Find(1);
1717 value.Get(out int substituteCharacter);
1718 hiddenInput.SubstituteCharacter = Convert.ToChar(substituteCharacter);
1721 value = map.Find(2);
1724 value.Get(out int substituteCount);
1725 hiddenInput.SubstituteCount = substituteCount;
1728 value = map.Find(3);
1731 value.Get(out int showLastCharacterDuration);
1732 hiddenInput.ShowLastCharacterDuration = showLastCharacterDuration;
1739 /// This method converts a fileName string to a PropertyMap and returns it.
1740 /// The returned map can be used for set SelectionHandleImageLeft, SelectionHandleImageRight PropertyMap in the SetSelectionHandleImage method.
1741 /// <param name="fileName">The file path string value for SelectionHandleImage.</param>
1742 /// <returns> A PropertyMap for SelectionHandleImageLeft, SelectionHandleImageRight properties. </returns>
1744 [EditorBrowsable(EditorBrowsableState.Never)]
1745 public static PropertyMap GetFileNameMap(string fileName)
1747 return new PropertyMap().Add("filename", new PropertyValue(fileName));
1751 /// This method converts a SelectionHandleImageLeft, SelectionHandleImageRight map to a struct and returns it.
1752 /// The returned struct can be returned to the user as a SelectionHandleImage in the GetSelectionHandleImage method.
1753 /// <param name="leftImageMap">The SelectionHandleImageLeft PropertyMap.</param>
1754 /// <param name="rightImageMap">The SelectionHandleImageRight PropertyMap.</param>
1755 /// <returns> A SelectionHandleImage struct. </returns>
1757 [EditorBrowsable(EditorBrowsableState.Never)]
1758 public static SelectionHandleImage GetSelectionHandleImageStruct(PropertyMap leftImageMap, PropertyMap rightImageMap)
1760 string leftImageUrl = null;
1761 string rightImageUrl = null;
1763 var selectionHandleImage = new SelectionHandleImage();
1765 leftImageMap.Find(0, "filename")?.Get(out leftImageUrl);
1766 rightImageMap.Find(0, "filename")?.Get(out rightImageUrl);
1768 selectionHandleImage.LeftImageUrl = leftImageUrl;
1769 selectionHandleImage.RightImageUrl = rightImageUrl;
1771 return selectionHandleImage;
1775 /// Copy the previously selected text into the clipboard and return the copied value.
1777 /// <param name="textEditor">The textEditor control from which the text is copied.</param>
1778 /// <returns>The copied text.</returns>
1779 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
1780 [EditorBrowsable(EditorBrowsableState.Never)]
1781 public static string CopyToClipboard(TextEditor textEditor)
1783 string copiedText = Interop.TextEditor.CopyText(textEditor.SwigCPtr);
1784 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1789 /// Copy the previously selected text into the clipboard and return the copied value.
1791 /// <param name="textField">The textField control from which the text is copied.</param>
1792 /// <returns>The copied text.</returns>
1793 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
1794 [EditorBrowsable(EditorBrowsableState.Never)]
1795 public static string CopyToClipboard(TextField textField)
1797 string copiedText = Interop.TextField.CopyText(textField.SwigCPtr);
1798 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1803 /// Cut the previously selected text from the text control and into the clipboard and return the cut value.
1805 /// <param name="textEditor">The textEditor control from which the text is cut.</param>
1806 /// <returns>The cut text.</returns>
1807 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
1808 [EditorBrowsable(EditorBrowsableState.Never)]
1809 public static string CutToClipboard(TextEditor textEditor)
1811 string cutText = Interop.TextEditor.CutText(textEditor.SwigCPtr);
1812 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1817 /// Cut the previously selected text from the text control and into the clipboard and return the cut value.
1819 /// <param name="textField">The textField control from which the text is cut.</param>
1820 /// <returns>The cut text.</returns>
1821 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
1822 [EditorBrowsable(EditorBrowsableState.Never)]
1823 public static string CutToClipboard(TextField textField)
1825 string cutText = Interop.TextField.CutText(textField.SwigCPtr);
1826 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1831 /// Paste the most recently copied/cut text from the clipboard and into the text control.
1833 /// <param name="textEditor">The textEditor control into which the text is pasted.</param>
1834 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
1835 [EditorBrowsable(EditorBrowsableState.Never)]
1836 public static void PasteTo(TextEditor textEditor)
1838 Interop.TextEditor.PasteText(textEditor.SwigCPtr);
1839 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1843 /// Paste the most recently copied/cut text from the clipboard and into the text control.
1845 /// <param name="textField">The textField control into which the text is pasted.</param>
1846 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
1847 [EditorBrowsable(EditorBrowsableState.Never)]
1848 public static void PasteTo(TextField textField)
1850 Interop.TextField.PasteText(textField.SwigCPtr);
1851 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();