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