/* * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or * its licensors. * * For complete copyright and license terms please see the LICENSE at the root of this * distribution (the "License"). All use of this software is governed by the License, * or, if provided, by the license below or the license accompanying this file. Do not * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * */ #pragma once #include #include #include #include #include #include #include #include #include #include #include namespace GraphCanvas { //! Manages all of the start required by the bookmarks class BookmarkAnchorComponent : public GraphCanvasPropertyComponent , public BookmarkRequestBus::Handler , public SceneBookmarkRequestBus::Handler , public SceneMemberNotificationBus::Handler , public EntitySaveDataRequestBus::Handler , public BookmarkAnchorComponentSaveDataCallback { public: AZ_COMPONENT(BookmarkAnchorComponent, "{33C63E10-81EE-458D-A716-F63478E57517}"); static void Reflect(AZ::ReflectContext* reflectContext); friend class BookmarkVisualComponentSaveData; BookmarkAnchorComponent(); ~BookmarkAnchorComponent() = default; // AZ::Component void Init() override; void Activate() override; void Deactivate() override; //// // SceneMemberNotificationBus void OnSceneSet(const AZ::EntityId& sceneId) override; void OnRemovedFromScene(const AZ::EntityId& sceneId) override; void OnSceneMemberDeserialized(const AZ::EntityId& graphId, const GraphSerialization& serializationTarget) override; //// // SceneBookmarkRequests AZ::EntityId GetBookmarkId() const override; //// // BookmarkRequestBus void RemoveBookmark() override; int GetShortcut() const override; void SetShortcut(int quickIndex) override; AZStd::string GetBookmarkName() const override; void SetBookmarkName(const AZStd::string& bookmarkName) override; QRectF GetBookmarkTarget() const override; QColor GetBookmarkColor() const override; //// // EntitySaveDataRequestBus void WriteSaveData(EntitySaveDataContainer& saveDataContainer) const override; void ReadSaveData(const EntitySaveDataContainer& saveDataContainer) override; //// protected: // SaveDataCallback void OnBookmarkNameChanged() override; void OnBookmarkColorChanged() override; //// private: BookmarkAnchorComponentSaveData m_saveData; AZ::EntityId m_sceneId; }; }