• 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_ROSEN_SCREEN_SESSION_PUBLISH_H
17 #define OHOS_ROSEN_SCREEN_SESSION_PUBLISH_H
18 
19 #include "errors.h"
20 
21 #include <want.h>
22 #include <common_event_data.h>
23 #include <common_event_publish_info.h>
24 
25 #include "dm_common.h"
26 
27 namespace OHOS::Rosen {
28 class ScreenSessionPublish {
29 public:
30     static ScreenSessionPublish &GetInstance();
31     void InitPublishEvents();
32     void PublishCastPlugInEvent();
33     void PublishCastPlugOutEvent();
34     void PublishDisplayRotationEvent(const ScreenId &screenId, const Rotation &displayRotation);
35 
36 private:
37     explicit ScreenSessionPublish() = default;
38     ~ScreenSessionPublish() = default;
39 
40     int32_t PublishEvents(const EventFwk::CommonEventData &eventData, std::string bundleName = "");
41     void PublishCastPluggedEvent(const bool &isEnable);
42 
43 private:
44     sptr<EventFwk::CommonEventPublishInfo> publishInfo_;
45     static std::map<std::string, sptr<EventFwk::Want>> cesWantMap_;
46 };
47 } // namespace OHOS::Rosen
48 
49 #endif // OHOS_ROSEN_SCREEN_SESSION_PUBLISH_H