5779379edd9fb8d45681d119c7eb2c4d61541dfd
[platform/core/uifw/dali-demo.git] / examples / layouting / linear-example.h
1 #ifndef DALI_DEMO_LINEAR_EXAMPLE_H
2 #define DALI_DEMO_LINEAR_EXAMPLE_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
21 #include <dali/dali.h>
22 #include <dali-toolkit/dali-toolkit.h>
23
24 using namespace Dali;
25 using namespace Dali::Toolkit;
26
27 namespace Demo
28 {
29
30 /**
31  * @file linear-example.hcpp
32  * @brief Example of a Linear Layout with mirror feature and
33  * tranisition from horizontal to vertical.
34  */
35 class LinearExample: public ConnectionTracker
36 {
37
38 public:
39
40   // Creates a Linear Layout Example and displays it.
41   void Create();
42
43   // Remove and destroy this layout
44   void Remove();
45
46 private:
47
48   // Changes the direction of the items.
49   bool OnDirectionClicked( Button button );
50
51   // Alternates the linear layout from horizontal to vertical
52   bool OnRotateClicked( Button button );
53
54 private:
55   PushButton mDirectionButton;
56   PushButton mRotateButton;
57   Control mLinearContainer;
58   bool mDirection;
59   bool mIsHorizontal = true;
60 }; // class LinearContainer
61
62 } // namespace Demo
63
64 #endif //DALI_DEMO_LINEAR_CONTAINER_H