summaryrefslogtreecommitdiffstats
path: root/xbmc/input/mouse/interfaces/IMouseDriverHandler.h
blob: 7989e39465ad977214ff5d4f099c00802e2e500b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
 *  Copyright (C) 2016-2018 Team Kodi
 *  This file is part of Kodi - https://kodi.tv
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 *  See LICENSES/README.md for more information.
 */

#pragma once

#include "input/mouse/MouseTypes.h"

namespace KODI
{
namespace MOUSE
{
/*!
 * \ingroup mouse
 * \brief Interface for handling mouse driver events
 */
class IMouseDriverHandler
{
public:
  virtual ~IMouseDriverHandler(void) = default;

  /*!
   * \brief Handle mouse position updates
   *
   * \param x  The new x coordinate of the pointer
   * \param y  The new y coordinate of the pointer
   *
   * The mouse uses a left-handed (graphics) cartesian coordinate system.
   * Positive X is right, positive Y is down.
   *
   * \return True if the event was handled, false otherwise
   */
  virtual bool OnPosition(int x, int y) = 0;

  /*!
   * \brief A mouse button has been pressed
   *
   * \param button   The index of the pressed button
   *
   * \return True if the event was handled, otherwise false
   */
  virtual bool OnButtonPress(BUTTON_ID button) = 0;

  /*!
   * \brief A mouse button has been released
   *
   * \param button   The index of the released button
   */
  virtual void OnButtonRelease(BUTTON_ID button) = 0;
};
} // namespace MOUSE
} // namespace KODI