[NUI] Merge Layout related changes from dalihub (#968)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / Layouting / LayoutData.cs
1 /*
2  * Copyright (c) 2019 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
18 using System.Collections.Generic;
19 using System;
20 using System.ComponentModel;
21
22 namespace Tizen.NUI
23 {
24     /// <summary>
25     /// The conditions for transitions.
26     /// </summary>
27     [FlagsAttribute]
28     /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
29     [EditorBrowsable(EditorBrowsableState.Never)]
30     public enum TransitionCondition
31     {
32         /// <summary>
33         /// Default when a condition has not been set.
34         /// </summary>
35         /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
36         [EditorBrowsable(EditorBrowsableState.Never)]
37         Unspecified = 0,
38
39         /// <summary>
40         /// Animate changing layout to another layout.
41         /// </summary>
42         /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
43         [EditorBrowsable(EditorBrowsableState.Never)]
44         LayoutChanged = 1,
45
46         /// <summary>
47         /// Animate adding item.
48         /// </summary>
49         /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
50         [EditorBrowsable(EditorBrowsableState.Never)]
51         Add = 2,
52
53         /// <summary>
54         /// Animate removing item.
55         /// </summary>
56         /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
57         [EditorBrowsable(EditorBrowsableState.Never)]
58         Remove = 4,
59
60         /// <summary>
61         /// Animation when an item changes due to a sibbling being added.
62         /// </summary>
63         /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
64         [EditorBrowsable(EditorBrowsableState.Never)]
65         ChangeOnAdd = 8,
66
67         /// <summary>
68         /// Animation when an item changes due to a sibbling being removed.
69         /// </summary>
70         /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
71         [EditorBrowsable(EditorBrowsableState.Never)]
72         ChangeOnRemove = 16
73     }
74
75     /// <summary>
76     /// [Draft] Class to hold layout animation and position data
77     /// </summary>
78     internal struct LayoutData
79     {
80         /// <summary>
81         /// [Draft] Initialized constructor
82         /// </summary>
83         /// <param name="item">Layout item.</param>
84         /// <param name="condition">Condition for the position values.</param>
85         /// <param name="left">Left position.</param>
86         /// <param name="top">Top position.</param>
87         /// <param name="right">Right position.</param>
88         /// <param name="bottom">Bottom position.</param>
89         public LayoutData( LayoutItem item, TransitionCondition condition, float left, float top, float right, float bottom )
90         {
91             Item = item;
92             ConditionForAnimation = condition;
93             Left = left;
94             Top = top;
95             Right = right;
96             Bottom = bottom;
97         }
98
99         public LayoutItem Item{ get;}
100
101         public TransitionCondition ConditionForAnimation{get;}
102
103         public float Left{get;}
104         public float Top{get;}
105         public float Right{get;}
106         public float Bottom{get;}
107
108     };
109
110 } // namespace Tizen.NUI