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 FOUNDATION_ACE_FRAMEWORKS_BASE_MOUSESTYLE_MOUSE_STYLE_MANAGER_H
17 #define FOUNDATION_ACE_FRAMEWORKS_BASE_MOUSESTYLE_MOUSE_STYLE_MANAGER_H
18 
19 #include "base/memory/ace_type.h"
20 #include "base/image/pixel_map.h"
21 
22 namespace OHOS::Ace {
23 
24 enum class MouseFormat : int32_t {
25     DEFAULT = 0,        // Default mouse style
26     EAST = 1,           // Eastwards arrow
27     WEST = 2,           // Westwards arrow
28     SOUTH = 3,          // Southwards arrow
29     NORTH = 4,          // Northwards arrow
30     WEST_EAST = 5,      // Drag left-right mouse style
31     NORTH_SOUTH = 6,    // Drag up-down mouse style
32     NORTH_EAST = 7,
33     NORTH_WEST = 8,
34     SOUTH_EAST = 9,
35     SOUTH_WEST = 10,
36     NORTH_EAST_SOUTH_WEST = 11,
37     NORTH_WEST_SOUTH_EAST = 12,
38     CROSS = 13,
39     CURSOR_COPY = 14,
40     CURSOR_FORBID = 15,
41     COLOR_SUCKER = 16,
42     HAND_GRABBING = 17,
43     HAND_OPEN = 18,
44     HAND_POINTING = 19, // Hyperlink mouse style
45     HELP = 20,
46     CURSOR_MOVE = 21,
47     RESIZE_LEFT_RIGHT = 22,
48     RESIZE_UP_DOWN = 23,
49     SCREENSHOT_CHOOSE = 24,
50     SCREENSHOT_CURSOR = 25,
51     TEXT_CURSOR = 26,   // Text editing mouse style
52     ZOOM_IN = 27,
53     ZOOM_OUT = 28,
54     MIDDLE_BTN_EAST = 29,
55     MIDDLE_BTN_WEST = 30,
56     MIDDLE_BTN_SOUTH = 31,
57     MIDDLE_BTN_NORTH = 32,
58     MIDDLE_BTN_NORTH_SOUTH = 33,
59     MIDDLE_BTN_NORTH_EAST = 34,
60     MIDDLE_BTN_NORTH_WEST = 35,
61     MIDDLE_BTN_SOUTH_EAST = 36,
62     MIDDLE_BTN_SOUTH_WEST = 37,
63     MIDDLE_BTN_NORTH_SOUTH_WEST_EAST = 38,
64     HORIZONTAL_TEXT_CURSOR = 39,
65     CURSOR_CROSS = 40,
66     CURSOR_CIRCLE = 41,
67     LOADING = 42,
68     RUNNING = 43,
69     CURSOR_NONE = 46,
70     CONTEXT_MENU = 47,
71     ALIAS = 48,
72 };
73 
74 class ACE_EXPORT MouseStyle : public AceType {
75     DECLARE_ACE_TYPE(MouseStyle, AceType)
76 
77 public:
78     static RefPtr<MouseStyle> CreateMouseStyle();
79 
80     virtual bool SetPointerStyle(int32_t windowId, MouseFormat pointerStyle) const = 0;
81     virtual int32_t GetPointerStyle(int32_t windowId, int32_t& pointerStyle) const = 0;
82     virtual bool ChangePointerStyle(int32_t windowId, MouseFormat mouseFormat) const = 0;
SetMouseIcon(int32_t windowId,MouseFormat pointerStyle,std::shared_ptr<Media::PixelMap> pixelMap)83     virtual void SetMouseIcon(
84         int32_t windowId, MouseFormat pointerStyle, std::shared_ptr<Media::PixelMap> pixelMap) const {};
SetCustomCursor(int32_t windowId,int32_t focusX,int32_t focusY,std::shared_ptr<Media::PixelMap> pixelMap)85     virtual void SetCustomCursor(
86         int32_t windowId, int32_t focusX, int32_t focusY, std::shared_ptr<Media::PixelMap> pixelMap) const {};
SetPointerVisible(MouseFormat pointerStyle)87     virtual void SetPointerVisible(MouseFormat pointerStyle) const {};
88 };
89 
90 } // namespace OHOS::Ace
91 
92 #endif // FOUNDATION_ACE_FRAMEWORKS_BASE_MOUSESTYLE_MOUSE_STYLE_MANAGER_H