/** * @file XTPFlowGraphNodes.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(__XTPFLOWGRAPHNODES_H__) # define __XTPFLOWGRAPHNODES_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPFlowGraphPage; class CXTPFlowGraphNode; class CXTPFlowGraphNodeCustom; /** * @brief * Represents a collection of Nodes in a page or group. * @details * Nodes are the main objects that are displayed in the flow graph. * In terms of a database, they can be thought of as tables. Nodes contain * many connection points, which are like the fields in a table. Finally, * there are connections that are used to draw a relationship between the * fields of two tables. */ class _XTP_EXT_CLASS CXTPFlowGraphNodes : public CXTPCmdTarget { protected: /** * @brief * Constructs a CXTPFlowGraphPage object. * @param pPage An associated graph page object pointer. */ CXTPFlowGraphNodes(CXTPFlowGraphPage* pPage); /** * @brief * Destroys a CXTPFlowGraphNodes object, handles cleanup and * deallocation. */ virtual ~CXTPFlowGraphNodes(); public: /** * @brief * Removes all Nodes from the page or group. */ void RemoveAll(); /** * @brief * Adds a node to a page or group. * @param pNode Reference to the Node to add. * @return * A reference to the Node that was added. */ CXTPFlowGraphNode* AddNode(CXTPFlowGraphNode* pNode); /** * @brief * Adds a custom node. * @param pNode A new custom node to add. * @return A newly added custom node object pointer. */ CXTPFlowGraphNodeCustom* AddCustomNode(CXTPFlowGraphNodeCustom* pNode = NULL); CXTPFlowGraphNodeCustom* AddResourceNode(UINT uResShapeID); /** * @brief * Removes the specified Node. * @param pNode Reference to the Node to remove. */ void Remove(CXTPFlowGraphNode* pNode); /** * @brief * Removes the specified Node from the page or group. * @param nIndex Index of the node to remove. */ void RemoveAt(int nIndex); /** * @brief * Finds and retrieves the specified Node. * @param nId ID of the node to find and retrieve. * @return * If found, then a reference to the Node with the specified ID * will be returned. Otherwise, a NULL value will be returned. */ CXTPFlowGraphNode* FindNode(int nId) const; /** * @brief * Retrieves the total number of Nodes in the page or group. * @return * The total number of Nodes in the page or group. */ int GetCount() const; /** * @brief * Gets the Node at the specified index. * @param nIndex Index of the specified Node. * @return * A reference to the specified Node. */ CXTPFlowGraphNode* GetAt(int nIndex) const; /** * @brief * Moves the specified Node to the front. * @param pNode Reference to the Node to move to the front. */ void MoveToFront(CXTPFlowGraphNode* pNode); public: /** * @brief * Call this member function to store/load a collection of Nodes * 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 Nodes * data to/from a storage. */ void DoPropExchange(CXTPPropExchange* pPX); protected: CXTPFlowGraphPage* m_pPage; /**< Pointer to the page this collection of nodes is displayed on. */ CArray m_arrNodes; /**< Collection of nodes. */ friend class CXTPFlowGraphPage; # ifdef _XTP_ACTIVEX /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPFlowGraphNodes) DECLARE_ENUM_VARIANT(CXTPFlowGraphNodes) afx_msg int OleGetItemCount(); afx_msg LPDISPATCH OleGetItem(int nIndex); afx_msg LPDISPATCH OleAddNode(); afx_msg LPDISPATCH OleAddCustomNode(); afx_msg LPDISPATCH OleAddResourceNode(int nResShapeID); afx_msg LPDISPATCH OleFindNode(int nId); /** @endcond */ # endif }; AFX_INLINE int CXTPFlowGraphNodes::GetCount() const { return (int)m_arrNodes.GetSize(); } AFX_INLINE CXTPFlowGraphNode* CXTPFlowGraphNodes::GetAt(int nIndex) const { return nIndex >= 0 && nIndex < m_arrNodes.GetSize() ? m_arrNodes[nIndex] : NULL; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPFLOWGRAPHNODES_H__) /** @endcond */