• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef WINDOW_STAGE_IMPL_H
17 #define WINDOW_STAGE_IMPL_H
18 
19 #include "ffi_remote_data.h"
20 #include "window_scene.h"
21 #include "window_utils.h"
22 #include "window_register_manager.h"
23 
24 namespace OHOS {
25 namespace Rosen {
26 class CJWindowStageImpl : public OHOS::FFI::FFIData {
27 public:
CJWindowStageImpl(const std::shared_ptr<WindowScene> & windowScene)28     explicit CJWindowStageImpl(const std::shared_ptr<WindowScene>& windowScene): windowScene_(windowScene),
29         registerManager_(std::make_unique<CjWindowRegisterManager>()) {}
30     int32_t GetMainWindow(int64_t& windowId);
31     int32_t CreateSubWindow(std::string name, int64_t& windowId);
32     RetStruct GetSubWindow();
33     int32_t OnLoadContent(const std::string& contexUrl, const std::string& storageJson, bool isLoadedByName);
34     int32_t DisableWindowDecor();
35     int32_t SetShowOnLockScreen(bool showOnLockScreen);
36     static std::shared_ptr<CJWindowStageImpl> CreateCJWindowStage(std::shared_ptr<WindowScene> windowScene);
37     int32_t SetDefaultDensityEnabled(bool enabled);
38     int32_t OnEvent(int64_t funcId);
39     int32_t OffEvent(int64_t funcId);
40     int32_t CreateSubWindowWithOptions(int64_t& windowId, const std::string& name,
41         const std::string& title, bool decorEnabled, bool isModal);
42 private:
43     std::weak_ptr<Rosen::WindowScene> windowScene_;
44     std::unique_ptr<CjWindowRegisterManager> registerManager_ = nullptr;
45 };
46 }
47 }
48 #endif // WINDOW_STAGE_IMPL_H
49