/** * @file XTPFlowGraphPageHistory.h * * @copyright * (c) 1998-2025 Codejock Software, All Rights Reserved. * * This source file is the property of Codejock Software and must not be * redistributed by any means without the explicit written permission of * Codejock Software. * * The use of this source code is governed by the terms and conditions specified * in the Toolkit Pro license agreement. Codejock Software grants you, as a * single software developer, the limited right to use this software on one * computer only. * * Contact Information: * support@codejock.com * http://www.codejock.com * */ /** @cond */ #if !defined(__XTPFLOWGRAPHPAGEHISTORY_H__) # define __XTPFLOWGRAPHPAGEHISTORY_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPFlowGraphControl; class CXTPFlowGraphNodes; class CXTPFlowGraphNodeGroups; class CXTPFlowGraphConnections; class CXTPFlowGraphDrawContext; class CXTPPropExchange; class CXTPFlowGraphSelectedElements; class CXTPFlowGraphNode; /** * @brief * Used internally to store Node history for history operations. */ struct CXTPFlowGraphPageHistoryItem { CXTPFlowGraphNode* pFrom; /**< Pointer to the previous Node. */ CXTPFlowGraphNode* pTo; /**< Pointer to the destination Node. */ }; /** * @brief * Object that contains page transition history for the flow graph. */ class _XTP_EXT_CLASS CXTPFlowGraphPageHistory : public CXTPCmdTarget { public: /** * @brief * Constructs a CXTPFlowGraphPageHistory object. * @param pControl Pointer to the flow graph control. */ CXTPFlowGraphPageHistory(CXTPFlowGraphControl* pControl); protected: /** * @brief * Destroys a CXTPFlowGraphPageHistory object, handles cleanup and * deallocation. */ virtual ~CXTPFlowGraphPageHistory(); public: /** * @brief * Moves to the next page in the flow graph's history (if available). */ void GoForward(); /** * @brief * Moves to the previous page in the flow graph's history (if available). */ void GoBackward(); /** * @brief * Checks if a GoForward operation can be performed. * @return * TRUE if a GoForward operation can be performed. */ BOOL CanGoForward() const; /** * @brief * Checks if a GoBack operation can be performed. * @details * A GoForward or page transition operation must be performed before * a GoBack operation can be performed. * @return * TRUE if a GoBack operation can be performed. */ BOOL CanGoBackward() const; /** * @brief * Clears the history of the flow graph. */ void Clear(); /** * @brief * This method will transition from a Node on the current page to a Node * on a different page. * @param pNodeFrom Reference to a Node on the current page to transition from. * @param pNodeTo Reference to a Node on a different page to transition to. * @details * AnimatePageTransition will transition from a Node on the current page * to a Node on a different page. This will cause the active page to * change to the page that contains the Node that was transitioned to. */ void AnimatePageTransition(CXTPFlowGraphNode* pNodeFrom, CXTPFlowGraphNode* pNodeTo); protected: CXTPFlowGraphControl* m_pControl; /**< Pointer to the parent flow graph control. */ CArray m_arrPageUndo; /**< Contains all the undo actions from the history. */ CArray m_arrPageRedo; /**< Contains all the redo actions from the history. */ # ifdef _XTP_ACTIVEX /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPFlowGraphPageHistory); void OleAnimatePageTransition(LPDISPATCH lpDispFrom, LPDISPATCH lpDispTo); /** @endcond */ # endif }; /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPFLOWGRAPHPAGEHISTORY_H__) /** @endcond */