Add animated vector image visual
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / custom-layout.h
1 #ifndef TEST_CUSTOM_LAYOUT_H
2 #define TEST_CUSTOM_LAYOUT_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 // EXTERNAL INCLUDES
21 #include <dali/public-api/object/base-handle.h>
22 #include <dali-toolkit/devel-api/layouting/layout-group.h>
23
24 namespace Test
25 {
26
27 namespace Internal
28 {
29 class CustomLayout;
30 }
31
32 /**
33  * @brief This is the handle class to a very simple Custom Layout.
34  *
35  * This class lays out its children horizontally in a very simple manner.
36  */
37 class CustomLayout : public Dali::Toolkit::LayoutGroup
38 {
39 public:
40
41   // Behaviour flags
42   static const int BEHAVIOUR_FLAG_UNCONSTRAINED_CHILD_WIDTH                = 0x00000001;  // Child width measured without constraint
43   static const int BEHAVIOUR_FLAG_UNCONSTRAINED_CHILD_HEIGHT               = 0x00000002;  // Child height measured without constraint
44
45   /**
46    * @brief Creates an uninitialized CustomLayout handle.
47    *
48    * Initialize it using CustomLayout::New().
49    * Calling member functions with an uninitialized handle is not allowed.
50    */
51   CustomLayout() = default;
52
53   /**
54    * @brief Creates a CustomLayout object.
55    */
56   static CustomLayout New();
57
58
59   /**
60    * @brief Default destructor.
61    *
62    * This is non-virtual, since derived Handle types must not contain data or virtual methods
63    */
64   ~CustomLayout() = default;
65
66   /**
67    * @brief Copy constructor
68    */
69   CustomLayout( const CustomLayout& ) = default;
70
71   /**
72    * @brief Assigment operator
73    */
74   CustomLayout& operator=( const CustomLayout& ) = default;
75
76   /**
77    * @brief Move constructor
78    */
79   CustomLayout( CustomLayout&& ) = default;
80
81   /**
82    * @brief Movable assignment operator
83    */
84   CustomLayout& operator=( CustomLayout&& ) = default;
85
86   /**
87    * @brief Downcasts a handle to a CustomLayout handle.
88    *
89    * If handle points to a CustomLayout, the downcast produces a valid handle.
90    * If not, the returned handle is left uninitialized.
91
92    * @param[in] handle to an object
93    * @return Handle to a CustomLayout or an uninitialized handle
94    */
95   static CustomLayout DownCast( BaseHandle handle );
96
97   /**
98    * Request for a relayout of this layout
99    */
100   void RequestLayout();
101
102   /**
103    * Enables setting of flags corresponding to particular behaviour of this layout
104    * @param[in] flag the flag to set
105    */
106   void SetCustomBehaviourFlag( int flag );
107
108   /**
109    * Returns true or false depending on whether flag is set
110    * @return bool returns true if flag set
111    */
112   bool GetCustomBehaviourFlags( int flagToCheck );
113
114   /**
115    * Clears the flag if already set.
116    * @param[in] flag the flag to clear
117    */
118   void ClearPrivateFlag( int flag );
119
120 public: // Not intended for application developers
121
122   /// @cond internal
123   /**
124    * @brief This constructor is used by CustomLayout::New() methods.
125    *
126    * @param[in] actor A pointer to a newly allocated Dali resource
127    */
128   explicit CustomLayout( Internal::CustomLayout* body );
129   /// @endcond
130 };
131
132 } // namespace Test
133
134 #endif // TEST_CUSTOM_LAYOUT_H