ManifestNameWidget.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #pragma once
  2. /*
  3. * Copyright (c) Contributors to the Open 3D Engine Project.
  4. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. *
  6. * SPDX-License-Identifier: Apache-2.0 OR MIT
  7. *
  8. */
  9. #if !defined(Q_MOC_RUN)
  10. #include <QString>
  11. #include <QLineEdit>
  12. #include <AzCore/Math/Uuid.h>
  13. #include <AzCore/std/string/string.h>
  14. #include <AzCore/Memory/SystemAllocator.h>
  15. #endif
  16. namespace AZ
  17. {
  18. namespace SceneAPI
  19. {
  20. namespace SceneUI
  21. {
  22. class ManifestNameWidget : public QLineEdit
  23. {
  24. Q_OBJECT
  25. public:
  26. AZ_CLASS_ALLOCATOR_DECL
  27. explicit ManifestNameWidget(QWidget* parent);
  28. void SetName(const char* name);
  29. void SetName(const AZStd::string& name);
  30. const AZStd::string& GetName() const;
  31. void SetFilterType(const Uuid& type);
  32. signals:
  33. void valueChanged(const AZStd::string& newValue);
  34. protected:
  35. void OnTextChanged(const QString& textValue);
  36. void UpdateStatus(const AZStd::string& newName, bool checkAvailability);
  37. bool IsAvailableName(AZStd::string& error, const AZStd::string& name) const;
  38. QString m_originalToolTip;
  39. Uuid m_filterType;
  40. AZStd::string m_name;
  41. bool m_inFailureState;
  42. };
  43. } // SceneUI
  44. } // SceneAPI
  45. } // AZ