1 /* Copyright (c) 2021 Samsung Electronics Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
18 using System.ComponentModel;
20 namespace Tizen.NUI.Components
23 /// Base interface for encapsulated data source in RecyclerView.
25 [EditorBrowsable(EditorBrowsableState.Never)]
26 public interface IItemSource : IDisposable
29 /// Count of data source.
31 [EditorBrowsable(EditorBrowsableState.Never)]
35 /// Position integer value of data object.
37 [EditorBrowsable(EditorBrowsableState.Never)]
38 int GetPosition(object item);
41 /// Item object in position.
43 [EditorBrowsable(EditorBrowsableState.Never)]
44 object GetItem(int position);
47 /// Flag of header existence.
49 [EditorBrowsable(EditorBrowsableState.Never)]
50 bool HasHeader { get; set; }
53 /// Flag of Footer existence.
55 [EditorBrowsable(EditorBrowsableState.Never)]
56 bool HasFooter { get; set; }
59 /// Boolean checker for position is header or not.
60 /// 0 index will be header if header exist.
61 /// warning: if header exist, all item index will be increased.
63 /// <param name="position">The position for checking header.</param>
64 [EditorBrowsable(EditorBrowsableState.Never)]
65 bool IsHeader(int position);
68 /// Boolean checker for position is footer or not.
69 /// last index will be footer if footer exist.
70 /// warning: footer will be place original data count or data count + 1.
72 /// <param name="position">The position for checking footer.</param>
73 [EditorBrowsable(EditorBrowsableState.Never)]
74 bool IsFooter(int position);
78 /// Base interface for encapsulated data source with group structure in CollectionView.
80 [EditorBrowsable(EditorBrowsableState.Never)]
81 public interface IGroupableItemSource : IItemSource
84 /// Boolean checker for position is group header or not
86 /// <param name="position">The position for checking group header.</param>
87 [EditorBrowsable(EditorBrowsableState.Never)]
88 bool IsGroupHeader(int position);
91 /// Boolean checker for position is group footer or not
93 /// <param name="position">The position for checking group footer.</param>
94 [EditorBrowsable(EditorBrowsableState.Never)]
95 bool IsGroupFooter(int position);
98 /// Boolean checker for position is group footer or not
100 /// <param name="position">The position for checking group footer.</param>
101 [EditorBrowsable(EditorBrowsableState.Never)]
102 object GetGroupParent(int position);