summaryrefslogtreecommitdiffstats
path: root/xbmc/input/mouse/interfaces/IMouseInputHandler.h
blob: 910ddd4c1dd632df4c4a4dd1c06752c224cb24a5 (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
57
58
59
60
61
62
63
64
65
66
/*
 *  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"

#include <string>

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

  /*!
   * \brief The controller profile for this mouse input handler
   *
   * \return The ID of the add-on extending kodi.game.controller
   */
  virtual std::string ControllerID(void) const = 0;

  /*!
   * \brief A relative pointer has moved
   *
   * \param relpointer   The name of the relative pointer being moved
   * \param dx           The relative x coordinate of motion
   * \param dy           The relative y coordinate of motion
   *
   * 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, otherwise false
   */
  virtual bool OnMotion(const PointerName& relpointer, int dx, int dy) = 0;

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

  /*!
   * \brief A mouse button has been released
   *
   * \param button      The name of the feature being released
   */
  virtual void OnButtonRelease(const ButtonName& button) = 0;
};
} // namespace MOUSE
} // namespace KODI