c2c8a3e1f5f8296bb7051f6236eaf0345e4ee2ea
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / Controls / TabButtonGroup.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;
18 using System.ComponentModel;
19 using Tizen.NUI.BaseComponents;
20
21 namespace Tizen.NUI.Components
22 {
23     /// <summary>
24     /// TabButtonGroup class is used to group together a set of TabButton controls.
25     /// It enables a user to select exclusively single TabButton of a group.
26     /// </summary>
27     [EditorBrowsable(EditorBrowsableState.Never)]
28     public class TabButtonGroup : SelectGroup
29     {
30         /// <summary>
31         /// Constructs TabButtonGroup
32         /// </summary>
33         [EditorBrowsable(EditorBrowsableState.Never)]
34         public TabButtonGroup() : base()
35         {
36             EnableMultiSelection = false;
37         }
38
39         /// <summary>
40         /// Adds a tab button to the end of TabButtonGroup.
41         /// </summary>
42         /// <param name="tabButton">A tab button to be added to the group.</param>
43         /// <exception cref="ArgumentNullException">Thrown when the argument tabButton is null.</exception>
44         [EditorBrowsable(EditorBrowsableState.Never)]
45         public void Add(TabButton tabButton)
46         {
47             if (tabButton == null)
48             {
49                 throw new ArgumentNullException(nameof(tabButton), "tabButton should not be null.");
50             }
51
52             base.AddSelection(tabButton);
53         }
54
55         /// <summary>
56         /// Removes a tab button from TabButtonGroup.
57         /// </summary>
58         /// <param name="tabButton">A tab button to be removed from the group.</param>
59         /// <exception cref="ArgumentNullException">Thrown when the argument tabButton is null.</exception>
60         [EditorBrowsable(EditorBrowsableState.Never)]
61         public void Remove(TabButton tabButton)
62         {
63             if (tabButton == null)
64             {
65                 throw new ArgumentNullException(nameof(tabButton), "tabButton should not be null.");
66             }
67
68             base.RemoveSelection(tabButton);
69         }
70     }
71 }