TargetContextButton.hxx 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #ifndef INC_TARGETCONTEXTBUTTON_H
  9. #define INC_TARGETCONTEXTBUTTON_H
  10. #if !defined(Q_MOC_RUN)
  11. #include <AzCore/base.h>
  12. #include <AzCore/Memory/SystemAllocator.h>
  13. #include <Source/LUA/LUAContextControlMessages.h>
  14. #include <QPushButton>
  15. #include <QWidgetAction>
  16. #endif
  17. #pragma once
  18. namespace LUA
  19. {
  20. class TargetContextButton
  21. : public QPushButton
  22. , private LUAEditor::Context_ControlManagement::Handler
  23. {
  24. Q_OBJECT
  25. public:
  26. AZ_CLASS_ALLOCATOR(TargetContextButton, AZ::SystemAllocator);
  27. TargetContextButton(QWidget *pParent = 0);
  28. virtual ~TargetContextButton();
  29. // These come from the CONTEXT
  30. void OnDebuggerAttached(){}
  31. void OnDebuggerRefused(){}
  32. void OnDebuggerDetached(){}
  33. void OnTargetConnected(){}
  34. void OnTargetDisconnected(){}
  35. void OnTargetContextPrepared( AZStd::string &contextName );
  36. private slots:
  37. void DoPopup();
  38. };
  39. class TargetContextButtonAction : public QWidgetAction
  40. {
  41. Q_OBJECT
  42. public:
  43. AZ_CLASS_ALLOCATOR(TargetContextButtonAction,AZ::SystemAllocator,0);
  44. TargetContextButtonAction(QObject *pParent); // create default action
  45. protected:
  46. virtual QWidget* createWidget(QWidget* pParent);
  47. };
  48. }
  49. #endif //INC_TARGETCONTEXTBUTTON_H