Updated demos to use DALi clang-format
[platform/core/uifw/dali-demo.git] / examples / visual-transitions / transition-application.h
1 #ifndef DALI_DEMO_TRANSITION_APPLICATION_H
2 #define DALI_DEMO_TRANSITION_APPLICATION_H
3
4 /*
5  * Copyright (c) 2020 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-toolkit/dali-toolkit.h>
22 //#include <dali-toolkit/devel-api/controls/slider/slider.h>
23 #include <dali-toolkit/devel-api/controls/popup/popup.h>
24 #include <cstdio>
25 #include <sstream>
26 #include "beat-control.h"
27
28 // Internal includes
29
30 using namespace Dali;
31 using namespace Dali::Toolkit;
32
33 namespace Demo
34 {
35 class TransitionApplication : public ConnectionTracker
36 {
37 public:
38   static const int NUMBER_OF_ACTION_BUTTONS = 4;
39   static const int NUMBER_OF_VISUAL_BUTTONS = 10;
40
41 public:
42   // Constructor
43   TransitionApplication(Application& application);
44
45   // Destructor
46   ~TransitionApplication();
47
48   // Init signal handler
49   void Create(Application& application);
50
51   // Create the GUI components
52   Toolkit::TextLabel CreateTitle(std::string title);
53   Actor              CreateContentPane();
54
55   // Key event handler
56   void OnKeyEvent(const KeyEvent& event);
57
58   bool OnActionButtonClicked(Button button);
59   bool OnVisualButtonClicked(Actor actor, const TouchEvent& touch);
60
61   static const char* DEMO_THEME_ONE_PATH;
62
63 private:
64   /** Create a visual map
65    *
66    * @param[in] index The index of the visual to create
67    * @param[out] map The map to generate
68    */
69   void CreateVisualMap(int index, Property::Map& map);
70
71   Application&    mApplication;
72   TextLabel       mTitle;
73   BeatControl     mBeatControl;
74   PushButton      mActionButtons[NUMBER_OF_ACTION_BUTTONS];
75   BeatControl     mVisualButtons[NUMBER_OF_VISUAL_BUTTONS];
76   Property::Index mVisualIndex;
77   Property::Index mActionIndex;
78 };
79
80 } // Namespace Demo
81
82 #endif // DALI_DEMO_TRANSITION_APPLICATION_H