• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 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 I_POINTER_DRAWING_MANAGER_H
17 #define I_POINTER_DRAWING_MANAGER_H
18 
19 #include <memory>
20 
21 #include "display_info.h"
22 #include "struct_multimodal.h"
23 
24 namespace OHOS {
25 namespace MMI {
26 class IPointerDrawingManager {
27 public:
28     IPointerDrawingManager() = default;
29     virtual ~IPointerDrawingManager() = default;
30 
31     static std::shared_ptr<IPointerDrawingManager> GetInstance();
32     virtual void DrawPointer(int32_t displayId, int32_t physicalX, int32_t physicalY,
33         const MOUSE_ICON mouseStyle = MOUSE_ICON::DEFAULT) {}
UpdateDisplayInfo(const DisplayInfo & displayInfo)34     virtual void UpdateDisplayInfo(const DisplayInfo& displayInfo) {}
OnDisplayInfo(const DisplayGroupInfo & displayGroupInfo)35     virtual void OnDisplayInfo(const DisplayGroupInfo& displayGroupInfo) {}
OnWindowInfo(const WinInfo & info)36     virtual void OnWindowInfo(const WinInfo &info) {}
Init()37     virtual bool Init()
38     {
39         return true;
40     }
DeletePointerVisible(int32_t pid)41     virtual void DeletePointerVisible(int32_t pid) {}
SetPointerVisible(int32_t pid,bool visible)42     virtual int32_t SetPointerVisible(int32_t pid, bool visible)
43     {
44         return 0;
45     }
SetPointerStyle(int32_t pid,int32_t windowId,int32_t pointerStyle)46     virtual int32_t SetPointerStyle(int32_t pid, int32_t windowId, int32_t pointerStyle)
47     {
48         return 0;
49     }
GetPointerStyle(int32_t pid,int32_t windowId,int32_t & pointerStyle)50     virtual int32_t GetPointerStyle(int32_t pid, int32_t windowId, int32_t &pointerStyle)
51     {
52         return 0;
53     }
DrawPointerStyle()54     virtual void DrawPointerStyle() {}
IsPointerVisible()55     virtual bool IsPointerVisible()
56     {
57         return false;
58     }
SetMouseDisplayState(bool state)59     virtual void SetMouseDisplayState(bool state) {}
GetMouseDisplayState()60     virtual bool GetMouseDisplayState() const
61     {
62         return true;
63     }
SetPointerLocation(int32_t pid,int32_t x,int32_t y)64     virtual void SetPointerLocation(int32_t pid, int32_t x, int32_t y) {}
65 public:
66     static inline std::shared_ptr<IPointerDrawingManager> iPointDrawMgr_ { nullptr };
67 };
68 } // namespace MMI
69 } // namespace OHOS
70 #endif // I_POINTER_DRAWING_MANAGER_H