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;
22 using System.Collections.Generic;
25 namespace Tizen.NUI.BaseComponents
28 /// Class with the text and style parameters to be rendered into a pixel buffer.
30 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
31 [EditorBrowsable(EditorBrowsableState.Never)]
32 public class RendererParameters : Disposable
34 internal RendererParameters(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
41 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
43 Interop.RendererParameters.DeleteRendererParameters(swigCPtr);
47 /// Construct RendererParameters
49 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
50 [EditorBrowsable(EditorBrowsableState.Never)]
51 public RendererParameters() : this(Interop.RendererParameters.NewRendererParameters(), true)
53 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
57 /// The text to be rendered
59 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
60 [EditorBrowsable(EditorBrowsableState.Never)]
65 Interop.RendererParameters.TextSet(SwigCPtr, value);
66 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
70 string ret = Interop.RendererParameters.TextGet(SwigCPtr);
71 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
77 /// The horizontal alignment: one of HorizontalAlignment.
79 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
80 [EditorBrowsable(EditorBrowsableState.Never)]
81 public HorizontalAlignment HorizontalAlignment
85 string alignment = "begin";
88 case HorizontalAlignment.Begin:
93 case HorizontalAlignment.Center:
98 case HorizontalAlignment.End:
108 Interop.RendererParameters.HorizontalAlignmentSet(SwigCPtr, alignment);
109 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
113 string ret = Interop.RendererParameters.HorizontalAlignmentGet(SwigCPtr);
114 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
115 HorizontalAlignment alignment = HorizontalAlignment.Begin;
120 alignment = HorizontalAlignment.Begin;
125 alignment = HorizontalAlignment.Center;
130 alignment = HorizontalAlignment.End;
143 /// The vertical alignment: one of VerticalAlignment.
145 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
146 [EditorBrowsable(EditorBrowsableState.Never)]
147 public VerticalAlignment VerticalAlignment
151 string alignment = "top";
154 case VerticalAlignment.Top:
159 case VerticalAlignment.Center:
161 alignment = "center";
164 case VerticalAlignment.Bottom:
166 alignment = "bottom";
174 Interop.RendererParameters.VerticalAlignmentSet(SwigCPtr, alignment);
175 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
179 string ret = Interop.RendererParameters.VerticalAlignmentGet(SwigCPtr);
180 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
181 VerticalAlignment alignment = VerticalAlignment.Top;
186 alignment = VerticalAlignment.Top;
191 alignment = VerticalAlignment.Center;
196 alignment = VerticalAlignment.Bottom;
209 /// The font's family.
211 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
212 [EditorBrowsable(EditorBrowsableState.Never)]
213 public string FontFamily
217 Interop.RendererParameters.FontFamilySet(SwigCPtr, value);
218 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
222 string ret = Interop.RendererParameters.FontFamilyGet(SwigCPtr);
223 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
229 /// The font's weight: one of {"thin", "ultraLight", "extraLight", "light", "demiLight", "semiLight", "book", "normal", "regular", "medium", "demiBold", "semiBold", "bold", "ultraBold", "extraBold", "black", "heavy", "extraBlack"}.
231 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
232 [EditorBrowsable(EditorBrowsableState.Never)]
233 public string FontWeight
237 Interop.RendererParameters.FontWeightSet(SwigCPtr, value);
238 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
242 string ret = Interop.RendererParameters.FontWeightGet(SwigCPtr);
243 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
249 /// The font's width: one of {"ultraCondensed", "extraCondensed", "condensed", "semiCondensed", "normal", "semiExpanded", "expanded", "extraExpanded", "ultraExpanded"}.
251 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
252 [EditorBrowsable(EditorBrowsableState.Never)]
253 public string FontWidth
257 Interop.RendererParameters.FontWidthSet(SwigCPtr, value);
258 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
262 string ret = Interop.RendererParameters.FontWidthGet(SwigCPtr);
263 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
269 /// The font's slant. one of {"normal", "roman", "italic", "oblique"}
271 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
272 [EditorBrowsable(EditorBrowsableState.Never)]
273 public string FontSlant
277 Interop.RendererParameters.FontSlantSet(SwigCPtr, value);
278 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
282 string ret = Interop.RendererParameters.FontSlantGet(SwigCPtr);
283 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
289 /// The type of layout: one of TextLayout {"singleLine", "multiLine", "circular"}
291 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
292 [EditorBrowsable(EditorBrowsableState.Never)]
293 public TextLayout Layout
297 string textLayout = "singleLine";
300 case TextLayout.SingleLine:
302 textLayout = "singleLine";
305 case TextLayout.MultiLine:
307 textLayout = "multiLine";
310 case TextLayout.Circular:
312 textLayout = "circular";
320 Interop.RendererParameters.LayoutSet(SwigCPtr, textLayout);
321 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
325 string ret = Interop.RendererParameters.LayoutGet(SwigCPtr);
326 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
327 TextLayout textLayout = TextLayout.SingleLine;
332 textLayout = TextLayout.SingleLine;
337 textLayout = TextLayout.MultiLine;
342 textLayout = TextLayout.Circular;
355 /// 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.
357 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
358 [EditorBrowsable(EditorBrowsableState.Never)]
359 public CircularAlignment CircularAlignment
363 string alignment = "begin";
366 case CircularAlignment.Begin:
371 case CircularAlignment.Center:
373 alignment = "center";
376 case CircularAlignment.End:
386 Interop.RendererParameters.CircularAlignmentSet(SwigCPtr, alignment);
387 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
391 string ret = Interop.RendererParameters.CircularAlignmentGet(SwigCPtr);
392 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
393 CircularAlignment alignment = CircularAlignment.Begin;
398 alignment = CircularAlignment.Begin;
403 alignment = CircularAlignment.Center;
408 alignment = CircularAlignment.End;
421 /// The default text's color. Default is white.
423 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
424 [EditorBrowsable(EditorBrowsableState.Never)]
425 public Vector4 TextColor
429 Interop.RendererParameters.TextColorSet(SwigCPtr, Vector4.getCPtr(value));
430 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
434 Vector4 ret = new Vector4(Interop.RendererParameters.TextColorGet(SwigCPtr), true);
435 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
441 /// The font's size (in points).
443 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
444 [EditorBrowsable(EditorBrowsableState.Never)]
445 public float FontSize
449 Interop.RendererParameters.FontSizeSet(SwigCPtr, value);
450 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
454 float ret = Interop.RendererParameters.FontSizeGet(SwigCPtr);
455 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
461 /// The width in pixels of the boundaries where the text is going to be laid-out.
463 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
464 [EditorBrowsable(EditorBrowsableState.Never)]
465 public uint TextWidth
469 Interop.RendererParameters.TextWidthSet(SwigCPtr, value);
470 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
474 uint ret = Interop.RendererParameters.TextWidthGet(SwigCPtr);
475 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
481 /// The height in pixels of the boundaries where the text is going to be laid-out.
483 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
484 [EditorBrowsable(EditorBrowsableState.Never)]
485 public uint TextHeight
489 Interop.RendererParameters.TextHeightSet(SwigCPtr, value);
490 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
494 uint ret = Interop.RendererParameters.TextHeightGet(SwigCPtr);
495 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
501 /// The radius in pixels of the circular text.
503 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
504 [EditorBrowsable(EditorBrowsableState.Never)]
509 Interop.RendererParameters.RadiusSet(SwigCPtr, value);
510 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
514 uint ret = Interop.RendererParameters.RadiusGet(SwigCPtr);
515 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
521 /// 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°.
523 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
524 [EditorBrowsable(EditorBrowsableState.Never)]
525 public float BeginAngle
529 Interop.RendererParameters.BeginAngleSet(SwigCPtr, value);
530 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
534 float ret = Interop.RendererParameters.BeginAngleGet(SwigCPtr);
535 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
541 /// 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.
543 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
544 [EditorBrowsable(EditorBrowsableState.Never)]
545 public float IncrementAngle
549 Interop.RendererParameters.IncrementAngleSet(SwigCPtr, value);
550 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
554 float ret = Interop.RendererParameters.IncrementAngleGet(SwigCPtr);
555 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
561 /// Whether the ellipsis layout option is enabled.
563 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
564 [EditorBrowsable(EditorBrowsableState.Never)]
565 public bool EllipsisEnabled
569 Interop.RendererParameters.EllipsisEnabledSet(SwigCPtr, value);
570 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
574 bool ret = Interop.RendererParameters.EllipsisEnabledGet(SwigCPtr);
575 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
581 /// Whether the mark-up processor is enabled.
583 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
584 [EditorBrowsable(EditorBrowsableState.Never)]
585 public bool MarkupEnabled
589 Interop.RendererParameters.MarkupEnabledSet(SwigCPtr, value);
590 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
594 bool ret = Interop.RendererParameters.MarkupEnabledGet(SwigCPtr);
595 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
601 /// Whether a default color has been set.
603 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
604 [EditorBrowsable(EditorBrowsableState.Never)]
605 public bool IsTextColorSet
609 Interop.RendererParameters.IsTextColorSetSet(SwigCPtr, value);
610 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
614 bool ret = Interop.RendererParameters.IsTextColorSetGet(SwigCPtr);
615 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
621 /// Minimum size of line.
623 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
624 [EditorBrowsable(EditorBrowsableState.Never)]
625 public float MinLineSize
629 Interop.RendererParameters.MinLineSizeSet(SwigCPtr, value);
630 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
634 float ret = Interop.RendererParameters.MinLineSizeGet(SwigCPtr);
635 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
641 /// Padding of TextLabel.
643 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
644 [EditorBrowsable(EditorBrowsableState.Never)]
645 public Extents Padding
649 Interop.RendererParameters.PaddingSet(SwigCPtr, Extents.getCPtr(value));
650 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
654 Extents ret = new Extents(Interop.RendererParameters.PaddingGet(SwigCPtr), true);
655 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
663 /// Class with info of the embedded items layout.
665 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
666 [EditorBrowsable(EditorBrowsableState.Never)]
667 public class EmbeddedItemInfo : Disposable
670 internal EmbeddedItemInfo(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
677 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
679 Interop.EmbeddedItemInfo.DeleteEmbeddedItemInfo(swigCPtr);
683 /// Construct EmbeddedItemInfo
685 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
686 [EditorBrowsable(EditorBrowsableState.Never)]
687 public EmbeddedItemInfo() : this(Interop.EmbeddedItemInfo.NewEmbeddedItemInfo(), true)
689 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
693 /// Index to the character within the string.
695 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
696 [EditorBrowsable(EditorBrowsableState.Never)]
697 public uint CharacterIndex
701 Interop.EmbeddedItemInfo.CharacterIndexSet(SwigCPtr, value);
702 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
706 uint ret = Interop.EmbeddedItemInfo.CharacterIndexGet(SwigCPtr);
707 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
713 /// Index to the glyph
715 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
716 [EditorBrowsable(EditorBrowsableState.Never)]
717 public uint GlyphIndex
721 Interop.EmbeddedItemInfo.GlyphIndexSet(SwigCPtr, value);
722 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
726 uint ret = Interop.EmbeddedItemInfo.GlyphIndexGet(SwigCPtr);
727 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
733 /// The layout position within the buffer (top, left corner).
735 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
736 [EditorBrowsable(EditorBrowsableState.Never)]
737 public Vector2 Position
741 Interop.EmbeddedItemInfo.PositionSet(SwigCPtr, Vector2.getCPtr(value));
742 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
746 Vector2 ret = new Vector2(Interop.EmbeddedItemInfo.PositionGet(SwigCPtr), SwigCMemOwn);
747 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
753 /// The size within the buffer of the embedded item.
755 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
756 [EditorBrowsable(EditorBrowsableState.Never)]
761 Interop.EmbeddedItemInfo.SizeSet(SwigCPtr, Size.getCPtr(value));
762 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
766 Size ret = new Size(Interop.EmbeddedItemInfo.SizeGet(SwigCPtr), SwigCMemOwn);
767 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
773 /// The rotated size within the buffer of the embedded item.
775 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
776 [EditorBrowsable(EditorBrowsableState.Never)]
777 public Size RotatedSize
781 Interop.EmbeddedItemInfo.RotatedSizeSet(SwigCPtr, Size.getCPtr(value));
782 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
786 Size ret = new Size(Interop.EmbeddedItemInfo.RotatedSizeGet(SwigCPtr), SwigCMemOwn);
787 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
793 /// Rotation angle of the pixel buffer in degrees.
795 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
796 [EditorBrowsable(EditorBrowsableState.Never)]
801 Interop.EmbeddedItemInfo.AngleSet(SwigCPtr, Degree.getCPtr(value));
802 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
806 Degree ret = new Degree(Interop.EmbeddedItemInfo.AngleGet(SwigCPtr), SwigCMemOwn);
807 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
813 /// Whether the color of the image is multiplied by the color of the text.
815 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
816 [EditorBrowsable(EditorBrowsableState.Never)]
817 public Tizen.NUI.ColorBlendingMode ColorBlendingMode
821 Interop.EmbeddedItemInfo.ColorBlendingModeSet(SwigCPtr, value);
822 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
826 Tizen.NUI.ColorBlendingMode ret = Interop.EmbeddedItemInfo.ColorBlendingModeGet(SwigCPtr);
827 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
834 /// Class with the parameters needed to build a shadow for the given pixel buffer.
836 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
837 [EditorBrowsable(EditorBrowsableState.Never)]
838 public class ShadowParameters : Disposable
841 internal ShadowParameters(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
848 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
850 Interop.ShadowParameters.DeleteShadowParameters(swigCPtr);
854 /// Construct ShadowParameters
856 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
857 [EditorBrowsable(EditorBrowsableState.Never)]
858 public ShadowParameters() : this(Interop.ShadowParameters.NewShadowParameters(), true)
860 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
864 /// The input pixel buffer used to create the shadow.
866 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
867 [EditorBrowsable(EditorBrowsableState.Never)]
868 public PixelBuffer Input
872 Interop.ShadowParameters.InputSet(SwigCPtr, PixelBuffer.getCPtr(value));
873 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
877 PixelBuffer ret = new PixelBuffer(Interop.ShadowParameters.InputGet(SwigCPtr), true);
878 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
884 /// The color of the text.
886 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
887 [EditorBrowsable(EditorBrowsableState.Never)]
888 public Vector4 TextColor
892 Interop.ShadowParameters.TextColorSet(SwigCPtr, Vector4.getCPtr(value));
893 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
897 Vector4 ret = new Vector4(Interop.ShadowParameters.TextColorGet(SwigCPtr), true);
898 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
904 /// The color of the shadow.
906 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
907 [EditorBrowsable(EditorBrowsableState.Never)]
912 Interop.ShadowParameters.ColorSet(SwigCPtr, Vector4.getCPtr(value));
913 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
917 Vector4 ret = new Vector4(Interop.ShadowParameters.ColorGet(SwigCPtr), true);
918 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
924 /// The offset of the shadow.
926 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
927 [EditorBrowsable(EditorBrowsableState.Never)]
928 public Vector2 Offset
932 Interop.ShadowParameters.OffsetSet(SwigCPtr, Vector2.getCPtr(value));
933 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
937 Vector2 ret = new Vector2(Interop.ShadowParameters.OffsetGet(SwigCPtr), true);
938 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
944 /// Whether to blend the shadow.
946 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
947 [EditorBrowsable(EditorBrowsableState.Never)]
948 public bool blendShadow
952 Interop.ShadowParameters.BlendShadowSet(SwigCPtr, value);
953 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
957 bool ret = Interop.ShadowParameters.BlendShadowGet(SwigCPtr);
958 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
966 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
967 [EditorBrowsable(EditorBrowsableState.Never)]
968 public static partial class TextUtils
971 /// Renders text into a pixel buffer.
972 /// @note: Can process a mark-up string.
973 /// @note: It does the font selection, RTL reordering, shaping and layouting.
974 /// @note: The width of the pixel buffer may be different to the given @e textWidth
975 /// due to some padding pixels added.
977 /// The text is laid-out for the given size @e (textWidth,textHeight).
978 /// If the @e multiLineEnabled option is enabled, the text will wrap in lines.
979 /// If the @e ellipsisEnabled option is enabled, the text will be ellided if
980 /// there is no more space for new lines.
982 /// It won't be rendered the parts of the text exceeding the boundaries of
983 /// the given width and height.
985 /// If the given @e textHeight is zero, a big enough pixel buffer will be created
986 /// to render the full text.
988 /// If the given @e textWidth is zero, the 'natural size' of the text will be
989 /// used to create the pixel buffer to render the full text.
991 /// If the radius is not zero, the text will be laid-out following a circular path.
992 /// In that case the text is laid-out in a single line.
994 /// If the mark-up string contains embedded items, the @p embeddedItemLayout vector
995 /// contains the layout info of each embedded item.
997 /// <param name="textParameters">The text and style options.</param>
998 /// <param name="embeddedItemLayout">The layout info of the embedded items</param>
999 /// <returns>A pixel buffer with the text rendered on it.</returns>
1000 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
1001 [EditorBrowsable(EditorBrowsableState.Never)]
1002 public static PixelBuffer Render(RendererParameters textParameters, ref EmbeddedItemInfo[] embeddedItemLayout)
1006 global::System.IntPtr returnItem = IntPtr.Zero;
1007 PixelBuffer ret = new PixelBuffer(Interop.TextUtils.Render(RendererParameters.getCPtr(textParameters), ref returnItem, ref count, ref length), true);
1009 embeddedItemLayout = new EmbeddedItemInfo[count];
1010 for (int i = 0; i < count; i++)
1012 IntPtr p = new IntPtr((returnItem.ToInt32() + i * length));
1013 embeddedItemLayout[i] = new EmbeddedItemInfo(p, false);
1015 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1020 /// Creates a shadow for the text given in the input pixel buffer.
1021 /// The function returns a RGBA8888 pixel buffer with the text and its shadow rendered on it.
1023 /// The pixel format of the @e input pixel buffer could be an A8 or an RGBA8888. If it's
1024 /// an A8 pixel buffer, it uses the given @e textColor to give color to the text. Otherwise
1025 /// it uses the color of the @e input pixel buffer.
1027 /// <param name="shadowParameters">The parameters needed to create the text's shadow.</param>
1028 /// <returns>A pixel buffer with the text and the shadow rendered on it.</returns>
1029 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
1030 [EditorBrowsable(EditorBrowsableState.Never)]
1031 public static PixelBuffer CreateShadow(ShadowParameters shadowParameters)
1033 PixelBuffer ret = new PixelBuffer(Interop.TextUtils.CreateShadow(ShadowParameters.getCPtr(shadowParameters)), true);
1034 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1039 /// Converts a @p pixelBuffer with pixel format A8 to RGBA8888 using the given @p color.
1040 /// @note Does nothing if the @p pixelBuffer is not A8.
1042 /// <param name="pixelBuffer">The pixel buffer with pixel format A8</param>
1043 /// <param name="color">The color used to convert to RGBA8888</param>
1044 /// <param name="multiplyByAlpha">multiplyByAlpha Whether to multiply the @p color with the alpha value of the @p pixel @p buffer.</param>
1045 /// <returns>The pixel buffer converted to RGBA8888.</returns>
1046 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
1047 [EditorBrowsable(EditorBrowsableState.Never)]
1048 public static PixelBuffer ConvertToRgba8888(PixelBuffer pixelBuffer, Vector4 color, bool multiplyByAlpha)
1050 PixelBuffer ret = new PixelBuffer(Interop.TextUtils.ConvertToRgba8888(PixelBuffer.getCPtr(pixelBuffer), Vector4.getCPtr(color), multiplyByAlpha), true);
1051 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1056 /// Updates the @p dst pixel buffer with the data from @p src pixel buffer.
1057 /// @note Both pixel buffers must have the same pixel format. Does nothing if both pixel format are different.
1058 /// @note The function does nothing if the @p src pixel buffer doesn't fit into the @p dst pixel buffer.
1060 /// The @p src pixel buffer could be blended with the @p dst pixel buffer if @p blend is set to @e true.
1062 /// <param name="src">The pixel buffer from where the data is read.</param>
1063 /// <param name="dst">The pixel buffer where the data is written.</param>
1064 /// <param name="x">The top left corner's X within the destination pixel buffer.</param>
1065 /// <param name="y">The top left corner's y within the destination pixel buffer.</param>
1066 /// <param name="blend">Whether to blend the source pixel buffer with the destination pixel buffer as background.</param>
1067 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
1068 [EditorBrowsable(EditorBrowsableState.Never)]
1069 public static void UpdateBuffer(PixelBuffer src, PixelBuffer dst, uint x, uint y, bool blend)
1071 Interop.TextUtils.UpdateBuffer(PixelBuffer.getCPtr(src), PixelBuffer.getCPtr(dst), x, y, blend);
1072 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1076 /// Splits the text in pages of the size given in @p textParameters
1077 /// @note The returned indices are indices to utf32 characters. The input text is encoded in utf8.
1078 /// <returns> An array with the indices of the last character of each page </returns>
1080 [EditorBrowsable(EditorBrowsableState.Never)]
1081 public static Tizen.NUI.PropertyArray GetLastCharacterIndex(RendererParameters textParameters)
1083 Tizen.NUI.PropertyArray ret = new Tizen.NUI.PropertyArray(Interop.TextUtils.GetLastCharacterIndex(RendererParameters.getCPtr(textParameters)), true);
1084 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1089 /// This method converts a FontInfo property array to a list and returns it.
1090 /// <param name="fontArray">The FontInfo PropertyArray.</param>
1091 /// <returns> A list of FontInfo struct. </returns>
1093 [EditorBrowsable(EditorBrowsableState.Never)]
1094 public static List<FontInfo> GetFontInfoList(PropertyArray fontArray)
1096 var fontList = new List<FontInfo>();
1097 if (fontArray != null)
1099 for (uint i = 0 ; i < fontArray.Count(); i ++)
1101 using (var fontInfoMap = new PropertyMap())
1102 using (var propertyValue = fontArray[i])
1104 propertyValue.Get(fontInfoMap);
1106 if (fontInfoMap.Count() > 0)
1108 var fontInfo = new FontInfo();
1109 fontInfo.Family = TextMapHelper.GetStringFromMap(fontInfoMap, "family", "TizenSans");
1110 fontInfo.Path = TextMapHelper.GetStringFromMap(fontInfoMap, "path", "");
1111 fontInfo.Style = new FontStyle()
1113 Width = (FontWidthType)TextMapHelper.GetIntFromMap(fontInfoMap, "width", 0),
1114 Weight = (FontWeightType)TextMapHelper.GetIntFromMap(fontInfoMap, "weight", 0),
1115 Slant = (FontSlantType)TextMapHelper.GetIntFromMap(fontInfoMap, "slant", 0),
1117 fontList.Add(fontInfo);
1126 private const float FontSizeScaleSmall = 0.8f;
1127 private const float FontSizeScaleNormal = 1.0f;
1128 private const float FontSizeScaleLarge = 1.5f;
1129 private const float FontSizeScaleHuge = 1.9f;
1130 private const float FontSizeScaleGiant = 2.5f;
1131 #elif PROFILE_WEARABLE
1132 // The following values from 'system-settings/libutil/sstu.c'
1133 private const float FontSizeScaleSmall = 0.9f;
1134 private const float FontSizeScaleNormal = 1.0f;
1135 private const float FontSizeScaleLarge = 1.1f;
1136 private const float FontSizeScaleHuge = 1.9f;
1137 private const float FontSizeScaleGiant = 2.5f;
1138 #else // PROFILE_MOBILE and etc
1139 // The following values from 'system-settings/libutil/sstu.c'
1140 private const float FontSizeScaleSmall = 0.87f;
1141 private const float FontSizeScaleNormal = 1.0f;
1142 private const float FontSizeScaleLarge = 1.13f;
1143 private const float FontSizeScaleHuge = 1.26f;
1144 private const float FontSizeScaleGiant = 1.4f;
1148 /// It returns a float value according to SystemSettingsFontSize.
1149 /// The returned value can be used for FontSizeScale property.
1150 /// <param name="systemSettingsFontSize">The SystemSettingsFontSize enum value.</param>
1151 /// <returns> A float value for FontSizeScale property. </returns>
1153 [EditorBrowsable(EditorBrowsableState.Never)]
1154 public static float GetFontSizeScale(SystemSettingsFontSize systemSettingsFontSize)
1156 float ret = FontSizeScaleNormal;
1158 switch (systemSettingsFontSize)
1160 case SystemSettingsFontSize.Small:
1161 ret = FontSizeScaleSmall;
1163 case SystemSettingsFontSize.Normal:
1164 ret = FontSizeScaleNormal;
1166 case SystemSettingsFontSize.Large:
1167 ret = FontSizeScaleLarge;
1169 case SystemSettingsFontSize.Huge:
1170 ret = FontSizeScaleHuge;
1172 case SystemSettingsFontSize.Giant:
1173 ret = FontSizeScaleGiant;
1181 /// Copy the previously selected text from the text control into the clipboard.
1183 /// <param name="textEditor">The textEditor control from which the text is copied.</param>
1184 /// <returns>The copied text.</returns>
1185 /// <since_tizen> 9 </since_tizen>
1186 public static string CopyToClipboard(TextEditor textEditor)
1188 string copiedText = Interop.TextEditor.CopyText(textEditor.SwigCPtr);
1189 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1194 /// Copy the previously selected text from the text control into the clipboard.
1196 /// <param name="textField">The textField control from which the text is copied.</param>
1197 /// <returns>The copied text.</returns>
1198 /// <since_tizen> 9 </since_tizen>
1199 public static string CopyToClipboard(TextField textField)
1201 string copiedText = Interop.TextField.CopyText(textField.SwigCPtr);
1202 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1207 /// Cut the previously selected text from the text control into the clipboard.
1209 /// <param name="textEditor">The textEditor control from which the text is cut.</param>
1210 /// <returns>The cut text.</returns>
1211 /// <since_tizen> 9 </since_tizen>
1212 public static string CutToClipboard(TextEditor textEditor)
1214 string cutText = Interop.TextEditor.CutText(textEditor.SwigCPtr);
1215 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1220 /// Cut the previously selected text from the text control into the clipboard.
1222 /// <param name="textField">The textField control from which the text is cut.</param>
1223 /// <returns>The cut text.</returns>
1224 /// <since_tizen> 9 </since_tizen>
1225 public static string CutToClipboard(TextField textField)
1227 string cutText = Interop.TextField.CutText(textField.SwigCPtr);
1228 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1233 /// Paste the most recently copied/cut text item from the clipboard into the text control.
1236 /// The pasted text will be inserted in the current cursor position and if the text control has no focus,
1237 /// the text will be appended to the last cursor position and the text control will gain focus.
1238 /// If some text inside the text control is selected, it will be replaced by the pasted text.
1240 /// <param name="textEditor">The textEditor control into which the text is pasted.</param>
1241 /// <since_tizen> 9 </since_tizen>
1242 public static void PasteTo(TextEditor textEditor)
1244 Interop.TextEditor.PasteText(textEditor.SwigCPtr);
1245 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1249 /// Paste the most recently copied/cut text item from the clipboard into the text control.
1252 /// The pasted text will be inserted in the current cursor position and if the text control has no focus,
1253 /// the text will be appended to the last cursor position and the text control will gain focus.
1254 /// If some text inside the text control is selected, it will be replaced by the pasted text.
1256 /// <param name="textField">The textField control into which the text is pasted.</param>
1257 /// <since_tizen> 9 </since_tizen>
1258 public static void PasteTo(TextField textField)
1260 Interop.TextField.PasteText(textField.SwigCPtr);
1261 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();