3 * Copyright(c) 2020 Samsung Electronics Co., Ltd.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
19 extern alias TizenSystemSettings;
20 using TizenSystemSettings.Tizen.System;
22 using System.ComponentModel;
23 using System.Collections.Generic;
26 namespace Tizen.NUI.BaseComponents
29 /// Class with the text and style parameters to be rendered into a pixel buffer.
31 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
32 [EditorBrowsable(EditorBrowsableState.Never)]
33 public class RendererParameters : Disposable
35 internal RendererParameters(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
42 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
44 Interop.RendererParameters.DeleteRendererParameters(swigCPtr);
48 /// Construct RendererParameters
50 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
51 [EditorBrowsable(EditorBrowsableState.Never)]
52 public RendererParameters() : this(Interop.RendererParameters.NewRendererParameters(), true)
54 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
58 /// The text to be rendered
60 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
61 [EditorBrowsable(EditorBrowsableState.Never)]
66 Interop.RendererParameters.TextSet(SwigCPtr, value);
67 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
71 string ret = Interop.RendererParameters.TextGet(SwigCPtr);
72 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
78 /// The horizontal alignment: one of HorizontalAlignment.
80 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
81 [EditorBrowsable(EditorBrowsableState.Never)]
82 public HorizontalAlignment HorizontalAlignment
86 string alignment = "begin";
89 case HorizontalAlignment.Begin:
94 case HorizontalAlignment.Center:
99 case HorizontalAlignment.End:
109 Interop.RendererParameters.HorizontalAlignmentSet(SwigCPtr, alignment);
110 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
114 string ret = Interop.RendererParameters.HorizontalAlignmentGet(SwigCPtr);
115 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
116 HorizontalAlignment alignment = HorizontalAlignment.Begin;
121 alignment = HorizontalAlignment.Begin;
126 alignment = HorizontalAlignment.Center;
131 alignment = HorizontalAlignment.End;
144 /// The vertical alignment: one of VerticalAlignment.
146 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
147 [EditorBrowsable(EditorBrowsableState.Never)]
148 public VerticalAlignment VerticalAlignment
152 string alignment = "top";
155 case VerticalAlignment.Top:
160 case VerticalAlignment.Center:
162 alignment = "center";
165 case VerticalAlignment.Bottom:
167 alignment = "bottom";
175 Interop.RendererParameters.VerticalAlignmentSet(SwigCPtr, alignment);
176 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
180 string ret = Interop.RendererParameters.VerticalAlignmentGet(SwigCPtr);
181 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
182 VerticalAlignment alignment = VerticalAlignment.Top;
187 alignment = VerticalAlignment.Top;
192 alignment = VerticalAlignment.Center;
197 alignment = VerticalAlignment.Bottom;
210 /// The font's family.
212 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
213 [EditorBrowsable(EditorBrowsableState.Never)]
214 public string FontFamily
218 Interop.RendererParameters.FontFamilySet(SwigCPtr, value);
219 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
223 string ret = Interop.RendererParameters.FontFamilyGet(SwigCPtr);
224 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
230 /// The font's weight: one of {"thin", "ultraLight", "extraLight", "light", "demiLight", "semiLight", "book", "normal", "regular", "medium", "demiBold", "semiBold", "bold", "ultraBold", "extraBold", "black", "heavy", "extraBlack"}.
232 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
233 [EditorBrowsable(EditorBrowsableState.Never)]
234 public string FontWeight
238 Interop.RendererParameters.FontWeightSet(SwigCPtr, value);
239 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
243 string ret = Interop.RendererParameters.FontWeightGet(SwigCPtr);
244 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
250 /// The font's width: one of {"ultraCondensed", "extraCondensed", "condensed", "semiCondensed", "normal", "semiExpanded", "expanded", "extraExpanded", "ultraExpanded"}.
252 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
253 [EditorBrowsable(EditorBrowsableState.Never)]
254 public string FontWidth
258 Interop.RendererParameters.FontWidthSet(SwigCPtr, value);
259 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
263 string ret = Interop.RendererParameters.FontWidthGet(SwigCPtr);
264 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
270 /// The font's slant. one of {"normal", "roman", "italic", "oblique"}
272 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
273 [EditorBrowsable(EditorBrowsableState.Never)]
274 public string FontSlant
278 Interop.RendererParameters.FontSlantSet(SwigCPtr, value);
279 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
283 string ret = Interop.RendererParameters.FontSlantGet(SwigCPtr);
284 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
290 /// The type of layout: one of TextLayout {"singleLine", "multiLine", "circular"}
292 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
293 [EditorBrowsable(EditorBrowsableState.Never)]
294 public TextLayout Layout
298 string textLayout = "singleLine";
301 case TextLayout.SingleLine:
303 textLayout = "singleLine";
306 case TextLayout.MultiLine:
308 textLayout = "multiLine";
311 case TextLayout.Circular:
313 textLayout = "circular";
321 Interop.RendererParameters.LayoutSet(SwigCPtr, textLayout);
322 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
326 string ret = Interop.RendererParameters.LayoutGet(SwigCPtr);
327 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
328 TextLayout textLayout = TextLayout.SingleLine;
333 textLayout = TextLayout.SingleLine;
338 textLayout = TextLayout.MultiLine;
343 textLayout = TextLayout.Circular;
356 /// 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.
358 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
359 [EditorBrowsable(EditorBrowsableState.Never)]
360 public CircularAlignment CircularAlignment
364 string alignment = "begin";
367 case CircularAlignment.Begin:
372 case CircularAlignment.Center:
374 alignment = "center";
377 case CircularAlignment.End:
387 Interop.RendererParameters.CircularAlignmentSet(SwigCPtr, alignment);
388 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
392 string ret = Interop.RendererParameters.CircularAlignmentGet(SwigCPtr);
393 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
394 CircularAlignment alignment = CircularAlignment.Begin;
399 alignment = CircularAlignment.Begin;
404 alignment = CircularAlignment.Center;
409 alignment = CircularAlignment.End;
422 /// The default text's color. Default is white.
424 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
425 [EditorBrowsable(EditorBrowsableState.Never)]
426 public Vector4 TextColor
430 Interop.RendererParameters.TextColorSet(SwigCPtr, Vector4.getCPtr(value));
431 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
435 Vector4 ret = new Vector4(Interop.RendererParameters.TextColorGet(SwigCPtr), true);
436 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
442 /// The font's size (in points).
444 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
445 [EditorBrowsable(EditorBrowsableState.Never)]
446 public float FontSize
450 Interop.RendererParameters.FontSizeSet(SwigCPtr, value);
451 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
455 float ret = Interop.RendererParameters.FontSizeGet(SwigCPtr);
456 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
462 /// The width in pixels of the boundaries where the text is going to be laid-out.
464 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
465 [EditorBrowsable(EditorBrowsableState.Never)]
466 public uint TextWidth
470 Interop.RendererParameters.TextWidthSet(SwigCPtr, value);
471 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
475 uint ret = Interop.RendererParameters.TextWidthGet(SwigCPtr);
476 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
482 /// The height in pixels of the boundaries where the text is going to be laid-out.
484 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
485 [EditorBrowsable(EditorBrowsableState.Never)]
486 public uint TextHeight
490 Interop.RendererParameters.TextHeightSet(SwigCPtr, value);
491 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
495 uint ret = Interop.RendererParameters.TextHeightGet(SwigCPtr);
496 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
502 /// The radius in pixels of the circular text.
504 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
505 [EditorBrowsable(EditorBrowsableState.Never)]
510 Interop.RendererParameters.RadiusSet(SwigCPtr, value);
511 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
515 uint ret = Interop.RendererParameters.RadiusGet(SwigCPtr);
516 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
522 /// 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°.
524 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
525 [EditorBrowsable(EditorBrowsableState.Never)]
526 public float BeginAngle
530 Interop.RendererParameters.BeginAngleSet(SwigCPtr, value);
531 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
535 float ret = Interop.RendererParameters.BeginAngleGet(SwigCPtr);
536 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
542 /// 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.
544 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
545 [EditorBrowsable(EditorBrowsableState.Never)]
546 public float IncrementAngle
550 Interop.RendererParameters.IncrementAngleSet(SwigCPtr, value);
551 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
555 float ret = Interop.RendererParameters.IncrementAngleGet(SwigCPtr);
556 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
562 /// Whether the ellipsis layout option is enabled.
564 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
565 [EditorBrowsable(EditorBrowsableState.Never)]
566 public bool EllipsisEnabled
570 Interop.RendererParameters.EllipsisEnabledSet(SwigCPtr, value);
571 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
575 bool ret = Interop.RendererParameters.EllipsisEnabledGet(SwigCPtr);
576 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
582 /// Whether the mark-up processor is enabled.
584 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
585 [EditorBrowsable(EditorBrowsableState.Never)]
586 public bool MarkupEnabled
590 Interop.RendererParameters.MarkupEnabledSet(SwigCPtr, value);
591 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
595 bool ret = Interop.RendererParameters.MarkupEnabledGet(SwigCPtr);
596 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
602 /// Whether a default color has been set.
604 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
605 [EditorBrowsable(EditorBrowsableState.Never)]
606 public bool IsTextColorSet
610 Interop.RendererParameters.IsTextColorSetSet(SwigCPtr, value);
611 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
615 bool ret = Interop.RendererParameters.IsTextColorSetGet(SwigCPtr);
616 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
622 /// Minimum size of line.
624 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
625 [EditorBrowsable(EditorBrowsableState.Never)]
626 public float MinLineSize
630 Interop.RendererParameters.MinLineSizeSet(SwigCPtr, value);
631 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
635 float ret = Interop.RendererParameters.MinLineSizeGet(SwigCPtr);
636 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
642 /// Padding of TextLabel.
644 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
645 [EditorBrowsable(EditorBrowsableState.Never)]
646 public Extents Padding
650 Interop.RendererParameters.PaddingSet(SwigCPtr, Extents.getCPtr(value));
651 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
655 Extents ret = new Extents(Interop.RendererParameters.PaddingGet(SwigCPtr), true);
656 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
664 /// Class with info of the embedded items layout.
666 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
667 [EditorBrowsable(EditorBrowsableState.Never)]
668 public class EmbeddedItemInfo : Disposable
671 internal EmbeddedItemInfo(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
678 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
680 Interop.EmbeddedItemInfo.DeleteEmbeddedItemInfo(swigCPtr);
684 /// Construct EmbeddedItemInfo
686 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
687 [EditorBrowsable(EditorBrowsableState.Never)]
688 public EmbeddedItemInfo() : this(Interop.EmbeddedItemInfo.NewEmbeddedItemInfo(), true)
690 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
694 /// Index to the character within the string.
696 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
697 [EditorBrowsable(EditorBrowsableState.Never)]
698 public uint CharacterIndex
702 Interop.EmbeddedItemInfo.CharacterIndexSet(SwigCPtr, value);
703 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
707 uint ret = Interop.EmbeddedItemInfo.CharacterIndexGet(SwigCPtr);
708 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
714 /// Index to the glyph
716 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
717 [EditorBrowsable(EditorBrowsableState.Never)]
718 public uint GlyphIndex
722 Interop.EmbeddedItemInfo.GlyphIndexSet(SwigCPtr, value);
723 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
727 uint ret = Interop.EmbeddedItemInfo.GlyphIndexGet(SwigCPtr);
728 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
734 /// The layout position within the buffer (top, left corner).
736 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
737 [EditorBrowsable(EditorBrowsableState.Never)]
738 public Vector2 Position
742 Interop.EmbeddedItemInfo.PositionSet(SwigCPtr, Vector2.getCPtr(value));
743 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
747 Vector2 ret = new Vector2(Interop.EmbeddedItemInfo.PositionGet(SwigCPtr), SwigCMemOwn);
748 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
754 /// The size within the buffer of the embedded item.
756 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
757 [EditorBrowsable(EditorBrowsableState.Never)]
762 Interop.EmbeddedItemInfo.SizeSet(SwigCPtr, Size.getCPtr(value));
763 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
767 Size ret = new Size(Interop.EmbeddedItemInfo.SizeGet(SwigCPtr), SwigCMemOwn);
768 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
774 /// The rotated size within the buffer of the embedded item.
776 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
777 [EditorBrowsable(EditorBrowsableState.Never)]
778 public Size RotatedSize
782 Interop.EmbeddedItemInfo.RotatedSizeSet(SwigCPtr, Size.getCPtr(value));
783 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
787 Size ret = new Size(Interop.EmbeddedItemInfo.RotatedSizeGet(SwigCPtr), SwigCMemOwn);
788 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
794 /// Rotation angle of the pixel buffer in degrees.
796 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
797 [EditorBrowsable(EditorBrowsableState.Never)]
802 Interop.EmbeddedItemInfo.AngleSet(SwigCPtr, Degree.getCPtr(value));
803 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
807 Degree ret = new Degree(Interop.EmbeddedItemInfo.AngleGet(SwigCPtr), SwigCMemOwn);
808 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
814 /// Whether the color of the image is multiplied by the color of the text.
816 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
817 [EditorBrowsable(EditorBrowsableState.Never)]
818 public Tizen.NUI.ColorBlendingMode ColorBlendingMode
822 Interop.EmbeddedItemInfo.ColorBlendingModeSet(SwigCPtr, value);
823 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
827 Tizen.NUI.ColorBlendingMode ret = Interop.EmbeddedItemInfo.ColorBlendingModeGet(SwigCPtr);
828 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
835 /// Class with the parameters needed to build a shadow for the given pixel buffer.
837 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
838 [EditorBrowsable(EditorBrowsableState.Never)]
839 public class ShadowParameters : Disposable
842 internal ShadowParameters(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
849 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
851 Interop.ShadowParameters.DeleteShadowParameters(swigCPtr);
855 /// Construct ShadowParameters
857 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
858 [EditorBrowsable(EditorBrowsableState.Never)]
859 public ShadowParameters() : this(Interop.ShadowParameters.NewShadowParameters(), true)
861 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
865 /// The input pixel buffer used to create the shadow.
867 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
868 [EditorBrowsable(EditorBrowsableState.Never)]
869 public PixelBuffer Input
873 Interop.ShadowParameters.InputSet(SwigCPtr, PixelBuffer.getCPtr(value));
874 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
878 PixelBuffer ret = new PixelBuffer(Interop.ShadowParameters.InputGet(SwigCPtr), true);
879 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
885 /// The color of the text.
887 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
888 [EditorBrowsable(EditorBrowsableState.Never)]
889 public Vector4 TextColor
893 Interop.ShadowParameters.TextColorSet(SwigCPtr, Vector4.getCPtr(value));
894 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
898 Vector4 ret = new Vector4(Interop.ShadowParameters.TextColorGet(SwigCPtr), true);
899 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
905 /// The color of the shadow.
907 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
908 [EditorBrowsable(EditorBrowsableState.Never)]
913 Interop.ShadowParameters.ColorSet(SwigCPtr, Vector4.getCPtr(value));
914 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
918 Vector4 ret = new Vector4(Interop.ShadowParameters.ColorGet(SwigCPtr), true);
919 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
925 /// The offset of the shadow.
927 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
928 [EditorBrowsable(EditorBrowsableState.Never)]
929 public Vector2 Offset
933 Interop.ShadowParameters.OffsetSet(SwigCPtr, Vector2.getCPtr(value));
934 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
938 Vector2 ret = new Vector2(Interop.ShadowParameters.OffsetGet(SwigCPtr), true);
939 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
945 /// Whether to blend the shadow.
947 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
948 [EditorBrowsable(EditorBrowsableState.Never)]
949 public bool blendShadow
953 Interop.ShadowParameters.BlendShadowSet(SwigCPtr, value);
954 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
958 bool ret = Interop.ShadowParameters.BlendShadowGet(SwigCPtr);
959 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
967 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
968 [EditorBrowsable(EditorBrowsableState.Never)]
969 public static partial class TextUtils
972 /// Renders text into a pixel buffer.
973 /// @note: Can process a mark-up string.
974 /// @note: It does the font selection, RTL reordering, shaping and layouting.
975 /// @note: The width of the pixel buffer may be different to the given @e textWidth
976 /// due to some padding pixels added.
978 /// The text is laid-out for the given size @e (textWidth,textHeight).
979 /// If the @e multiLineEnabled option is enabled, the text will wrap in lines.
980 /// If the @e ellipsisEnabled option is enabled, the text will be ellided if
981 /// there is no more space for new lines.
983 /// It won't be rendered the parts of the text exceeding the boundaries of
984 /// the given width and height.
986 /// If the given @e textHeight is zero, a big enough pixel buffer will be created
987 /// to render the full text.
989 /// If the given @e textWidth is zero, the 'natural size' of the text will be
990 /// used to create the pixel buffer to render the full text.
992 /// If the radius is not zero, the text will be laid-out following a circular path.
993 /// In that case the text is laid-out in a single line.
995 /// If the mark-up string contains embedded items, the @p embeddedItemLayout vector
996 /// contains the layout info of each embedded item.
998 /// <param name="textParameters">The text and style options.</param>
999 /// <param name="embeddedItemLayout">The layout info of the embedded items</param>
1000 /// <returns>A pixel buffer with the text rendered on it.</returns>
1001 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
1002 [EditorBrowsable(EditorBrowsableState.Never)]
1003 public static PixelBuffer Render(RendererParameters textParameters, ref EmbeddedItemInfo[] embeddedItemLayout)
1007 global::System.IntPtr returnItem = IntPtr.Zero;
1008 PixelBuffer ret = new PixelBuffer(Interop.TextUtils.Render(RendererParameters.getCPtr(textParameters), ref returnItem, ref count, ref length), true);
1010 embeddedItemLayout = new EmbeddedItemInfo[count];
1011 for (int i = 0; i < count; i++)
1013 IntPtr p = new IntPtr((returnItem.ToInt32() + i * length));
1014 embeddedItemLayout[i] = new EmbeddedItemInfo(p, false);
1016 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1021 /// Creates a shadow for the text given in the input pixel buffer.
1022 /// The function returns a RGBA8888 pixel buffer with the text and its shadow rendered on it.
1024 /// The pixel format of the @e input pixel buffer could be an A8 or an RGBA8888. If it's
1025 /// an A8 pixel buffer, it uses the given @e textColor to give color to the text. Otherwise
1026 /// it uses the color of the @e input pixel buffer.
1028 /// <param name="shadowParameters">The parameters needed to create the text's shadow.</param>
1029 /// <returns>A pixel buffer with the text and the shadow rendered on it.</returns>
1030 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
1031 [EditorBrowsable(EditorBrowsableState.Never)]
1032 public static PixelBuffer CreateShadow(ShadowParameters shadowParameters)
1034 PixelBuffer ret = new PixelBuffer(Interop.TextUtils.CreateShadow(ShadowParameters.getCPtr(shadowParameters)), true);
1035 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1040 /// Converts a @p pixelBuffer with pixel format A8 to RGBA8888 using the given @p color.
1041 /// @note Does nothing if the @p pixelBuffer is not A8.
1043 /// <param name="pixelBuffer">The pixel buffer with pixel format A8</param>
1044 /// <param name="color">The color used to convert to RGBA8888</param>
1045 /// <param name="multiplyByAlpha">multiplyByAlpha Whether to multiply the @p color with the alpha value of the @p pixel @p buffer.</param>
1046 /// <returns>The pixel buffer converted to RGBA8888.</returns>
1047 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
1048 [EditorBrowsable(EditorBrowsableState.Never)]
1049 public static PixelBuffer ConvertToRgba8888(PixelBuffer pixelBuffer, Vector4 color, bool multiplyByAlpha)
1051 PixelBuffer ret = new PixelBuffer(Interop.TextUtils.ConvertToRgba8888(PixelBuffer.getCPtr(pixelBuffer), Vector4.getCPtr(color), multiplyByAlpha), true);
1052 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1057 /// Updates the @p dst pixel buffer with the data from @p src pixel buffer.
1058 /// @note Both pixel buffers must have the same pixel format. Does nothing if both pixel format are different.
1059 /// @note The function does nothing if the @p src pixel buffer doesn't fit into the @p dst pixel buffer.
1061 /// The @p src pixel buffer could be blended with the @p dst pixel buffer if @p blend is set to @e true.
1063 /// <param name="src">The pixel buffer from where the data is read.</param>
1064 /// <param name="dst">The pixel buffer where the data is written.</param>
1065 /// <param name="x">The top left corner's X within the destination pixel buffer.</param>
1066 /// <param name="y">The top left corner's y within the destination pixel buffer.</param>
1067 /// <param name="blend">Whether to blend the source pixel buffer with the destination pixel buffer as background.</param>
1068 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
1069 [EditorBrowsable(EditorBrowsableState.Never)]
1070 public static void UpdateBuffer(PixelBuffer src, PixelBuffer dst, uint x, uint y, bool blend)
1072 Interop.TextUtils.UpdateBuffer(PixelBuffer.getCPtr(src), PixelBuffer.getCPtr(dst), x, y, blend);
1073 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1077 /// Splits the text in pages of the size given in @p textParameters
1078 /// @note The returned indices are indices to utf32 characters. The input text is encoded in utf8.
1079 /// <returns> An array with the indices of the last character of each page </returns>
1081 [EditorBrowsable(EditorBrowsableState.Never)]
1082 public static Tizen.NUI.PropertyArray GetLastCharacterIndex(RendererParameters textParameters)
1084 Tizen.NUI.PropertyArray ret = new Tizen.NUI.PropertyArray(Interop.TextUtils.GetLastCharacterIndex(RendererParameters.getCPtr(textParameters)), true);
1085 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1090 /// This method converts a FontInfo property array to a list and returns it.
1091 /// <param name="fontArray">The FontInfo PropertyArray.</param>
1092 /// <returns> A list of FontInfo struct. </returns>
1094 [EditorBrowsable(EditorBrowsableState.Never)]
1095 public static List<FontInfo> GetFontInfoList(PropertyArray fontArray)
1097 var fontList = new List<FontInfo>();
1098 if (fontArray != null)
1100 for (uint i = 0 ; i < fontArray.Count(); i ++)
1102 using (var fontInfoMap = new PropertyMap())
1103 using (var propertyValue = fontArray[i])
1105 propertyValue.Get(fontInfoMap);
1107 if (fontInfoMap.Count() > 0)
1109 var fontInfo = new FontInfo();
1110 fontInfo.Family = TextMapHelper.GetStringFromMap(fontInfoMap, "family", "TizenSans");
1111 fontInfo.Path = TextMapHelper.GetStringFromMap(fontInfoMap, "path", "");
1112 fontInfo.Style = new FontStyle()
1114 Width = (FontWidthType)TextMapHelper.GetIntFromMap(fontInfoMap, "width", 0),
1115 Weight = (FontWeightType)TextMapHelper.GetIntFromMap(fontInfoMap, "weight", 0),
1116 Slant = (FontSlantType)TextMapHelper.GetIntFromMap(fontInfoMap, "slant", 0),
1118 fontList.Add(fontInfo);
1127 private const float FontSizeScaleSmall = 0.8f;
1128 private const float FontSizeScaleNormal = 1.0f;
1129 private const float FontSizeScaleLarge = 1.5f;
1130 private const float FontSizeScaleHuge = 1.9f;
1131 private const float FontSizeScaleGiant = 2.5f;
1132 #elif PROFILE_WEARABLE
1133 // The following values from 'system-settings/libutil/sstu.c'
1134 private const float FontSizeScaleSmall = 0.9f;
1135 private const float FontSizeScaleNormal = 1.0f;
1136 private const float FontSizeScaleLarge = 1.1f;
1137 private const float FontSizeScaleHuge = 1.9f;
1138 private const float FontSizeScaleGiant = 2.5f;
1139 #else // PROFILE_MOBILE and etc
1140 // The following values from 'system-settings/libutil/sstu.c'
1141 private const float FontSizeScaleSmall = 0.87f;
1142 private const float FontSizeScaleNormal = 1.0f;
1143 private const float FontSizeScaleLarge = 1.13f;
1144 private const float FontSizeScaleHuge = 1.26f;
1145 private const float FontSizeScaleGiant = 1.4f;
1149 /// It returns a float value according to SystemSettingsFontSize.
1150 /// The returned value can be used for FontSizeScale property.
1151 /// <param name="systemSettingsFontSize">The SystemSettingsFontSize enum value.</param>
1152 /// <returns> A float value for FontSizeScale property. </returns>
1154 [EditorBrowsable(EditorBrowsableState.Never)]
1155 public static float GetFontSizeScale(SystemSettingsFontSize systemSettingsFontSize)
1157 float ret = FontSizeScaleNormal;
1159 switch (systemSettingsFontSize)
1161 case SystemSettingsFontSize.Small:
1162 ret = FontSizeScaleSmall;
1164 case SystemSettingsFontSize.Normal:
1165 ret = FontSizeScaleNormal;
1167 case SystemSettingsFontSize.Large:
1168 ret = FontSizeScaleLarge;
1170 case SystemSettingsFontSize.Huge:
1171 ret = FontSizeScaleHuge;
1173 case SystemSettingsFontSize.Giant:
1174 ret = FontSizeScaleGiant;
1182 /// Copy the previously selected text from the text control into the clipboard.
1184 /// <param name="textEditor">The textEditor control from which the text is copied.</param>
1185 /// <returns>The copied text.</returns>
1186 /// <since_tizen> 9 </since_tizen>
1187 public static string CopyToClipboard(TextEditor textEditor)
1189 string copiedText = Interop.TextEditor.CopyText(textEditor.SwigCPtr);
1190 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1195 /// Copy the previously selected text from the text control into the clipboard.
1197 /// <param name="textField">The textField control from which the text is copied.</param>
1198 /// <returns>The copied text.</returns>
1199 /// <since_tizen> 9 </since_tizen>
1200 public static string CopyToClipboard(TextField textField)
1202 string copiedText = Interop.TextField.CopyText(textField.SwigCPtr);
1203 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1208 /// Cut the previously selected text from the text control into the clipboard.
1210 /// <param name="textEditor">The textEditor control from which the text is cut.</param>
1211 /// <returns>The cut text.</returns>
1212 /// <since_tizen> 9 </since_tizen>
1213 public static string CutToClipboard(TextEditor textEditor)
1215 string cutText = Interop.TextEditor.CutText(textEditor.SwigCPtr);
1216 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1221 /// Cut the previously selected text from the text control into the clipboard.
1223 /// <param name="textField">The textField control from which the text is cut.</param>
1224 /// <returns>The cut text.</returns>
1225 /// <since_tizen> 9 </since_tizen>
1226 public static string CutToClipboard(TextField textField)
1228 string cutText = Interop.TextField.CutText(textField.SwigCPtr);
1229 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1234 /// Paste the most recently copied/cut text item from the clipboard into the text control.
1237 /// The pasted text will be inserted in the current cursor position and if the text control has no focus,
1238 /// the text will be appended to the last cursor position and the text control will gain focus.
1239 /// If some text inside the text control is selected, it will be replaced by the pasted text.
1241 /// <param name="textEditor">The textEditor control into which the text is pasted.</param>
1242 /// <since_tizen> 9 </since_tizen>
1243 public static void PasteTo(TextEditor textEditor)
1245 Interop.TextEditor.PasteText(textEditor.SwigCPtr);
1246 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1250 /// Paste the most recently copied/cut text item from the clipboard into the text control.
1253 /// The pasted text will be inserted in the current cursor position and if the text control has no focus,
1254 /// the text will be appended to the last cursor position and the text control will gain focus.
1255 /// If some text inside the text control is selected, it will be replaced by the pasted text.
1257 /// <param name="textField">The textField control into which the text is pasted.</param>
1258 /// <since_tizen> 9 </since_tizen>
1259 public static void PasteTo(TextField textField)
1261 Interop.TextField.PasteText(textField.SwigCPtr);
1262 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();