Debian Codegraph @

xbmc/input/mouse/interfaces/IMouseDriverHandler.h

raw
1 /*
2 * Copyright (C) 2016-2024 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
8
9 #pragma once
10
11 #include "input/mouse/MouseTypes.h"
12
13 namespace KODI
14 {
15 namespace MOUSE
16 {
17 /*!
18 * \ingroup mouse
19 *
20 * \brief Interface for handling mouse driver events
21 */
22 class IMouseDriverHandler
23 {
24 public:
25 virtual ~IMouseDriverHandler(void) = default;
26
27 /*!
28 * \brief Handle mouse position updates
29 *
30 * \param x The new x coordinate of the pointer
31 * \param y The new y coordinate of the pointer
32 *
33 * The mouse uses a left-handed (graphics) cartesian coordinate system.
34 * Positive X is right, positive Y is down.
35 *
36 * \return True if the event was handled, false otherwise
37 */
38 virtual bool OnPosition(int x, int y) = 0;
39
40 /*!
41 * \brief A mouse button has been pressed
42 *
43 * \param button The index of the pressed button
44 *
45 * \return True if the event was handled, otherwise false
46 */
47 virtual bool OnButtonPress(BUTTON_ID button) = 0;
48
49 /*!
50 * \brief A mouse button has been released
51 *
52 * \param button The index of the released button
53 */
54 virtual void OnButtonRelease(BUTTON_ID button) = 0;
55 };
56 } // namespace MOUSE
57 } // namespace KODI