[NUI] Add TextPageUtil (#1819)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / TextUtils.cs
1 /*
2  * Copyright(c) 2020 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 using System;
19 using System.ComponentModel;
20 using System.Collections.Generic;
21 using Tizen.NUI.Binding;
22
23 namespace Tizen.NUI.BaseComponents
24 {
25     /// <summary>
26     /// Class with the text and style parameters to be rendered into a pixel buffer.
27     /// </summary>
28     // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
29     [EditorBrowsable(EditorBrowsableState.Never)]
30     public class RendererParameters : Disposable
31     {
32         internal RendererParameters(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
33         {
34         }
35
36         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(RendererParameters obj)
37         {
38             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
39         }
40
41         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
42         {
43             Interop.RendererParameters.delete_RendererParameters(swigCPtr);
44         }
45
46         /// <summary>
47         /// Construct RendererParameters
48         /// </summary>
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.new_RendererParameters__SWIG_0(), true)
52         {
53             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
54         }
55
56         /// <summary>
57         /// The text to be rendered
58         /// </summary>
59         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
60         [EditorBrowsable(EditorBrowsableState.Never)]
61         public string Text
62         {
63             set
64             {
65                 Interop.RendererParameters.RendererParameters_text_set(swigCPtr, value);
66                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
67             }
68             get
69             {
70                 string ret = Interop.RendererParameters.RendererParameters_text_get(swigCPtr);
71                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
72                 return ret;
73             }
74         }
75
76         /// <summary>
77         /// The horizontal alignment: one of HorizontalAlignment.
78         /// </summary>
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
82         {
83             set
84             {
85                 string alignment = "begin";
86                 switch(value)
87                 {
88                     case HorizontalAlignment.Begin: {
89                         alignment = "begin";
90                         break;
91                     }
92                     case HorizontalAlignment.Center: {
93                         alignment = "center";
94                         break;
95                     }
96                     case HorizontalAlignment.End: {
97                         alignment = "end";
98                         break;
99                     }
100                     default : {
101                         break;
102                     }
103                 }
104                 Interop.RendererParameters.RendererParameters_horizontalAlignment_set(swigCPtr, alignment);
105                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
106             }
107             get
108             {
109                 string ret = Interop.RendererParameters.RendererParameters_horizontalAlignment_get(swigCPtr);
110                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
111                 HorizontalAlignment alignment = HorizontalAlignment.Begin;
112                 switch(ret)
113                 {
114                     case "begin": {
115                         alignment = HorizontalAlignment.Begin;
116                         break;
117                     }
118                     case "center": {
119                         alignment = HorizontalAlignment.Center;
120                         break;
121                     }
122                     case "end": {
123                         alignment = HorizontalAlignment.End;
124                         break;
125                     }
126                     default : {
127                         break;
128                     }
129                 }
130                 return alignment;
131             }
132         }
133
134         /// <summary>
135         /// The vertical alignment: one of VerticalAlignment.
136         /// </summary>
137         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
138         [EditorBrowsable(EditorBrowsableState.Never)]
139         public VerticalAlignment VerticalAlignment
140         {
141             set
142             {
143                 string alignment = "top";
144                 switch(value)
145                 {
146                     case VerticalAlignment.Top: {
147                         alignment = "top";
148                         break;
149                     }
150                     case VerticalAlignment.Center: {
151                         alignment = "center";
152                         break;
153                     }
154                     case VerticalAlignment.Bottom: {
155                         alignment = "bottom";
156                         break;
157                     }
158                     default : {
159                         break;
160                     }
161                 }
162                 Interop.RendererParameters.RendererParameters_verticalAlignment_set(swigCPtr, alignment);
163                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
164             }
165             get
166             {
167                 string ret = Interop.RendererParameters.RendererParameters_verticalAlignment_get(swigCPtr);
168                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
169                 VerticalAlignment alignment = VerticalAlignment.Top;
170                 switch(ret)
171                 {
172                     case "top": {
173                         alignment = VerticalAlignment.Top;
174                         break;
175                     }
176                     case "center": {
177                         alignment = VerticalAlignment.Center;
178                         break;
179                     }
180                     case "bottom": {
181                         alignment = VerticalAlignment.Bottom;
182                         break;
183                     }
184                     default : {
185                         break;
186                     }
187                 }
188                 return alignment;
189             }
190         }
191
192         /// <summary>
193         /// The font's family.
194         /// </summary>
195         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
196         [EditorBrowsable(EditorBrowsableState.Never)]
197         public string FontFamily
198         {
199             set
200             {
201                 Interop.RendererParameters.RendererParameters_fontFamily_set(swigCPtr, value);
202                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
203             }
204             get
205             {
206                 string ret = Interop.RendererParameters.RendererParameters_fontFamily_get(swigCPtr);
207                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
208                 return ret;
209             }
210         }
211
212         /// <summary>
213         /// The font's weight: one of {"thin", "ultraLight", "extraLight", "light", "demiLight", "semiLight", "book", "normal", "regular", "medium", "demiBold", "semiBold", "bold", "ultraBold", "extraBold", "black", "heavy", "extraBlack"}.
214         /// </summary>
215         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
216         [EditorBrowsable(EditorBrowsableState.Never)]
217         public string FontWeight
218         {
219             set
220             {
221                 Interop.RendererParameters.RendererParameters_fontWeight_set(swigCPtr, value);
222                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
223             }
224             get
225             {
226                 string ret = Interop.RendererParameters.RendererParameters_fontWeight_get(swigCPtr);
227                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
228                 return ret;
229             }
230         }
231
232         /// <summary>
233         /// The font's width: one of {"ultraCondensed", "extraCondensed", "condensed", "semiCondensed", "normal", "semiExpanded", "expanded", "extraExpanded", "ultraExpanded"}.
234         /// </summary>
235         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
236         [EditorBrowsable(EditorBrowsableState.Never)]
237         public string FontWidth
238         {
239             set
240             {
241                 Interop.RendererParameters.RendererParameters_fontWidth_set(swigCPtr, value);
242                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
243             }
244             get
245             {
246                 string ret = Interop.RendererParameters.RendererParameters_fontWidth_get(swigCPtr);
247                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
248                 return ret;
249             }
250         }
251
252         /// <summary>
253         /// The font's slant. one of {"normal", "roman", "italic", "oblique"}
254         /// </summary>
255         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
256         [EditorBrowsable(EditorBrowsableState.Never)]
257         public string FontSlant
258         {
259             set
260             {
261                 Interop.RendererParameters.RendererParameters_fontSlant_set(swigCPtr, value);
262                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
263             }
264             get
265             {
266                 string ret = Interop.RendererParameters.RendererParameters_fontSlant_get(swigCPtr);
267                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
268                 return ret;
269             }
270         }
271
272         /// <summary>
273         /// The type of layout: one of TextLayout {"singleLine", "multiLine", "circular"}
274         /// </summary>
275         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
276         [EditorBrowsable(EditorBrowsableState.Never)]
277         public TextLayout Layout
278         {
279             set
280             {
281                 string textLayout = "singleLine";
282                 switch(value)
283                 {
284                     case TextLayout.SingleLine: {
285                         textLayout = "singleLine";
286                         break;
287                     }
288                     case TextLayout.MultiLine: {
289                         textLayout = "multiLine";
290                         break;
291                     }
292                     case TextLayout.Circular: {
293                         textLayout = "circular";
294                         break;
295                     }
296                     default : {
297                         break;
298                     }
299                 }
300                 Interop.RendererParameters.RendererParameters_layout_set(swigCPtr, textLayout);
301                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
302             }
303             get
304             {
305                 string ret = Interop.RendererParameters.RendererParameters_layout_get(swigCPtr);
306                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
307                 TextLayout textLayout = TextLayout.SingleLine;
308                 switch(ret)
309                 {
310                     case "singleLine": {
311                         textLayout = TextLayout.SingleLine;
312                         break;
313                     }
314                     case "multiLine": {
315                         textLayout = TextLayout.MultiLine;
316                         break;
317                     }
318                     case "circular": {
319                         textLayout = TextLayout.Circular;
320                         break;
321                     }
322                     default : {
323                         break;
324                     }
325                 }
326                 return textLayout;
327             }
328         }
329
330         /// <summary>
331         /// 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.
332         /// </summary>
333         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
334         [EditorBrowsable(EditorBrowsableState.Never)]
335         public CircularAlignment CircularAlignment
336         {
337             set
338             {
339                 string alignment = "begin";
340                 switch(value)
341                 {
342                     case CircularAlignment.Begin: {
343                         alignment = "begin";
344                         break;
345                     }
346                     case CircularAlignment.Center: {
347                         alignment = "center";
348                         break;
349                     }
350                     case CircularAlignment.End: {
351                         alignment = "end";
352                         break;
353                     }
354                     default : {
355                         break;
356                     }
357                 }
358                 Interop.RendererParameters.RendererParameters_circularAlignment_set(swigCPtr, alignment);
359                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
360             }
361             get
362             {
363                 string ret = Interop.RendererParameters.RendererParameters_circularAlignment_get(swigCPtr);
364                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
365                 CircularAlignment alignment = CircularAlignment.Begin;
366                 switch(ret)
367                 {
368                     case "begin": {
369                         alignment = CircularAlignment.Begin;
370                         break;
371                     }
372                     case "center": {
373                         alignment = CircularAlignment.Center;
374                         break;
375                     }
376                     case "end": {
377                         alignment = CircularAlignment.End;
378                         break;
379                     }
380                     default : {
381                         break;
382                     }
383                 }
384                 return alignment;
385             }
386         }
387
388         /// <summary>
389         /// The default text's color. Default is white.
390         /// </summary>
391         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
392         [EditorBrowsable(EditorBrowsableState.Never)]
393         public Vector4 TextColor
394         {
395             set
396             {
397                 Interop.RendererParameters.RendererParameters_textColor_set(swigCPtr, Vector4.getCPtr(value));
398                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
399             }
400             get
401             {
402                 Vector4 ret = new Vector4(Interop.RendererParameters.RendererParameters_textColor_get(swigCPtr), true);
403                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
404                 return ret;
405             }
406         }
407
408         /// <summary>
409         /// The font's size (in points).
410         /// </summary>
411         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
412         [EditorBrowsable(EditorBrowsableState.Never)]
413         public float FontSize
414         {
415             set
416             {
417                 Interop.RendererParameters.RendererParameters_fontSize_set(swigCPtr, value);
418                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
419             }
420             get
421             {
422                 float ret = Interop.RendererParameters.RendererParameters_fontSize_get(swigCPtr);
423                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
424                 return ret;
425             }
426         }
427
428         /// <summary>
429         /// The width in pixels of the boundaries where the text is going to be laid-out.
430         /// </summary>
431         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
432         [EditorBrowsable(EditorBrowsableState.Never)]
433         public uint TextWidth
434         {
435             set
436             {
437                 Interop.RendererParameters.RendererParameters_textWidth_set(swigCPtr, value);
438                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
439             }
440             get
441             {
442                 uint ret = Interop.RendererParameters.RendererParameters_textWidth_get(swigCPtr);
443                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
444                 return ret;
445             }
446         }
447
448         /// <summary>
449         /// The height in pixels of the boundaries where the text is going to be laid-out.
450         /// </summary>
451         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
452         [EditorBrowsable(EditorBrowsableState.Never)]
453         public uint TextHeight
454         {
455             set
456             {
457                 Interop.RendererParameters.RendererParameters_textHeight_set(swigCPtr, value);
458                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
459             }
460             get
461             {
462                 uint ret = Interop.RendererParameters.RendererParameters_textHeight_get(swigCPtr);
463                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
464                 return ret;
465             }
466         }
467
468         /// <summary>
469         /// The radius in pixels of the circular text.
470         /// </summary>
471         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
472         [EditorBrowsable(EditorBrowsableState.Never)]
473         public uint Radius
474         {
475             set
476             {
477                 Interop.RendererParameters.RendererParameters_radius_set(swigCPtr, value);
478                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
479             }
480             get
481             {
482                 uint ret = Interop.RendererParameters.RendererParameters_radius_get(swigCPtr);
483                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
484                 return ret;
485             }
486         }
487
488         /// <summary>
489         /// 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°.
490         /// </summary>
491         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
492         [EditorBrowsable(EditorBrowsableState.Never)]
493         public float BeginAngle
494         {
495             set
496             {
497                 Interop.RendererParameters.RendererParameters_beginAngle_set(swigCPtr, value);
498                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
499             }
500             get
501             {
502                 float ret = Interop.RendererParameters.RendererParameters_beginAngle_get(swigCPtr);
503                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
504                 return ret;
505             }
506         }
507
508         /// <summary>
509         /// 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.
510         /// </summary>
511         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
512         [EditorBrowsable(EditorBrowsableState.Never)]
513         public float IncrementAngle
514         {
515             set
516             {
517                 Interop.RendererParameters.RendererParameters_incrementAngle_set(swigCPtr, value);
518                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
519             }
520             get
521             {
522                 float ret = Interop.RendererParameters.RendererParameters_incrementAngle_get(swigCPtr);
523                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
524                 return ret;
525             }
526         }
527
528         /// <summary>
529         /// Whether the ellipsis layout option is enabled.
530         /// </summary>
531         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
532         [EditorBrowsable(EditorBrowsableState.Never)]
533         public bool EllipsisEnabled
534         {
535             set
536             {
537                 Interop.RendererParameters.RendererParameters_ellipsisEnabled_set(swigCPtr, value);
538                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
539             }
540             get
541             {
542                 bool ret = Interop.RendererParameters.RendererParameters_ellipsisEnabled_get(swigCPtr);
543                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
544                 return ret;
545             }
546         }
547
548         /// <summary>
549         /// Whether the mark-up processor is enabled.
550         /// </summary>
551         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
552         [EditorBrowsable(EditorBrowsableState.Never)]
553         public bool MarkupEnabled
554         {
555             set
556             {
557                 Interop.RendererParameters.RendererParameters_markupEnabled_set(swigCPtr, value);
558                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
559             }
560             get
561             {
562                 bool ret = Interop.RendererParameters.RendererParameters_markupEnabled_get(swigCPtr);
563                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
564                 return ret;
565             }
566         }
567
568         /// <summary>
569         /// Whether a default color has been set.
570         /// </summary>
571         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
572         [EditorBrowsable(EditorBrowsableState.Never)]
573         public bool IsTextColorSet
574         {
575             set
576             {
577                 Interop.RendererParameters.RendererParameters_isTextColorSet_set(swigCPtr, value);
578                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
579             }
580             get
581             {
582                 bool ret = Interop.RendererParameters.RendererParameters_isTextColorSet_get(swigCPtr);
583                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
584                 return ret;
585             }
586         }
587
588     }
589
590     /// <summary>
591     /// Class with info of the embedded items layout.
592     /// </summary>
593     // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
594     [EditorBrowsable(EditorBrowsableState.Never)]
595     public class EmbeddedItemInfo : Disposable
596     {
597
598         internal EmbeddedItemInfo(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
599         {
600         }
601
602         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(EmbeddedItemInfo obj)
603         {
604             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
605         }
606
607         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
608         {
609             Interop.EmbeddedItemInfo.delete_EmbeddedItemInfo(swigCPtr);
610         }
611
612         /// <summary>
613         /// Construct EmbeddedItemInfo
614         /// </summary>
615         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
616         [EditorBrowsable(EditorBrowsableState.Never)]
617         public EmbeddedItemInfo() : this(Interop.EmbeddedItemInfo.new_EmbeddedItemInfo__SWIG_0(), true)
618         {
619             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
620         }
621
622         /// <summary>
623         /// Index to the character within the string.
624         /// </summary>
625         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
626         [EditorBrowsable(EditorBrowsableState.Never)]
627         public uint CharacterIndex
628         {
629             set
630             {
631                 Interop.EmbeddedItemInfo.EmbeddedItemInfo_characterIndex_set(swigCPtr, value);
632                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
633             }
634             get
635             {
636                 uint ret = Interop.EmbeddedItemInfo.EmbeddedItemInfo_characterIndex_get(swigCPtr);
637                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
638                 return ret;
639             }
640         }
641
642         /// <summary>
643         /// Index to the glyph
644         /// </summary>
645         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
646         [EditorBrowsable(EditorBrowsableState.Never)]
647         public uint GlyphIndex
648         {
649             set
650             {
651                 Interop.EmbeddedItemInfo.EmbeddedItemInfo_glyphIndex_set(swigCPtr, value);
652                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
653             }
654             get
655             {
656                 uint ret = Interop.EmbeddedItemInfo.EmbeddedItemInfo_glyphIndex_get(swigCPtr);
657                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
658                 return ret;
659             }
660         }
661
662         /// <summary>
663         /// The layout position within the buffer (top, left corner).
664         /// </summary>
665         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
666         [EditorBrowsable(EditorBrowsableState.Never)]
667         public Vector2 Position
668         {
669             set
670             {
671                 Interop.EmbeddedItemInfo.EmbeddedItemInfo_position_set(swigCPtr, Vector2.getCPtr(value));
672                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
673             }
674             get
675             {
676                 Vector2 ret = new Vector2(Interop.EmbeddedItemInfo.EmbeddedItemInfo_position_get(swigCPtr), swigCMemOwn);
677                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
678                 return ret;
679             }
680         }
681
682         /// <summary>
683         /// The size within the buffer of the embedded item.
684         /// </summary>
685         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
686         [EditorBrowsable(EditorBrowsableState.Never)]
687         public Size Size
688         {
689             set
690             {
691                 Interop.EmbeddedItemInfo.EmbeddedItemInfo_size_set(swigCPtr, Size.getCPtr(value));
692                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
693             }
694             get
695             {
696                 Size ret = new Size(Interop.EmbeddedItemInfo.EmbeddedItemInfo_size_get(swigCPtr), swigCMemOwn);
697                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
698                 return ret;
699             }
700         }
701
702         /// <summary>
703         /// The rotated size within the buffer of the embedded item.
704         /// </summary>
705         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
706         [EditorBrowsable(EditorBrowsableState.Never)]
707         public Size RotatedSize
708         {
709             set
710             {
711                 Interop.EmbeddedItemInfo.EmbeddedItemInfo_rotatedSize_set(swigCPtr, Size.getCPtr(value));
712                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
713             }
714             get
715             {
716                 Size ret = new Size(Interop.EmbeddedItemInfo.EmbeddedItemInfo_rotatedSize_get(swigCPtr), swigCMemOwn);
717                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
718                 return ret;
719             }
720         }
721
722         /// <summary>
723         /// Rotation angle of the pixel buffer in degrees.
724         /// </summary>
725         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
726         [EditorBrowsable(EditorBrowsableState.Never)]
727         public Degree Angle
728         {
729             set
730             {
731                 Interop.EmbeddedItemInfo.EmbeddedItemInfo_angle_set(swigCPtr, Degree.getCPtr(value));
732                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
733             }
734             get
735             {
736                 Degree ret = new Degree(Interop.EmbeddedItemInfo.EmbeddedItemInfo_angle_get(swigCPtr), swigCMemOwn);
737                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
738                 return ret;
739             }
740         }
741
742         /// <summary>
743         /// Whether the color of the image is multiplied by the color of the text.
744         /// </summary>
745         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
746         [EditorBrowsable(EditorBrowsableState.Never)]
747         public Tizen.NUI.ColorBlendingMode ColorBlendingMode
748         {
749             set
750             {
751                 Interop.EmbeddedItemInfo.EmbeddedItemInfo_colorBlendingMode_set(swigCPtr, value);
752                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
753             }
754             get
755             {
756                 Tizen.NUI.ColorBlendingMode ret = Interop.EmbeddedItemInfo.EmbeddedItemInfo_colorBlendingMode_get(swigCPtr);
757                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
758                 return ret;
759             }
760         }
761     }
762
763     /// <summary>
764     /// Class with the parameters needed to build a shadow for the given pixel buffer.
765     /// </summary>
766     // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
767     [EditorBrowsable(EditorBrowsableState.Never)]
768     public class ShadowParameters : Disposable
769     {
770
771         internal ShadowParameters(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
772         {
773         }
774
775         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ShadowParameters obj)
776         {
777             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
778         }
779
780         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
781         {
782             Interop.ShadowParameters.delete_ShadowParameters(swigCPtr);
783         }
784
785         /// <summary>
786         /// Construct ShadowParameters
787         /// </summary>
788         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
789         [EditorBrowsable(EditorBrowsableState.Never)]
790         public ShadowParameters() : this(Interop.ShadowParameters.new_ShadowParameters__SWIG_0(), true)
791         {
792             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
793         }
794
795         /// <summary>
796         /// The input pixel buffer used to create the shadow.
797         /// </summary>
798         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
799         [EditorBrowsable(EditorBrowsableState.Never)]
800         public PixelBuffer Input
801         {
802             set
803             {
804                 Interop.ShadowParameters.ShadowParameters_input_set(swigCPtr, PixelBuffer.getCPtr(value));
805                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
806             }
807             get
808             {
809                 PixelBuffer ret = new PixelBuffer(Interop.ShadowParameters.ShadowParameters_input_get(swigCPtr), true);
810                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
811                 return ret;
812             }
813         }
814
815         /// <summary>
816         /// The color of the text.
817         /// </summary>
818         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
819         [EditorBrowsable(EditorBrowsableState.Never)]
820         public Vector4 TextColor
821         {
822             set
823             {
824                 Interop.ShadowParameters.ShadowParameters_textColor_set(swigCPtr, Vector4.getCPtr(value));
825                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
826             }
827             get
828             {
829                 Vector4 ret = new Vector4(Interop.ShadowParameters.ShadowParameters_textColor_get(swigCPtr), true);
830                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
831                 return ret;
832             }
833         }
834
835         /// <summary>
836         /// The color of the shadow.
837         /// </summary>
838         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
839         [EditorBrowsable(EditorBrowsableState.Never)]
840         public Vector4 Color
841         {
842             set
843             {
844                 Interop.ShadowParameters.ShadowParameters_color_set(swigCPtr, Vector4.getCPtr(value));
845                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
846             }
847             get
848             {
849                 Vector4 ret = new Vector4(Interop.ShadowParameters.ShadowParameters_color_get(swigCPtr), true);
850                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
851                 return ret;
852             }
853         }
854
855         /// <summary>
856         /// The offset of the shadow.
857         /// </summary>
858         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
859         [EditorBrowsable(EditorBrowsableState.Never)]
860         public Vector2 Offset
861         {
862             set
863             {
864                 Interop.ShadowParameters.ShadowParameters_offset_set(swigCPtr, Vector2.getCPtr(value));
865                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
866             }
867             get
868             {
869                 Vector2 ret = new Vector2(Interop.ShadowParameters.ShadowParameters_offset_get(swigCPtr), true);
870                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
871                 return ret;
872             }
873         }
874
875         /// <summary>
876         /// Whether to blend the shadow.
877         /// </summary>
878         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
879         [EditorBrowsable(EditorBrowsableState.Never)]
880         public bool blendShadow
881         {
882             set
883             {
884                 Interop.ShadowParameters.ShadowParameters_blendShadow_set(swigCPtr, value);
885                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
886             }
887             get
888             {
889                 bool ret = Interop.ShadowParameters.ShadowParameters_blendShadow_get(swigCPtr);
890                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
891                 return ret;
892             }
893         }
894     }
895
896     // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
897     [EditorBrowsable(EditorBrowsableState.Never)]
898     public static partial class TextUtils
899     {
900         /// <summary>
901         /// Renders text into a pixel buffer.
902         /// @note: Can process a mark-up string.
903         /// @note: It does the font selection, RTL reordering, shaping and layouting.
904         /// @note: The width of the pixel buffer may be different to the given @e textWidth
905         ///        due to some padding pixels added.
906         ///
907         ///  The text is laid-out for the given size @e (textWidth,textHeight).
908         ///  If the @e multiLineEnabled option is enabled, the text will wrap in lines.
909         ///  If the @e ellipsisEnabled option is enabled, the text will be ellided if
910         ///  there is no more space for new lines.
911         ///
912         ///  It won't be rendered the parts of the text exceeding the boundaries of
913         ///  the given width and height.
914         ///
915         ///  If the given @e textHeight is zero, a big enough pixel buffer will be created
916         ///  to render the full text.
917         ///
918         ///  If the given @e textWidth is zero, the 'natural size' of the text will be
919         ///  used to create the pixel buffer to render the full text.
920         ///
921         ///  If the radius is not zero, the text will be laid-out following a circular path.
922         ///  In that case the text is laid-out in a single line.
923         ///
924         /// If the mark-up string contains embedded items, the @p embeddedItemLayout vector
925         /// contains the layout info of each embedded item.
926         /// </summary>
927         /// <param name="textParameters">The text and style options.</param>
928         /// <param name="embeddedItemLayout">The layout info of the embedded items</param>
929         /// <returns>A pixel buffer with the text rendered on it.</returns>
930         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
931         [EditorBrowsable(EditorBrowsableState.Never)]
932         public static PixelBuffer Render(RendererParameters textParameters, ref EmbeddedItemInfo[] embeddedItemLayout)
933         {
934             int count = 0;
935             int length = 0;
936             global::System.IntPtr returnItem = IntPtr.Zero;
937             PixelBuffer ret = new PixelBuffer(Interop.TextUtils.TextUtils_Render(RendererParameters.getCPtr(textParameters), ref returnItem, ref count, ref length), true);
938
939             embeddedItemLayout = new EmbeddedItemInfo[count];
940             for(int i=0; i< count; i++) {
941                 IntPtr p = new IntPtr((returnItem.ToInt32() + i * length));
942                 embeddedItemLayout[i] = new EmbeddedItemInfo(p, false);
943             }
944             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
945             return ret;
946         }
947
948         /// <summary>
949         /// Creates a shadow for the text given in the input pixel buffer.
950         /// The function returns a RGBA8888 pixel buffer with the text and its shadow rendered on it.
951         ///
952         /// The pixel format of the @e input pixel buffer could be an A8 or an RGBA8888. If it's
953         /// an A8 pixel buffer, it uses the given @e textColor to give color to the text. Otherwise
954         /// it uses the color of the @e input pixel buffer.
955         /// </summary>
956         /// <param name="shadowParameters">The parameters needed to create the text's shadow.</param>
957         /// <returns>A pixel buffer with the text and the shadow rendered on it.</returns>
958         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
959         [EditorBrowsable(EditorBrowsableState.Never)]
960         public static PixelBuffer CreateShadow(ShadowParameters shadowParameters)
961         {
962             PixelBuffer ret = new PixelBuffer(Interop.TextUtils.TextUtils_CreateShadow(ShadowParameters.getCPtr(shadowParameters)), true);
963             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
964             return ret;
965         }
966
967         /// <summary>
968         /// Converts a @p pixelBuffer with pixel format A8 to RGBA8888 using the given @p color.
969         /// @note Does nothing if the @p pixelBuffer is not A8.
970         /// </summary>
971         /// <param name="pixelBuffer">The pixel buffer with pixel format A8</param>
972         /// <param name="color">The color used to convert to RGBA8888</param>
973         /// <param name="multiplyByAlpha">multiplyByAlpha Whether to multiply the @p color with the alpha value of the @p pixel @p buffer.</param>
974         /// <returns>The pixel buffer converted to RGBA8888.</returns>
975         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
976         [EditorBrowsable(EditorBrowsableState.Never)]
977         public static PixelBuffer ConvertToRgba8888(PixelBuffer pixelBuffer, Vector4 color, bool multiplyByAlpha)
978         {
979             PixelBuffer ret = new PixelBuffer(Interop.TextUtils.TextUtils_ConvertToRgba8888(PixelBuffer.getCPtr(pixelBuffer), Vector4.getCPtr(color), multiplyByAlpha), true);
980             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
981             return ret;
982         }
983
984         /// <summary>
985         /// Updates the @p dst pixel buffer with the data from @p src pixel buffer.
986         /// @note Both pixel buffers must have the same pixel format. Does nothing if both pixel format are different.
987         /// @note The function does nothing if the @p src pixel buffer doesn't fit into the @p dst pixel buffer.
988         ///
989         /// The @p src pixel buffer could be blended with the @p dst pixel buffer if @p blend is set to @e true.
990         /// </summary>
991         /// <param name="src">The pixel buffer from where the data is read.</param>
992         /// <param name="dst">The pixel buffer where the data is written.</param>
993         /// <param name="x">The top left corner's X within the destination pixel buffer.</param>
994         /// <param name="y">The top left corner's y within the destination pixel buffer.</param>
995         /// <param name="blend">Whether to blend the source pixel buffer with the destination pixel buffer as background.</param>
996         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
997         [EditorBrowsable(EditorBrowsableState.Never)]
998         public static void UpdateBuffer(PixelBuffer src, PixelBuffer dst, uint x, uint y, bool blend)
999         {
1000             Interop.TextUtils.TextUtils_UpdateBuffer(PixelBuffer.getCPtr(src), PixelBuffer.getCPtr(dst), x, y, blend);
1001             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1002         }
1003
1004         /// <summary>
1005         /// Splits the text in pages of the size given in @p textParameters
1006         /// @note The returned indices are indices to utf32 characters. The input text is encoded in utf8.
1007         /// <returns> An array with the indices of the last character of each page
1008         [EditorBrowsable(EditorBrowsableState.Never)]
1009         public static Tizen.NUI.PropertyArray GetLastCharacterIndex(RendererParameters textParameters)
1010         {
1011             Tizen.NUI.PropertyArray ret = new Tizen.NUI.PropertyArray(Interop.TextUtils.TextUtils_GetLastCharacterIndex(RendererParameters.getCPtr(textParameters)), true);
1012             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1013             return ret;
1014         }
1015     }
1016
1017 }