PlatformSelectionWidget.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. #pragma once
  9. #if !defined(Q_MOC_RUN)
  10. #include <AzCore/std/smart_ptr/unique_ptr.h>
  11. #include <AzFramework/Platform/PlatformDefaults.h>
  12. #include <QCheckBox>
  13. #include <QSharedPointer>
  14. #include <QWidget>
  15. #endif
  16. namespace Ui
  17. {
  18. class PlatformSelectionWidget;
  19. }
  20. namespace AssetBundler
  21. {
  22. class PlatformSelectionWidget
  23. : public QWidget
  24. {
  25. Q_OBJECT
  26. public:
  27. explicit PlatformSelectionWidget(QWidget* parent);
  28. virtual ~PlatformSelectionWidget() {}
  29. void Init(const AzFramework::PlatformFlags& enabledPlatforms, const QString& disabledPatformMessageOverride = "");
  30. void SetSelectedPlatforms(
  31. const AzFramework::PlatformFlags& selectedPlatforms,
  32. const AzFramework::PlatformFlags& partiallySelectedPlatforms);
  33. AzFramework::PlatformFlags GetSelectedPlatforms();
  34. AzFramework::PlatformFlags GetPartiallySelectedPlatforms();
  35. Q_SIGNALS:
  36. void PlatformsSelected(AzFramework::PlatformFlags selectedPlatforms, AzFramework::PlatformFlags partiallySelectedPlatforms);
  37. private:
  38. void OnPlatformSelectionChanged();
  39. QSharedPointer<Ui::PlatformSelectionWidget> m_ui;
  40. AZStd::unique_ptr<AzFramework::PlatformHelper> m_platformHelper;
  41. QVector<QSharedPointer<QCheckBox>> m_platformCheckBoxes;
  42. AZStd::vector<AzFramework::PlatformFlags> m_platformList;
  43. AzFramework::PlatformFlags m_selectedPlatforms;
  44. AzFramework::PlatformFlags m_partiallySelectedPlatforms;
  45. };
  46. } // namespace AssetBundler