0e68977beb6839a30ae44cb38096494d95cf44eb
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / layouting / layout-item-data-impl.h
1 #ifndef DALI_TOOLKIT_INTERNAL_LAYOUTING_LAYOUT_BASE_DATA_IMPL_H_H
2 #define DALI_TOOLKIT_INTERNAL_LAYOUTING_LAYOUT_BASE_DATA_IMPL_H_H
3
4 /*
5  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19
20 #include <dali-toolkit/devel-api/layouting/layout-item-impl.h>
21 #include <dali-toolkit/devel-api/layouting/layout-controller.h>
22 #include <dali-toolkit/devel-api/layouting/layout-size.h>
23 #include <dali-toolkit/internal/layouting/layout-transition-data-impl.h>
24
25 namespace Dali
26 {
27 namespace Toolkit
28 {
29 namespace Internal
30 {
31
32 class LayoutItem::Impl
33 {
34 public:
35   Impl();
36
37 public:
38   BaseObject* mOwner; ///< Control or Visual that owns this layout. Raw pointer to prevent cyclic references
39   LayoutParent* mLayoutParent; ///< The containing layout parent.
40
41   MeasureSpec mOldWidthMeasureSpec;
42   MeasureSpec mOldHeightMeasureSpec;
43   LayoutSize mMinimumSize;
44
45   MeasuredSize mMeasuredWidth;
46   MeasuredSize mMeasuredHeight;
47
48   LayoutLength mLeft;
49   LayoutLength mRight;
50   LayoutLength mTop;
51   LayoutLength mBottom;
52
53   static const int PRIVATE_FLAG_MEASURED_DIMENSION_SET        = 0x00000001;
54   static const int PRIVATE_FLAG_FORCE_LAYOUT                  = 0x00000002;
55   static const int PRIVATE_FLAG_LAYOUT_REQUIRED               = 0x00000004;
56   static const int PRIVATE_FLAG_IS_LAID_OUT                   = 0x00000008;
57   static const int PRIVATE_FLAG_MEASURE_NEEDED_BEFORE_LAYOUT  = 0x00000010; ///< Flag indicating that a call to measure() was skipped and should be done instead when layout() is invoked.
58   static const int PRIVATE_FLAG_FORCE_SET_FRAME               = 0x00000020;
59   static const int PRIVATE_FLAG_USE_RESIZE_POLICY             = 0x00000040;
60
61   int mViewFlags;
62   int mPrivateFlags;
63
64   bool mAnimated;
65
66   inline void ClearPrivateFlag( int flag )
67   {
68     mPrivateFlags &= ~flag;
69   }
70
71   inline void SetPrivateFlag( int flag )
72   {
73     mPrivateFlags |= flag;
74   }
75
76   inline bool GetPrivateFlag( int flag )
77   {
78     return ( mPrivateFlags & flag ) != 0;
79   }
80
81   static bool sUseZeroUnspecifiedMeasureSpec;
82
83   LayoutTransitionDataPtr mOnChildAddTransitionData;
84   LayoutTransitionDataPtr mOnChildRemoveTransitionData;
85   LayoutTransitionDataPtr mOnOwnerSetTransitionData;
86   LayoutTransitionDataPtr mDefaultTransitionData;
87
88   // To pass layout data during perform layout
89   static LayoutData* sLayoutData;
90 };
91
92 } // namespace Internal
93 } // namespace Toolkit
94 } // namespace Dali
95
96 #endif //DALI_TOOLKIT_INTERNAL_LAYOUTING_LAYOUT_BASE_DATA_IMPL_H_H