xbmc
GUICardinalFeatureButton.h
1 /*
2  * Copyright (C) 2016-2018 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 "GUIFeatureButton.h"
12 
13 namespace KODI
14 {
15 namespace GAME
16 {
18 {
19 public:
20  CGUICardinalFeatureButton(const CGUIButtonControl& buttonTemplate,
21  IConfigurationWizard* wizard,
22  const CPhysicalFeature& feature,
23  unsigned int index);
24 
25  ~CGUICardinalFeatureButton() override = default;
26 
27  // implementation of IFeatureButton
28  bool PromptForInput(CEvent& waitEvent) override;
29  bool IsFinished() const override;
30  INPUT::CARDINAL_DIRECTION GetCardinalDirection() const override;
31  void Reset() override;
32 
33 private:
34  enum class STATE
35  {
36  CARDINAL_DIRECTION_UP,
37  CARDINAL_DIRECTION_RIGHT,
38  CARDINAL_DIRECTION_DOWN,
39  CARDINAL_DIRECTION_LEFT,
40  FINISHED,
41  };
42 
43  STATE m_state;
44 };
45 
48 } // namespace GAME
49 } // namespace KODI
This is an Event class built from a ConditionVariable.
Definition: Event.h:35
INPUT::CARDINAL_DIRECTION GetCardinalDirection() const override
Get the direction of the next analog stick or relative pointer prompt.
Definition: GUICardinalFeatureButton.cpp:76
bool IsFinished() const override
Check if the button supports further calls to PromptForInput()
Definition: GUICardinalFeatureButton.cpp:71
Definition: GUICardinalFeatureButton.h:17
Definition: GUIButtonControl.h:27
A wizard to direct user input.
Definition: IConfigurationWindow.h:221
Definition: GUIFeatureButton.h:21
bool PromptForInput(CEvent &waitEvent) override
Prompt the user for a single input element.
Definition: GUICardinalFeatureButton.cpp:27
Controller configuration window.
Definition: AudioDecoder.h:18
Definition: PhysicalFeature.h:24
void Reset() override
Reset button after prompting for input has finished.
Definition: GUICardinalFeatureButton.cpp:97