/** * @file XTPFlowGraphNodeGroups.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(__XTPFLOWGRAPHNODEGROUPS_H__) # define __XTPFLOWGRAPHNODEGROUPS_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPFlowGraphPage; class CXTPFlowGraphNode; /** * @brief * Represents a collection of groups in a page. * @details * A group is just a "box" that is used to visually group Nodes * together. By default, the group will only be shown when a Node in * the group is selected, but you can choose to always show the * groups with ShowNodeGroupsAlways. */ class _XTP_EXT_CLASS CXTPFlowGraphNodeGroups : public CXTPCmdTarget { protected: /** * @brief * Constructs a CXTPFlowGraphNodeGroups object. * @param pPage An associated graph page object pointer. */ CXTPFlowGraphNodeGroups(CXTPFlowGraphPage* pPage); /** * @brief * Destroys a CXTPFlowGraphNodeGroups object, handles cleanup and * deallocation. */ virtual ~CXTPFlowGraphNodeGroups(); public: /** * @brief * Removes all groups from the collection. */ void RemoveAll(); /** * @brief * Adds a group to the page's collection of groups. * @return * A reference to the group added. */ CXTPFlowGraphNodeGroup* AddGroup(); /** * @brief * Retrieves the total number of groups in the collection. * @return * The total number of groups in the collection. */ int GetCount() const; /** * @brief * Gets the group at a specified index in the collection. * @param nIndex Index of the group in the collection. * @return * A reference to the group at the specified index in the collection. */ CXTPFlowGraphNodeGroup* GetAt(int nIndex) const; /** * @brief * Removes a specific group from the collection. * @param pGroup Reference to the group to remove. */ void Remove(CXTPFlowGraphNodeGroup* pGroup); /** * @brief * Retrieves a reference to the flow graph page that this collection * of groups are displayed on. * @return * A reference to the flow graph page that this collection of groups * are displayed on. */ CXTPFlowGraphPage* GetPage() const; protected: CXTPFlowGraphPage* m_pPage; /**< Pointer to the page that this collection of groups is displayed on. */ CArray m_arrGroups; /**< Collection of groups. */ friend class CXTPFlowGraphPage; # ifdef _XTP_ACTIVEX /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPFlowGraphNodeGroups) DECLARE_ENUM_VARIANT(CXTPFlowGraphNodeGroups) afx_msg LPDISPATCH OleGetItem(int nIndex); afx_msg int OleGetItemCount(); afx_msg LPDISPATCH OleAddGroup(); afx_msg void OleRemoveGroup(LPDISPATCH Group); /** @endcond */ # endif }; AFX_INLINE CXTPFlowGraphPage* CXTPFlowGraphNodeGroups::GetPage() const { return m_pPage; } AFX_INLINE int CXTPFlowGraphNodeGroups::GetCount() const { return (int)m_arrGroups.GetSize(); } AFX_INLINE CXTPFlowGraphNodeGroup* CXTPFlowGraphNodeGroups::GetAt(int nIndex) const { return nIndex >= 0 && nIndex < m_arrGroups.GetSize() ? m_arrGroups[nIndex] : NULL; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPFLOWGRAPHNODEGROUPS_H__) /** @endcond */