3
0

AtomToolsFrameworkSystemComponent.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 <AtomToolsFramework/AtomToolsFrameworkSystemRequestBus.h>
  10. #include <AzCore/Component/Component.h>
  11. #include <AzCore/Settings/SettingsRegistry.h>
  12. namespace AtomToolsFramework
  13. {
  14. class AtomToolsFrameworkSystemComponent
  15. : public AZ::Component
  16. , public AtomToolsFrameworkSystemRequestBus::Handler
  17. {
  18. public:
  19. AZ_COMPONENT(AtomToolsFrameworkSystemComponent, "{4E0307A7-5EF4-4E00-BFF1-9B77F2401D2E}");
  20. static void Reflect(AZ::ReflectContext* context);
  21. static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
  22. static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
  23. static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
  24. static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent);
  25. protected:
  26. // AZ::Component interface overrides...
  27. void Init() override;
  28. void Activate() override;
  29. void Deactivate() override;
  30. // AtomToolsFrameworkSystemRequestBus::Handler overrides...
  31. bool IsPathIgnored(const AZStd::string& path) const override;
  32. bool IsPathEditable(const AZStd::string& path) const override;
  33. bool IsPathPreviewable(const AZStd::string& path) const override;
  34. private:
  35. void ReadSettings();
  36. bool m_ignoreCacheFolder{ true };
  37. AZStd::vector<AZStd::string> m_ignoredPathRegexPatterns;
  38. AZStd::unordered_map<AZStd::string, bool> m_editablePathSettings;
  39. AZStd::unordered_map<AZStd::string, bool> m_previewablePathSettings;
  40. AZStd::string m_cacheFolder;
  41. AZ::SettingsRegistryInterface::NotifyEventHandler m_settingsNotifyEventHandler;
  42. };
  43. } // namespace AtomToolsFramework