ccGamepadManager.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #pragma once
  2. //##########################################################################
  3. //# #
  4. //# CLOUDCOMPARE #
  5. //# #
  6. //# This program is free software; you can redistribute it and/or modify #
  7. //# it under the terms of the GNU General Public License as published by #
  8. //# the Free Software Foundation; version 2 or later of the License. #
  9. //# #
  10. //# This program is distributed in the hope that it will be useful, #
  11. //# but WITHOUT ANY WARRANTY; without even the implied warranty of #
  12. //# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
  13. //# GNU General Public License for more details. #
  14. //# #
  15. //# COPYRIGHT: CloudCompare project #
  16. //# #
  17. //##########################################################################
  18. #include "CCAppCommon.h"
  19. //Qt
  20. #include <QObject>
  21. class QAction;
  22. class QMenu;
  23. class QString;
  24. class ccMainAppInterface;
  25. class GamepadInput;
  26. //! Gamepad manager
  27. class CCAPPCOMMON_LIB_API ccGamepadManager : public QObject
  28. {
  29. Q_OBJECT
  30. public:
  31. ccGamepadManager(ccMainAppInterface* appInterface, QObject* parent);
  32. ~ccGamepadManager() override;
  33. //! Returns the menu associated with gamepads
  34. QMenu* menu() { return m_menu; }
  35. protected:
  36. void enableDevice(bool state, bool silent, int deviceID = -1);
  37. void releaseDevice();
  38. void showMessage(QString message, bool asWarning);
  39. void setupMenu();
  40. void setupGamepadInput();
  41. void onGamepadInput();
  42. private:
  43. ccMainAppInterface* m_appInterface;
  44. GamepadInput* m_gamepadInput;
  45. QMenu* m_menu;
  46. QAction* m_actionEnable;
  47. };