2d06eb94f30104a350bc1206715feb2da06c650d
[platform/core/appfw/app-core.git] / tizen-cpp / app-core-ui-cpp / app_core_ui_base.hh
1 /*
2  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef TIZEN_CPP_APP_CORE_UI_CPP_APP_CORE_UI_BASE_HH_
18 #define TIZEN_CPP_APP_CORE_UI_CPP_APP_CORE_UI_BASE_HH_
19
20 #include <memory>
21
22 #include <app_core_base.hh>
23 #include <interface_app_core_ui.hh>
24 #include <interface_window.hh>
25
26 #undef EXPORT_API
27 #define EXPORT_API __attribute__((visibility("default")))
28
29 namespace tizen_cpp {
30
31 class EXPORT_API AppCoreUiBase : public AppCoreBase,
32                                  public IAppCoreUi,
33                                  public IWindow {
34  public:
35   constexpr static int HINT_WINDOW_GROUP_CONTROL = 0x1;
36   constexpr static int HINT_WINDOW_STACK_CONTROL = 0x2;
37   constexpr static int HINT_BG_LAUNCH_CONTROL = 0x4;
38   constexpr static int HINT_HW_ACC_CONTROL = 0x8;
39   constexpr static int HINT_WINDOW_AUTO_CONTROL = 0x10;
40   constexpr static int HINT_LEGACY_CONTROL = 0x20;
41   constexpr static int HINT_WINDOW_ID_CONTROL = 0x40;
42
43   AppCoreUiBase(unsigned int hint);
44   virtual ~AppCoreUiBase();
45
46   int OnPause() override;
47   int OnResume() override;
48   int OnReceive(aul_type type, tizen_base::Bundle b) override;
49   int OnCreate() override;
50   int OnTerminate() override;
51   int OnTrimMemory() override;
52   void OnShow(int type, void* event) override;
53   void OnHide(int type, void* event) override;
54   void OnLower(int type, void* event) override;
55   void OnVisibility(int type, void* event) override;
56   void OnPreVisibility(int type, void* event) override;
57   void OnAuxMessage(int type, void* event) override;
58   void Pause();
59   void Resume();
60   bool IsResumed();
61   int GroupAdd();
62   void GroupRemove();
63   unsigned int GetMainWindow();
64   unsigned int GetMainSurface();
65   int GetHint();
66   bool GetBgState();
67   void SetBgState(bool bg_state);
68   void SetSystemResourceReclaiming(bool enable);
69   void Run(int argc, char** argv) override;
70   void Dispose() override;
71
72  protected:
73   void SetCoreUiDelegator(IAppCoreUi* delegator);
74   void SetWindowDelegator(IWindow* delegator);
75
76  private:
77   class Impl;
78   std::unique_ptr<Impl> impl_;
79 };
80
81 }  // namespace tizen_cpp
82
83 #endif  // TIZEN_CPP_APP_CORE_UI_CPP_APP_CORE_UI_BASE_HH_