RobotImporterWidgetUtils.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  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. #include <AzCore/IO/Path/Path.h>
  10. #include <QWidget>
  11. #include <optional>
  12. namespace ROS2::RobotImporterWidgetUtils
  13. {
  14. enum ExistingPrefabAction
  15. {
  16. Overwrite,
  17. CreateWithNewName,
  18. Cancel
  19. };
  20. //! Get valid path to the existing URDF file from the user
  21. //! @return valid path to the existing URDF file or empty optional if the user canceled the operation
  22. //! @param parent - parent widget for the widgets used inside this function
  23. AZStd::optional<AZStd::string> QueryUserForURDFPath(QWidget* parent = nullptr);
  24. //! Validate whether a path exists. If yes, ask user to take a proper action to provide correct path.
  25. //! @param path - path to validate
  26. //! @param parent - parent widget for the widgets used inside this function
  27. //! @return Valid path or an empty optional if it was not possible or user cancelled.
  28. AZStd::optional<AZ::IO::Path> ValidatePrefabPathExistenceAndQueryUserForNewIfNecessary(
  29. const AZ::IO::Path& path, QWidget* parent = nullptr);
  30. } // namespace ROS2::RobotImporterWidgetUtils