xref: /ide/tools/previewer/mock/MouseInput.h (revision 7c804472)
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 MOUSEINPUT_H
17#define MOUSEINPUT_H
18
19#include <set>
20#include <vector>
21
22class MouseInput {
23public:
24    double GetMouseXPosition() const;
25    double GetMouseYPosition() const;
26    virtual void SetMouseStatus(int status);
27    virtual void SetMousePosition(double xPosition, double yPosition);
28    virtual void DispatchOsTouchEvent() const {};
29    virtual void DispatchOsBackEvent() const {};
30    virtual void SetMouseButton(int buttonVal);
31    virtual void SetMouseAction(int actionVal);
32    virtual void SetSourceType(int sourceTypeVal);
33    virtual void SetSourceTool(int sourceToolVal);
34    virtual void SetPressedBtns(std::set<int>& pressedBtns);
35    virtual void SetAxisValues(std::vector<double>& axisValues); // 13 is array size
36    const int defaultButton = -1; // default unknown
37    const int defaultAction = 0;  // default unknown
38    const int defaultSourceType = 2; // default touch
39    const int defaultSourceTool = 1; // default finger
40
41protected:
42    MouseInput();
43    virtual ~MouseInput() {}
44    int touchAction;
45    double mouseXPosition;
46    double mouseYPosition;
47    int pointButton;
48    int pointAction;
49    int sourceType;
50    int sourceTool;
51    std::set<int> pressedBtnsVec;
52    std::vector<double> axisValuesArr; // 13 is array size
53};
54
55#endif // MOUSEINPUT_H
56