• 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 "pixel_map.h"
22 #include "pointer_style.h"
23 #include "window_info.h"
24 #include "struct_multimodal.h"
25 
26 namespace OHOS {
27 namespace MMI {
28 class IPointerDrawingManager {
29 public:
30     IPointerDrawingManager() = default;
31     virtual ~IPointerDrawingManager() = default;
32 
33     static std::shared_ptr<IPointerDrawingManager> GetInstance();
34     virtual void DrawPointer(int32_t displayId, int32_t physicalX, int32_t physicalY,
35         const MOUSE_ICON mouseStyle = MOUSE_ICON::DEFAULT) {}
UpdateDisplayInfo(const DisplayInfo & displayInfo)36     virtual void UpdateDisplayInfo(const DisplayInfo& displayInfo) {}
OnDisplayInfo(const DisplayGroupInfo & displayGroupInfo)37     virtual void OnDisplayInfo(const DisplayGroupInfo& displayGroupInfo) {}
OnWindowInfo(const WinInfo & info)38     virtual void OnWindowInfo(const WinInfo &info) {}
Init()39     virtual bool Init()
40     {
41         return true;
42     }
DeletePointerVisible(int32_t pid)43     virtual void DeletePointerVisible(int32_t pid) {}
SetPointerVisible(int32_t pid,bool visible)44     virtual int32_t SetPointerVisible(int32_t pid, bool visible)
45     {
46         return 0;
47     }
SetPointerColor(int32_t color)48     virtual int32_t SetPointerColor(int32_t color)
49     {
50         return 0;
51     }
GetPointerColor()52     virtual int32_t GetPointerColor()
53     {
54         return 0;
55     }
SetPointerStyle(int32_t pid,int32_t windowId,PointerStyle pointerStyle)56     virtual int32_t SetPointerStyle(int32_t pid, int32_t windowId, PointerStyle pointerStyle)
57     {
58         return 0;
59     }
GetPointerStyle(int32_t pid,int32_t windowId,PointerStyle & pointerStyle)60     virtual int32_t GetPointerStyle(int32_t pid, int32_t windowId, PointerStyle &pointerStyle)
61     {
62         return 0;
63     }
DrawPointerStyle()64     virtual void DrawPointerStyle() {}
IsPointerVisible()65     virtual bool IsPointerVisible()
66     {
67         return false;
68     }
SetPointerLocation(int32_t pid,int32_t x,int32_t y)69     virtual void SetPointerLocation(int32_t pid, int32_t x, int32_t y) {}
SetMouseDisplayState(bool state)70     virtual void SetMouseDisplayState(bool state) {}
GetMouseDisplayState()71     virtual bool GetMouseDisplayState() const
72     {
73         return true;
74     }
SetMouseIcon(int32_t windowId,void * pixelMap)75     virtual int32_t SetMouseIcon(int32_t windowId, void* pixelMap)
76     {
77         return 0;
78     }
SetMouseHotSpot(int32_t windowId,int32_t hotSpotX,int32_t hotSpotY)79     virtual int32_t SetMouseHotSpot(int32_t windowId, int32_t hotSpotX, int32_t hotSpotY)
80     {
81         return 0;
82     }
SetPointerSize(int32_t size)83     virtual int32_t SetPointerSize(int32_t size)
84     {
85         return 0;
86     }
GetPointerSize()87     virtual int32_t GetPointerSize()
88     {
89         return 0;
90     }
91 public:
92     static inline std::shared_ptr<IPointerDrawingManager> iPointDrawMgr_ { nullptr };
93 };
94 } // namespace MMI
95 } // namespace OHOS
96 #endif // I_POINTER_DRAWING_MANAGER_H