/** * @file XTPFlowGraphConnectionPoints.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(__XTPFLOWGRAPHCONNECTIONPOINTS_H__) # define __XTPFLOWGRAPHCONNECTIONPOINTS_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPFlowGraphNode; class CXTPFlowGraphConnectionPoint; /** * @brief * Represents a collection of connection points for a Node. * @details * Connection points are added to a Node and can have no input points, * only input or output points, or both. */ class _XTP_EXT_CLASS CXTPFlowGraphConnectionPoints : public CXTPCmdTarget { protected: /** * @brief * Constructs a CXTPFlowGraphConnectionPoints object. * @param pNode Target grpah node object pointer. */ CXTPFlowGraphConnectionPoints(CXTPFlowGraphNode* pNode); /** * @brief * Destroys a CXTPFlowGraphConnectionPoints object, handles cleanup * and deallocation. */ virtual ~CXTPFlowGraphConnectionPoints(); public: /** * @brief * Adds a connection point to the Node. * @param pConnectionPoint Reference to the connection point to add. * @param nIndex Point index. * @return * A reference to the connection point that was just added. */ CXTPFlowGraphConnectionPoint* AddConnectionPoint(CXTPFlowGraphConnectionPoint* pConnectionPoint, int nIndex = -1); /** * @brief * Removes all connection points from the Node. */ void RemoveAll(); /** * @brief * Removes a specified connection point. * @param pConnectionPoint Reference to the connection point to remove. * @param bRemovePairs Indicates whether to remove the other connection * point with the same name (but different type (in & out)). */ void Remove(CXTPFlowGraphConnectionPoint* pConnectionPoint, BOOL bRemovePairs = TRUE); /** * @brief * Removes a specified connection point from the Node's collection * of connection points. * @param bRemovePairs Indicates whether to remove the other connection * @param nIndex Index of the connection point to remove. * @param bSkipUndoTask TRUE to skip undo task. */ void RemoveAt(int nIndex, BOOL bRemovePairs = TRUE, BOOL bSkipUndoTask = FALSE); /** * @brief * Retrieves the total number of connections points for the Node. * @return * The total number of connections points for the Node. */ int GetCount() const; /** * @brief * Retrieves the connection point at the specified index. * @param nIndex Index of the desired connection point to retrieve. * @return * Reference to the connection point at the specified index. */ CXTPFlowGraphConnectionPoint* GetAt(int nIndex) const; /** * @brief * Finds and retrieves the specified connection point by searching for * the connection point's name. There can be 2 connection points with the same * name, but a different type (in & out), so sometimes you should provide a type. * @param lpszName Name of the connection point to find. * @param type Type object pointer. * @return * A reference to the FlowGraphConnectionPoint if found, otherwise NULL. */ CXTPFlowGraphConnectionPoint* FindConnectionPoint( LPCTSTR lpszName, XTPFlowGraphConnectionPointType type = xtpFlowGraphPointNone) const; /** * @brief * Finds and retrieves the specified connection point. * @param nId ID of the connection point to find. * @return * A reference to the FlowGraphConnectionPoint if found, otherwise NULL. */ CXTPFlowGraphConnectionPoint* FindConnectionPoint(int nId) const; /** * @brief * Finds and retrieves the specified connection point by searching for * the connection point's caption. There can be 2 connection points with the same * caption, but a different type (in & out), so sometimes you should provide a type. * @param lpszCaption Caption of the connection point to find. * @param type Type object pointer. * @return * A reference to the FlowGraphConnectionPoint if found, otherwise NULL. */ CXTPFlowGraphConnectionPoint* FindConnectionPointByCaption( LPCTSTR lpszCaption, XTPFlowGraphConnectionPointType type = xtpFlowGraphPointNone) const; public: /** * @brief * Call this member function to store/load a collection of connection * points 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 * connection points data to/from storage. */ void DoPropExchange(CXTPPropExchange* pPX); protected: CXTPFlowGraphNode* m_pNode; /**< Reference to the node that uses the connection points from this collection.*/ CArray m_arrConnectionPoints; /**< Collection of connection points. */ friend class CXTPFlowGraphNode; # ifdef _XTP_ACTIVEX /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPFlowGraphConnectionPoints) DECLARE_ENUM_VARIANT(CXTPFlowGraphConnectionPoints) afx_msg int OleGetItemCount(); afx_msg LPDISPATCH OleGetItem(int nIndex); afx_msg LPDISPATCH OleFindConnectionPoint(int nId); afx_msg LPDISPATCH OleFindConnectionPointByCaption(LPCTSTR lpszCaption, const VARIANT& vtType); afx_msg LPDISPATCH OleFindConnectionPointByName(LPCTSTR lpszName, const VARIANT& vtType); /** @endcond */ # endif }; AFX_INLINE int CXTPFlowGraphConnectionPoints::GetCount() const { return (int)m_arrConnectionPoints.GetSize(); } AFX_INLINE CXTPFlowGraphConnectionPoint* CXTPFlowGraphConnectionPoints::GetAt(int nIndex) const { return nIndex >= 0 && nIndex < m_arrConnectionPoints.GetSize() ? m_arrConnectionPoints[nIndex] : NULL; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPFLOWGRAPHCONNECTIONPOINTS_H__) /** @endcond */