ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ccGamepadManager.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 // ##########################################################################
10 // # #
11 // # CLOUDVIEWER #
12 // # #
13 // # This program is free software; you can redistribute it and/or modify #
14 // # it under the terms of the GNU General Public License as published by #
15 // # the Free Software Foundation; version 2 or later of the License. #
16 // # #
17 // # This program is distributed in the hope that it will be useful, #
18 // # but WITHOUT ANY WARRANTY; without even the implied warranty of #
19 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
20 // # GNU General Public License for more details. #
21 // # #
22 // # COPYRIGHT: ACloudViewer project #
23 // # #
24 // ##########################################################################
25 
26 #include "CVAppCommon.h"
27 
28 // Qt
29 #include <QObject>
30 
31 class QAction;
32 class QMenu;
33 class QString;
34 
36 class GamepadInput;
37 
39 class CVAPPCOMMON_LIB_API ccGamepadManager : public QObject {
40  Q_OBJECT
41 
42 public:
43  ccGamepadManager(ecvMainAppInterface* appInterface, QObject* parent);
45 
47  QMenu* menu() { return m_menu; }
48 
49 protected:
50  void enableDevice(bool state, bool silent, int deviceID = -1);
51  void releaseDevice();
52 
53  void showMessage(QString message, bool asWarning);
54  void setupMenu();
55  void setupGamepadInput();
56 
57  void onGamepadInput();
58 
59 private:
60  ecvMainAppInterface* m_appInterface;
61  GamepadInput* m_gamepadInput;
62  QMenu* m_menu;
63  QAction* m_actionEnable;
64 };
#define CVAPPCOMMON_LIB_API
Definition: CVAppCommon.h:15
Gaempad handler.
Definition: GamepadInput.h:41
Gamepad manager.
QMenu * menu()
Returns the menu associated with gamepads.
Main application interface (for plugins)