Release 4.0.0-preview1-00051
[platform/core/csapi/tizenfx.git] / src / ElmSharp / ElmSharp / MultiButtonEntryItem.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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
19 namespace ElmSharp
20 {
21     /// <summary>
22     /// It inherits <see cref="ItemObject"/>.
23     /// MutltiButtonEntryItem is a item which is added to MultiButtonEntry.
24     /// It contains Next and Prev properties to get next and previous item.
25     /// </summary>
26     public class MultiButtonEntryItem : ItemObject
27     {
28         /// <summary>
29         /// Creates and initializes a new instance of the MultiButtonEntryItem class.
30         /// </summary>
31         /// <param name="text">The text of MultiButtonEntryItem's Label name.</param>
32         public MultiButtonEntryItem(string text) : base(IntPtr.Zero)
33         {
34             Label = text;
35         }
36
37         internal MultiButtonEntryItem(IntPtr handle) : base(handle)
38         {
39             Label = Interop.Elementary.elm_object_item_part_text_get(handle, null);
40         }
41
42         /// <summary>
43         /// Gets the label of this item.
44         /// </summary>
45         public string Label { get; private set; }
46
47         /// <summary>
48         /// Gets or sets the selected state of an item.
49         /// </summary>
50         public bool IsSelected
51         {
52             get
53             {
54                 return Interop.Elementary.elm_multibuttonentry_item_selected_get(Handle);
55             }
56             set
57             {
58                 Interop.Elementary.elm_multibuttonentry_item_selected_set(Handle, value);
59             }
60         }
61
62         /// <summary>
63         /// Get the next item in the multibuttonentry.
64         /// </summary>
65         public MultiButtonEntryItem Next
66         {
67             get
68             {
69                 var next = Interop.Elementary.elm_multibuttonentry_item_next_get(Handle);
70                 return ItemObject.GetItemByHandle(next) as MultiButtonEntryItem;
71             }
72         }
73
74         /// <summary>
75         /// Get the previous item in the multibuttonentry.
76         /// </summary>
77         public MultiButtonEntryItem Prev
78         {
79             get
80             {
81                 var prev = Interop.Elementary.elm_multibuttonentry_item_prev_get(Handle);
82                 return ItemObject.GetItemByHandle(prev) as MultiButtonEntryItem;
83             }
84         }
85     }
86 }