2 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
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_
22 #include <app_core_base.hh>
23 #include <app_core_task_base.hh>
24 #include <interface_app_core_ui.hh>
25 #include <interface_window.hh>
28 #define EXPORT_API __attribute__((visibility("default")))
32 class EXPORT_API AppCoreUiBase : public AppCoreBase,
36 constexpr static int HINT_WINDOW_GROUP_CONTROL = 0x1;
37 constexpr static int HINT_WINDOW_STACK_CONTROL = 0x2;
38 constexpr static int HINT_BG_LAUNCH_CONTROL = 0x4;
39 constexpr static int HINT_HW_ACC_CONTROL = 0x8;
40 constexpr static int HINT_WINDOW_AUTO_CONTROL = 0x10;
41 constexpr static int HINT_LEGACY_CONTROL = 0x20;
42 constexpr static int HINT_WINDOW_ID_CONTROL = 0x40;
43 constexpr static int HINT_DUAL_THREAD = 0x80;
45 AppCoreUiBase(unsigned int hint);
46 virtual ~AppCoreUiBase();
48 int OnPause() override;
49 int OnResume() override;
50 int OnReceive(aul_type type, tizen_base::Bundle b) override;
51 int OnCreate() override;
52 int OnTerminate() override;
53 int OnTrimMemory() override;
54 void OnShow(int type, void* event) override;
55 void OnHide(int type, void* event) override;
56 void OnLower(int type, void* event) override;
57 void OnVisibility(int type, void* event) override;
58 void OnPreVisibility(int type, void* event) override;
59 void OnAuxMessage(int type, void* event) override;
65 unsigned int GetMainWindow();
66 unsigned int GetMainSurface();
69 void SetBgState(bool bg_state);
70 void SetSystemResourceReclaiming(bool enable);
71 void Run(int argc, char** argv) override;
72 void Dispose() override;
73 virtual std::unique_ptr<AppCoreTaskBase> CreateTask();
77 void SetCoreUiDelegator(IAppCoreUi* delegator);
78 void SetWindowDelegator(IWindow* delegator);
81 void DoRun(int argc, char** argv);
86 std::unique_ptr<Impl> impl_;
89 } // namespace tizen_cpp
91 #endif // TIZEN_CPP_APP_CORE_UI_CPP_APP_CORE_UI_BASE_HH_