/** * @file XTPFlowGraphConnections.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(__XTPFLOWGRAPHCONNECTIONS_H__) # define __XTPFLOWGRAPHCONNECTIONS_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPFlowGraphPage; class CXTPFlowGraphConnection; /** * @brief * Represents a collection of connections for a Node. */ class _XTP_EXT_CLASS CXTPFlowGraphConnections : public CXTPCmdTarget { protected: /** * @brief * Constructs a CXTPFlowGraphConnections object. * @param pPage Target graph page object pointer. */ CXTPFlowGraphConnections(CXTPFlowGraphPage* pPage); /** * @brief * Destroys a CXTPFlowGraphConnections object, handles cleanup and * deallocation. */ virtual ~CXTPFlowGraphConnections(); public: /** * @brief * Removes all connections from the Node. */ void RemoveAll(); /** * @brief * Adds a connection to the Node. * @param pConnection Reference to the connection to add. * @return * A reference to the connection that was just added. */ CXTPFlowGraphConnection* AddConnection(CXTPFlowGraphConnection* pConnection); /** * @brief * Removes the specified connection. * @param pConnection Reference to the connection to remove. */ void Remove(CXTPFlowGraphConnection* pConnection); /** * @brief * Removes the specified connection from the Node's collection of * connections. * @param nIndex Index of the connection to remove. */ void RemoveAt(int nIndex); /** * @brief * Gets the total number of connections for the Node. * @return * The total number of connections for the Node. */ int GetCount() const; /** * @brief * Retrieves the connection at the specified index. * @param nIndex Index of the desired connection to retrieve. * @return * Reference to the connection at the specified index. */ CXTPFlowGraphConnection* GetAt(int nIndex) const; public: /** * @brief * Call this member function to store/load a collection of * connections 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 connections data to/from storage. */ void DoPropExchange(CXTPPropExchange* pPX); protected: CXTPFlowGraphPage* m_pPage; /**< Pointer to the page that displays these connections. */ CArray m_arrConnections; /**< Collection of connections. */ friend class CXTPFlowGraphPage; # ifdef _XTP_ACTIVEX /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPFlowGraphConnections) DECLARE_ENUM_VARIANT(CXTPFlowGraphConnections) afx_msg int OleGetItemCount(); afx_msg LPDISPATCH OleGetItem(int nIndex); afx_msg LPDISPATCH OleAddConnection(); /** @endcond */ # endif }; AFX_INLINE int CXTPFlowGraphConnections::GetCount() const { return (int)m_arrConnections.GetSize(); } AFX_INLINE CXTPFlowGraphConnection* CXTPFlowGraphConnections::GetAt(int nIndex) const { return nIndex >= 0 && nIndex < m_arrConnections.GetSize() ? m_arrConnections[nIndex] : NULL; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPFLOWGRAPHCONNECTIONS_H__) /** @endcond */