c579cc9b9f1c467f32820add3fdc21786c245c48
[platform/core/uifw/dali-demo.git] / examples / layouting / animation-example.h
1 #ifndef DALI_DEMO_ANIMATION_EXAMPLE_H
2 #define DALI_DEMO_ANIMATION_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 #include <dali-toolkit/devel-api/layouting/linear-layout.h>
24 #include <dali-toolkit/devel-api/layouting/grid.h>
25
26 #include "example.h"
27
28 using namespace Dali;
29 using namespace Dali::Toolkit;
30
31 namespace Demo
32 {
33
34 /**
35  * @file animation-example.hcpp
36  * @brief Example of a layout complex animation.
37  */
38 class AnimationExample final: public ConnectionTracker, public Example
39 {
40 public:
41   AnimationExample();
42
43   // Creates a Animation Layout Example and displays it.
44   virtual void Create() override;
45
46   // Remove and destroy this layout
47   virtual void Remove() override;
48
49 private:
50
51   bool OnRemoveClicked( Button button );
52
53   bool OnSelectGridClicked( Button button );
54
55   bool OnAddClicked( Button button );
56
57   bool OnChangeClicked( Button button );
58
59 private:
60   PushButton mRemoveButton;
61   PushButton mAddButton;
62   PushButton mSelectGridButton;
63   PushButton mShakeButton;
64   Control mAnimationContainer;
65   Grid mGridLayout;
66   LinearLayout mHorizontalLayout;
67   bool mGridSet;
68 }; // class AnimationContainer
69
70 } // namespace Demo
71
72 #endif //DALI_DEMO_ANIMATION_CONTAINER_H