/** * @file XTPFlowGraphPages.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(__XTPFLOWGRAPHPAGES_H__) # define __XTPFLOWGRAPHPAGES_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPFlowGraphControl; class CXTPFlowGraphPage; /** * @brief * Represents a collection of pages in the flow graph. * @details * A page is what contains all the elements in the flow graph. The * flow graph can contain many pages, each of which can contain * Nodes, Node groups, and connections. A page is the first thing that * you must add to the flow graph and then you can add elements * to the pages. */ class _XTP_EXT_CLASS CXTPFlowGraphPages : public CXTPCmdTarget { protected: /** * @brief * Constructs a CXTPFlowGraphPages object. * @param pControl Pointer to the flow graph control. */ CXTPFlowGraphPages(CXTPFlowGraphControl* pControl); /** * @brief * Destroys a CXTPFlowGraphPages object, handles cleanup and * deallocation. */ virtual ~CXTPFlowGraphPages(); public: /** * @brief * Adds a page to the flow graph. * @param pPage Reference to the page to add. * @return * A reference to the newly added FlowGraphPage. */ CXTPFlowGraphPage* AddPage(CXTPFlowGraphPage* pPage); /** * @brief * Removes all pages from the flow graph. */ void RemoveAll(); /** * @brief * Retrieves the total number of pages in the flow graph. * @return * The total number of pages in the flow graph. */ int GetCount() const; /** * @brief * Gets a page at the specified index from the FlowGraph's collection * of pages. * @param nIndex Index of the specified page. * @return * A reference to the specified FlowGraphPage. */ CXTPFlowGraphPage* GetAt(int nIndex) const; /** * @brief * Removes a page from the FlowGraph. * @param pPage Reference to the page to remove. */ void Remove(CXTPFlowGraphPage* pPage); /** * @brief * Removes the specified page from the FlowGraph. * @param nIndex Index of the page to remove. */ void RemoveAt(int nIndex); /** * @brief * Finds and retrieves the specified page. * @param nId ID of the page to find and retrieve. * @return * A reference to the page with the specified ID if found, otherwise NULL. */ CXTPFlowGraphPage* FindPage(int nId) const; public: /** * @brief * Call this member function to store/load a collection of pages * using the specified data object. * @param pPX Source/destination CXTPPropExchange data object reference. * @details * This member function is used to store/load a collection of pages * data to/from storage. */ void DoPropExchange(CXTPPropExchange* pPX); protected: CArray m_arrPages; /**< Collection of pages in the flow graph control. */ CXTPFlowGraphControl* m_pControl; /**< Pointer to the parent flow graph control. */ friend class CXTPFlowGraphControl; # ifdef _XTP_ACTIVEX /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPFlowGraphPages) DECLARE_ENUM_VARIANT(CXTPFlowGraphPages) afx_msg int OleGetItemCount(); afx_msg LPDISPATCH OleGetItem(int nIndex); afx_msg LPDISPATCH OleAddPage(); afx_msg LPDISPATCH OleFindPage(int nId); /** @endcond */ # endif }; AFX_INLINE int CXTPFlowGraphPages::GetCount() const { return (int)m_arrPages.GetSize(); } AFX_INLINE CXTPFlowGraphPage* CXTPFlowGraphPages::GetAt(int nIndex) const { return nIndex >= 0 && nIndex < m_arrPages.GetSize() ? m_arrPages[nIndex] : NULL; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPFLOWGRAPHPAGES_H__) /** @endcond */