• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 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_DISPLAY_MANAGER_AGENT_INTERFACE_H
17 #define OHOS_ROSEN_DISPLAY_MANAGER_AGENT_INTERFACE_H
18 
19 #include <iremote_broker.h>
20 #include "display_info.h"
21 #include "dm_common.h"
22 #include "screen_info.h"
23 
24 namespace OHOS {
25 namespace Rosen {
26 enum class DisplayManagerAgentType : uint32_t {
27     DISPLAY_POWER_EVENT_LISTENER,
28     DISPLAY_STATE_LISTENER,
29     SCREEN_EVENT_LISTENER,
30     DISPLAY_EVENT_LISTENER,
31 };
32 
33 class IDisplayManagerAgent : public IRemoteBroker {
34 public:
35     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.IDisplayManagerAgent");
36 
37     enum {
38         TRANS_ID_NOTIFY_DISPLAY_POWER_EVENT = 1,
39         TRANS_ID_NOTIFY_DISPLAY_STATE_CHANGED,
40         TRANS_ID_ON_SCREEN_CONNECT,
41         TRANS_ID_ON_SCREEN_DISCONNECT,
42         TRANS_ID_ON_SCREEN_CHANGED,
43         TRANS_ID_ON_SCREENGROUP_CHANGED,
44         TRANS_ID_ON_DISPLAY_CONNECT,
45         TRANS_ID_ON_DISPLAY_DISCONNECT,
46         TRANS_ID_ON_DISPLAY_CHANGED,
47     };
48     virtual void NotifyDisplayPowerEvent(DisplayPowerEvent event, EventStatus status) = 0;
49     virtual void NotifyDisplayStateChanged(DisplayId id, DisplayState state) = 0;
50     virtual void OnScreenConnect(sptr<ScreenInfo>) = 0;
51     virtual void OnScreenDisconnect(ScreenId) = 0;
52     virtual void OnScreenChange(const sptr<ScreenInfo>&, ScreenChangeEvent) = 0;
53     virtual void OnScreenGroupChange(const std::vector<sptr<ScreenInfo>>&, ScreenGroupChangeEvent) = 0;
54     virtual void OnDisplayCreate(sptr<DisplayInfo>) = 0;
55     virtual void OnDisplayDestroy(DisplayId) = 0;
56     virtual void OnDisplayChange(sptr<DisplayInfo>, DisplayChangeEvent) = 0;
57 };
58 } // namespace Rosen
59 } // namespace OHOS
60 #endif // OHOS_ROSEN_DISPLAY_MANAGER_AGENT_INTERFACE_H