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