[NUI] Fix Switch selection bug. (#1798)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / Controls / Extension / SwitchExtension.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 using System.ComponentModel;
18 using Tizen.NUI.BaseComponents;
19
20 namespace Tizen.NUI.Components.Extension
21 {
22     /// <summary>
23     /// The SwitchExtension class allows developers to access the Switch's components and extend their behavior in various states.
24     /// </summary>
25     [EditorBrowsable(EditorBrowsableState.Never)]
26     public abstract class SwitchExtension : ButtonExtension
27     {
28         internal SwitchExtension() : base()
29         {
30         }
31
32         /// <summary>
33         /// Called immediately after the Switch creates the track part.
34         /// </summary>
35         /// <param name="switchButton">The Switch instance that the extension currently applied to.</param>
36         /// <param name="track">The created Switch's track part.</param>
37         /// <return>The refined switch track.</return>
38         [EditorBrowsable(EditorBrowsableState.Never)]
39         public virtual ImageView OnCreateTrack(Switch switchButton, ImageView track)
40         {
41             return track;
42         }
43
44         /// <summary>
45         /// Called immediately after the Switch creates the thumb part.
46         /// </summary>
47         /// <param name="switchButton">The Switch instance that the extension currently applied to.</param>
48         /// <param name="thumb">The created Switch's thumb part.</param>
49         /// <return>The refined switch thumb.</return>
50         [EditorBrowsable(EditorBrowsableState.Never)]
51         public virtual ImageView OnCreateThumb(Switch switchButton, ImageView thumb)
52         {
53             return thumb;
54         }
55
56         /// <summary>
57         /// Called when the Switch's selection has changed.
58         /// </summary>
59         /// <param name="switchButton">The Switch instance that the extension currently applied to.</param>
60         [EditorBrowsable(EditorBrowsableState.Never)]
61         public virtual void OnSelectedChanged(Switch switchButton)
62         {
63         }
64     }
65 }