c67a17c3d3c82a8e9262a94004f765c60c2950e0
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / 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     public struct MeasureSpecification
28     {
29         /// <summary>
30         /// MeasureSpecification Size value.
31         /// </summary>
32         /// <since_tizen> 6 </since_tizen>
33         public LayoutLength Size;
34
35         /// <summary>
36         /// MeasureSpecification Mode.
37         /// </summary>
38         /// <since_tizen> 6 </since_tizen>
39         public MeasureSpecification.ModeType Mode;
40
41         /// <summary>
42         /// Constructor taking size and mode type.
43         /// </summary>
44         /// <param name="size">size value.</param>
45         /// <param name="mode">mode value.</param>
46         /// <since_tizen> 6 </since_tizen>
47         public MeasureSpecification(LayoutLength size, MeasureSpecification.ModeType mode)
48         {
49             Size = size;
50             Mode = mode;
51         }
52
53         /// <summary>
54         /// Size mode for this MeasureSpecification
55         /// </summary>
56         /// <since_tizen> 6 </since_tizen>
57         public enum ModeType
58         {
59             /// <summary>
60             /// This is used by a parent to determine the desired dimension of a child layout.
61             /// </summary>
62             Unspecified,
63             /// <summary>
64             /// This is used by a parent to impose an exact size on the child.
65             /// The child must use this size, and guarantee that all of its descendants will fit within this size.
66             /// </summary>
67             Exactly,
68             /// <summary>
69             /// This is used by the parent to impose a maximum size on the child.
70             /// The child must guarantee that it and all of it's descendants will fit within this size.
71             /// </summary>
72             AtMost
73         }
74     }
75 }