• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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_ROSEN_WINDOW_ZORDER_POLICY_H
17 #define OHOS_ROSEN_WINDOW_ZORDER_POLICY_H
18 
19 #include <map>
20 #include <refbase.h>
21 
22 #include "wm_common.h"
23 
24 namespace OHOS {
25 namespace Rosen {
26 class WindowZorderPolicy : public RefBase {
27 public:
28     WindowZorderPolicy() = default;
29     ~WindowZorderPolicy() = default;
30 
31     int32_t GetWindowPriority(WindowType type) const;
32 
33 private:
34     const std::map<WindowType, int32_t> windowPriorityMap_ {
35         // sub-windows types
36         { WindowType::WINDOW_TYPE_MEDIA,                 -1 },
37         { WindowType::WINDOW_TYPE_APP_SUB_WINDOW,         1 },
38 
39         // main window
40         { WindowType::WINDOW_TYPE_APP_MAIN_WINDOW,        0 },
41 
42         // system-specific window
43         { WindowType::WINDOW_TYPE_WALLPAPER,            0 },
44         { WindowType::WINDOW_TYPE_DESKTOP,              1 },
45         { WindowType::WINDOW_TYPE_APP_LAUNCHING,        101 },
46         { WindowType::WINDOW_TYPE_DOCK_SLICE,           0 },
47         { WindowType::WINDOW_TYPE_LAUNCHER_RECENT,      102 },
48         { WindowType::WINDOW_TYPE_LAUNCHER_DOCK,        103 },
49         { WindowType::WINDOW_TYPE_INCOMING_CALL,        104 },
50         { WindowType::WINDOW_TYPE_SEARCHING_BAR,        105 },
51         { WindowType::WINDOW_TYPE_SYSTEM_ALARM_WINDOW,  106 },
52         { WindowType::WINDOW_TYPE_INPUT_METHOD_FLOAT,   107 },
53         { WindowType::WINDOW_TYPE_FLOAT,                108 },
54         { WindowType::WINDOW_TYPE_TOAST,                109 },
55         { WindowType::WINDOW_TYPE_STATUS_BAR,           110 },
56         { WindowType::WINDOW_TYPE_PANEL,                111 },
57         { WindowType::WINDOW_TYPE_VOLUME_OVERLAY,       112 },
58         { WindowType::WINDOW_TYPE_NAVIGATION_BAR,       113 },
59         { WindowType::WINDOW_TYPE_KEYGUARD,             114 },
60         // reserve 115 for app window above keyguard, 116 for input method window above keyguard
61         { WindowType::WINDOW_TYPE_DRAGGING_EFFECT,      117 },
62         { WindowType::WINDOW_TYPE_POINTER,              118 },
63         { WindowType::WINDOW_TYPE_BOOT_ANIMATION,       119 },
64         { WindowType::WINDOW_TYPE_FREEZE_DISPLAY,       120 },
65     };
66 };
67 }
68 }
69 #endif // OHOS_ROSEN_WINDOW_STATE_H
70