summaryrefslogtreecommitdiffstats
path: root/xbmc/peripherals/EventLockHandle.h
blob: 7012ea8d98cd162dfd6fa7d3cac5f496ba2650a5 (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
/*
 *  Copyright (C) 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

namespace PERIPHERALS
{
class CEventLockHandle;

/*!
 * \brief Callback implemented by event scanner
 */
class IEventLockCallback
{
public:
  virtual ~IEventLockCallback(void) = default;

  virtual void ReleaseLock(CEventLockHandle& handle) = 0;
};

/*!
 * \brief Handle returned by the event scanner to disable event processing
 *
 * When held, this disables event processing.
 */
class CEventLockHandle
{
public:
  /*!
   * \brief Create an event lock handle
   */
  CEventLockHandle(IEventLockCallback& callback);

  /*!
   * \brief Handle is automatically released when this class is destructed
   */
  ~CEventLockHandle(void);

private:
  // Construction parameters
  IEventLockCallback& m_callback;
};
} // namespace PERIPHERALS