Merge "DALi Version 1.2.11" into devel/master
[platform/core/uifw/dali-demo.git] / examples / styling / styling-application.h
1 #ifndef DALI_DEMO_STYLING_APPLICATION_H
2 #define DALI_DEMO_STYLING_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 "image-channel-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 StylingApplication : public ConnectionTracker
37 {
38 public:
39   // Constructor
40   StylingApplication( Application& application );
41
42   // Destructor
43   ~StylingApplication();
44
45   // Init signal handler
46   void Create( Application& application );
47
48   // Create the GUI components
49   Actor CreateContentPane();
50   Actor CreateResizableContentPane();
51   Toolkit::Popup CreateResetPopup();
52   Toolkit::TextLabel CreateTitle( std::string title );
53
54   // Key event handler
55   void OnKeyEvent( const KeyEvent& event );
56
57   // Button event handlers
58   bool OnButtonStateChange( Toolkit::Button button );
59   bool OnCheckButtonChange( Toolkit::Button button );
60   bool OnResetClicked( Toolkit::Button button );
61   bool OnThemeButtonClicked( Toolkit::Button button );
62
63   // Slider event handler
64   bool OnSliderChanged( Toolkit::Slider slider, float value );
65
66   // Popup event handlers
67   void HidePopup();
68   void PopupHidden();
69   bool OnReset(Button button);
70   bool OnResetCancelled(Button button);
71
72   // Grab handle handler
73   void OnPan( Actor actor, const PanGesture& gesture );
74
75   static const char* DEMO_THEME_ONE_PATH;
76   static const char* DEMO_THEME_TWO_PATH;
77   static const char* DEMO_THEME_THREE_PATH;
78
79 private:
80   Application& mApplication;
81   int mCurrentTheme;
82   Actor mContentPane;
83   TextLabel mTitle;
84   RadioButton mRadioButtons[3]; // 3 demo images
85   CheckBoxButton mCheckButtons[3]; // rgb buttons
86   Slider mChannelSliders[3]; // rgb sliders
87   PushButton mThemeButtons[3];
88   PushButton mResetButton;
89   ImageChannelControl mImageChannelControl;
90   ImageChannelControl mIcc1;
91   ImageChannelControl mIcc2;
92   ImageChannelControl mIcc3;
93   Actor mImagePlacement;
94   Popup mResetPopup;
95   PanGestureDetector mPanGestureDetector;
96 };
97
98 } // Namespace Demo
99
100
101 #endif // DALI_DEMO_STYLING_APPLICATION_H