[NUI] Fix text padding issue
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / ViewSelectorData.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
18 using System;
19 using System.Diagnostics;
20
21 namespace Tizen.NUI.BaseComponents
22 {
23     /// <summary>
24     /// The class storing extra selector properties of view that is rared used.
25     /// </summary>
26     internal class ViewSelectorData
27     {
28         internal ViewSelectorData() { }
29
30         public TriggerableSelector<Color> BackgroundColor{ get; set; }
31         public TriggerableSelector<string> BackgroundImage{ get; set; }
32         public TriggerableSelector<Rectangle> BackgroundImageBorder{ get; set; }
33         public TriggerableSelector<Color> Color{ get; set; }
34         public TriggerableSelector<float?> Opacity{ get; set; }
35         public TriggerableSelector<ImageShadow> ImageShadow{ get; set; }
36         public TriggerableSelector<Shadow> BoxShadow{ get; set; }
37         public TriggerableSelector<Color> BorderlineColor{ get; set; }
38
39         public void ClearBackground(View view)
40         {
41             BackgroundColor?.Reset(view);
42             BackgroundImage?.Reset(view);
43             BackgroundImageBorder?.Reset(view);
44             BackgroundColor = null;
45             BackgroundImage = null;
46             BackgroundImageBorder = null;
47         }
48         public void ClearShadow(View view)
49         {
50             ImageShadow?.Reset(view);
51             BoxShadow?.Reset(view);
52             ImageShadow = null;
53             BoxShadow = null;
54         }
55
56         public void Reset(View view)
57         {
58             BackgroundColor?.Reset(view);
59             BackgroundImage?.Reset(view);
60             BackgroundImageBorder?.Reset(view);
61             Color?.Reset(view);
62             Opacity?.Reset(view);
63             ImageShadow?.Reset(view);
64             BoxShadow?.Reset(view);
65             BorderlineColor?.Reset(view);
66         }
67     }
68 }
69
70