• 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 OHOS_CJ_DISPLAY_MANAGER_H
17 #define OHOS_CJ_DISPLAY_MANAGER_H
18 
19 #include <map>
20 
21 #include "cj_display_listener.h"
22 #include "display_utils.h"
23 #include "ffi_remote_data.h"
24 
25 namespace OHOS {
26 namespace Rosen {
27 
28 class CJDisplayManager {
29 public:
30     static RetStruct GetDefaultDisplaySync();
31     static RetStruct GetAllDisplays();
32     static RetStruct HasPrivateWindow(uint32_t displayId);
33     static bool IsFoldable();
34     static void SetFoldDisplayMode(uint32_t mode);
35     static uint32_t GetFoldStatus();
36     static uint32_t GetFoldDisplayMode();
37     static RetStruct GetCurrentFoldCreaseRegion();
38     static bool IsCaptured();
39     static RetStruct GetAllDisplayPhysicalResolution();
40     static bool IfCallbackRegistered(const std::string& type, int64_t callbackId);
41     static int32_t OnUnregisterAllDisplayListenerWithType(const std::string& type);
42     static DMError UnregisterAllDisplayListenerWithType(const std::string& type);
43     static int32_t OnRegisterDisplayListenerWithType(const std::string& type, int64_t callbackId);
44     static DMError RegisterDisplayListenerWithType(const std::string& type, int64_t callbackId);
45     static int32_t OnUnRegisterDisplayListenerWithType(const std::string& type, int64_t callbackId);
46     static DMError UnRegisterDisplayListenerWithType(const std::string& type, int64_t callbackId);
47     static std::map<std::string, std::map<int64_t, sptr<CJDisplayListener>>> cjCbMap_;
48     static std::mutex mtx_;
49 };
50 
51 } // namespace Rosen
52 } // namespace OHOS
53 
54 #endif // DISPLAY_MANAGER_H
55