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