[NUI] Integreation from dalihub (#988)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / Layouting / MeasureSpecification.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.ComponentModel;
19 using Tizen.NUI.BaseComponents;
20
21 namespace Tizen.NUI
22 {
23     /// <summary>
24     /// [Draft] A MeasureSpecification is used during the Measure pass by a LayoutGroup to inform it's children how to be measured.
25     /// For instance, it may measure a child with an exact width and an unspecified height in order to determine height for width.
26     /// </summary>
27     internal struct MeasureSpecification
28     {
29         /// <summary>
30         /// MeasureSpecification Size value.
31         /// </summary>
32         public LayoutLength Size;
33
34         /// <summary>
35         /// MeasureSpecification Mode.
36         /// </summary>
37         public MeasureSpecification.ModeType Mode;
38
39         /// <summary>
40         /// Constructor taking size and mode type.
41         /// </summary>
42         /// <param name="size">size value.</param>
43         /// <param name="mode">mode vaue.</param>
44         public MeasureSpecification(LayoutLength size, MeasureSpecification.ModeType mode)
45         {
46             Size = size;
47             Mode = mode;
48         }
49
50         public enum ModeType
51         {
52             /// <summary>
53             /// This is used by a parent to determine the desired dimension of a child layout.
54             /// </summary>
55             Unspecified,
56             /// <summary>
57             /// This is used by a parent to impose an exact size on the child.
58             /// The child must use this size, and guarantee that all of its descendants will fit within this size.
59             /// </summary>
60             Exactly,
61             /// <summary>
62             /// This is used by the parent to impose a maximum size on the child.
63             /// The child must guarantee that it and all of it's descendants will fit within this size.
64             /// </summary>
65             AtMost
66         }
67     }
68 }