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