Merge "Add comments for ElmSharp APIs." into tizen
[platform/core/csapi/tizenfx.git] / src / ElmSharp / ElmSharp / GenGridItem.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="GenItem"/>.
23     /// A instance to the gengrid item added.
24     /// It contains Update() method to update a gengrid item which is given.
25     /// </summary>
26     public class GenGridItem : GenItem
27     {
28         internal GenGridItem(object data, GenItemClass itemClass) : base(data, itemClass)
29         {
30         }
31
32         /// <summary>
33         /// Gets or sets whether a given gengrid item is selected.
34         /// If one gengrid item is selected, any other previously selected items get unselected in favor of this new one.
35         /// </summary>
36         /// <remarks>
37         /// If true, it is selected.
38         /// If false, it is unselected.
39         /// </remarks>
40         public override bool IsSelected
41         {
42             get
43             {
44                 return Interop.Elementary.elm_gengrid_item_selected_get(Handle);
45             }
46             set
47             {
48                 Interop.Elementary.elm_gengrid_item_selected_set(Handle, value);
49             }
50         }
51
52         /// <summary>
53         /// Updates the content of a given gengrid item.
54         /// This updates an item by calling all the genitem class functions again to get the content, text, and states.
55         /// Use this when the original item data has changed and you want the changes to reflect.
56         /// </summary>
57         /// <remarks>
58         /// <see cref="GenGrid.UpdateRealizedItems"/> to update the contents of all the realized items.
59         /// </remarks>
60         public override void Update()
61         {
62             Interop.Elementary.elm_gengrid_item_update(Handle);
63         }
64     }
65 }