IconComponent.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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/Math/Uuid.h>
  10. #include <AzCore/Component/Component.h>
  11. #include <Editor/Include/ScriptCanvas/Bus/IconBus.h>
  12. namespace ScriptCanvasEditor
  13. {
  14. class IconComponent
  15. : public AZ::Component
  16. , public IconBus::Handler
  17. {
  18. public:
  19. AZ_COMPONENT(IconComponent, "{242FEF0E-1E3D-4F49-877F-F83E6B70F138}");
  20. static AZStd::string LookupClassIcon(const AZ::Uuid& classId);
  21. IconComponent() = default;
  22. IconComponent(const AZ::Uuid& classId);
  23. ~IconComponent() = default;
  24. static void Reflect(AZ::ReflectContext* serialize);
  25. // AZ::Component
  26. static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
  27. static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent);
  28. static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
  29. static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
  30. void Init() override;
  31. void Activate() override;
  32. void Deactivate() override;
  33. // IconBus
  34. AZStd::string GetIconPath() const override;
  35. private:
  36. AZStd::string m_iconPath;
  37. };
  38. }