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