• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 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_SESSION_MANAGER_SCENE_INPUT_MANAGER_H
17 #define OHOS_SESSION_MANAGER_SCENE_INPUT_MANAGER_H
18 
19 #include <string>
20 #include <vector>
21 
22 #include <ui_content.h>
23 #include "input_manager.h"
24 #include "session/host/include/scene_session.h"
25 #include "wm_common.h"
26 #include "wm_single_instance.h"
27 
28 namespace OHOS {
29 namespace Rosen {
30 class SceneSessionDirtyManager;
31 
32 class SceneInputManager : public std::enable_shared_from_this<SceneInputManager> {
33 WM_DECLARE_SINGLE_INSTANCE_BASE(SceneInputManager)
34 public:
35     void FlushDisplayInfoToMMI();
36     void NotifyWindowInfoChange(const sptr<SceneSession>& scenenSession, const WindowUpdateType& type);
37     void NotifyWindowInfoChangeFromSession(const sptr<SceneSession>& sceneSession);
38     void NotifyMMIWindowPidChange(const sptr<SceneSession>& sceneSession, const bool startMoving);
39 
40 protected:
41     SceneInputManager() = default;
42     virtual ~SceneInputManager() = default;
43 
44 private:
45     void Init();
46     void FlushFullInfoToMMI(const std::vector<MMI::WindowInfo>& windowInfoList);
47     void FlushChangeInfoToMMI(const std::map<uint64_t, std::vector<MMI::WindowInfo>>& screenId2Windows);
48     void ConstructDisplayInfos(std::vector<MMI::DisplayInfo>& displayInfos);
49 
50     std::shared_ptr<SceneSessionDirtyManager> sceneSessionDirty_;
51     std::shared_ptr<AppExecFwk::EventRunner> eventLoop_;
52     std::shared_ptr<AppExecFwk::EventHandler> eventHandler_;
53 };
54 }//Rosen
55 }//OHOS
56 #endif //OHOS_SESSION_MANAGER_SCENE_INPUT_MANAGER_H