[NUI] Change Paint to Drawable and fix typo
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / VectorGraphcis / Drawable.cs
1 /*
2 * Copyright(c) 2021 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 using System.ComponentModel;
18
19 namespace Tizen.NUI.BaseComponents
20 {
21     namespace VectorGraphics
22     {
23         /// <summary>
24         /// Drawable is a object class for drawing a vector primitive.
25         /// </summary>
26         [EditorBrowsable(EditorBrowsableState.Never)]
27         public class Drawable : BaseHandle
28         {
29             /// <summary>
30             /// Creates an initialized drawable.
31             /// </summary>
32             [EditorBrowsable(EditorBrowsableState.Never)]
33             private Drawable() {}
34
35             internal Drawable(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
36             {
37             }
38
39             /// <summary>
40             /// Get the transparency value
41             /// </summary>
42             /// <returns>The transparency level</returns>
43             [EditorBrowsable(EditorBrowsableState.Never)]
44             public float GetOpacity()
45             {   
46                 return Interop.Drawable.GetOpacity(BaseHandle.getCPtr(this));
47             }
48
49             /// <summary>
50             /// Set the transparency value
51             /// </summary>
52             /// <param name="opacity">The transparency level [0 ~ 1.0], 0 means totally transparent, while 1 means opaque.</param>
53             /// <returns>True when it's successful. False otherwise.</returns>
54             [EditorBrowsable(EditorBrowsableState.Never)]
55             public bool SetOpacity(float opacity)
56             {   
57                 if (Interop.Drawable.SetOpacity(BaseHandle.getCPtr(this), opacity))
58                     return true;
59                 return false;
60             }
61
62             /// <summary>
63             /// Set the angle of rotation transformation.
64             /// </summary>
65             /// <param name="degree">The degree value of angle.</param>
66             /// <returns>True when it's successful. False otherwise.</returns>
67             [EditorBrowsable(EditorBrowsableState.Never)]
68             public bool Rotate(float degree)
69             {   
70                 if (Interop.Drawable.Rotate(BaseHandle.getCPtr(this), degree))
71                     return true;
72                 return false;
73             }
74
75             /// <summary>
76             /// Set the scale value of scale transformation.
77             /// </summary>
78             /// <param name="factor">The scale factor value.</param>
79             /// <returns>True when it's successful. False otherwise.</returns>
80             [EditorBrowsable(EditorBrowsableState.Never)]
81             public bool Scale(float factor)
82             {   
83                 if (Interop.Drawable.Scale(BaseHandle.getCPtr(this), factor))
84                     return true;
85                 return false;
86             }
87
88             /// <summary>
89             /// Set the matrix value for affine transform.
90             /// </summary>
91             /// <param name="matrix">The float type array of 3x3 matrix.</param>
92             /// <returns>True when it's successful. False otherwise.</returns>
93             [EditorBrowsable(EditorBrowsableState.Never)]
94             public bool Transform(float[] matrix)
95             {   
96                 if (Interop.Drawable.Transform(BaseHandle.getCPtr(this), matrix))
97                     return true;
98                 return false;
99             }
100
101             /// <summary>
102             /// Set the x, y movement value of translate transformation.
103             /// </summary>
104             /// <param name="x">The x-axis movement value.</param>
105             /// <param name="y">The y-axis movement value.</param>
106             /// <returns>True when it's successful. False otherwise.</returns>
107             [EditorBrowsable(EditorBrowsableState.Never)]
108             public bool Translate(float x, float y)
109             {   
110                 if (Interop.Drawable.Translate(BaseHandle.getCPtr(this), x, y))
111                     return true;
112                 return false;
113             }
114         }
115     }
116 }