/* * 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 // qbrush.h(118): warning C4251: 'QBrush::d': class 'QScopedPointer' needs to have dll-interface to be used by clients of class 'QBrush' // qwidget.h(858): warning C4800: 'uint': forcing value to bool 'true' or 'false' (performance warning) AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") #include #include #include #include AZ_POP_DISABLE_WARNING #include #include #include #include #include #include #include #include #include #include #include // Qt Generated // warning C4251: 'QLayoutItem::align': class 'QFlags' needs to have dll-interface to be used by clients of class 'QLayoutItem' AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") #include AZ_POP_DISABLE_WARNING namespace ScriptCanvasEditor { class LoggingWindowFilterModel : public QSortFilterProxyModel { public: AZ_CLASS_ALLOCATOR(LoggingWindowFilterModel, AZ::SystemAllocator, 0); LoggingWindowFilterModel() = default; bool filterAcceptsRow(int sourceRow, const QModelIndex& sourceParent) const override; void SetFilter(const QString& filter); void ClearFilter(); bool HasFilter() const; private: QString m_filter; DebugLogFilter m_logFilter; }; class LoggingWindowSession : public QWidget , public GraphCanvas::AssetEditorNotificationBus::Handler , public GraphCanvas::SceneNotificationBus::Handler { Q_OBJECT protected: LoggingWindowSession(QWidget* parentWidget = nullptr); public: ~LoggingWindowSession() override; const LoggingDataId& GetDataId() const; void ClearFilter(); // GraphCanvas::AssetEditorNotificationBus void OnActiveGraphChanged(const AZ::EntityId& graphId) override; //// // GraphCanvas::SceneNotificationBus void OnSelectionChanged() override; //// protected: void RegisterTreeRoot(DebugLogRootItem* debugRoot); void SetDataId(const LoggingDataId& loggingDataId); virtual void OnCaptureButtonPressed() = 0; virtual void OnPlaybackButtonPressed() = 0; virtual void OnOptionsButtonPressed() = 0; virtual void OnTargetChanged(int currentIndex) = 0; void OnExpandAll(); void OnCollapseAll(); protected: AZStd::unique_ptr< Ui::LoggingWindowSession > m_ui; private: void OnSearchFilterChanged(const QString& filterString); void OnLogScrolled(int value); void OnLogItemExpanded(const QModelIndex& modelIndex); void OnLogRangeChanged(int min, int max); void OnLogClicked(const QModelIndex& modelIndex); void OnLogDoubleClicked(const QModelIndex& modelIndex); void OnLogSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected); ExecutionLogTreeItem* ResolveExecutionItem(const QModelIndex& proxyModelIndex); void HandleQueuedFocus(); void FocusOnElement(const AZ::Data::AssetId& assetId, const AZ::EntityId& assetNodeId); void HighlightElement(const AZ::Data::AssetId& assetId, const AZ::EntityId& assetNodeId); void RemoveHighlight(const AZ::Data::AssetId& assetId, const AZ::EntityId& assetNodeId); void ScrollToSelection(); void ClearLoggingSelection(); bool m_clearSelectionOnSceneSelectionChange; bool m_scrollToBottom; LoggingDataId m_loggingDataId; DebugLogRootItem* m_debugRoot; GraphCanvas::GraphCanvasTreeModel* m_treeModel; LoggingWindowFilterModel* m_filterModel; AZStd::unordered_map< AZ::EntityId, GraphCanvas::GraphicsEffectId > m_highlightEffects; QTimer m_focusDelayTimer; AZ::Data::AssetId m_assetId; AZ::EntityId m_assetNodeId; }; }