/** * @file XTPFlowGraphElement.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(__XTPFLOWGRAPHELEMENT_H__) # define __XTPFLOWGRAPHELEMENT_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPFlowGraphControl; class CXTPFlowGraphPage; /** * @brief * Base class for all elements in the flow graph. * @details * Every object in the flow graph is derived from FlowGraphElement. It is * commonly used when referencing an object that can be many different * types. For example, when using HitTest, the returned object is a * FlowGraphElement and then you can cast it to the appropriate type. */ class _XTP_EXT_CLASS CXTPFlowGraphElement : public CXTPCmdTarget { DECLARE_DYNAMIC(CXTPFlowGraphElement); public: /** * @brief * Constructs a CXTPFlowGraphElement object. */ CXTPFlowGraphElement(); /** * @brief * Destroys a CXTPFlowGraphElement object, handles cleanup and * deallocation. */ virtual ~CXTPFlowGraphElement(); public: /** * @brief * Gets a reference to the parent FlowGraph control. * @return * A reference to the parent FlowGraph control. */ virtual CXTPFlowGraphControl* GetControl() const = 0; /** * @brief * Retrieves a reference to the flow graph page that this element is * displayed on. * @return * A reference to the flow graph page that this element is * displayed on. */ virtual CXTPFlowGraphPage* GetPage() const = 0; /** * @brief * Determines if the element is currently selected. * @return * TRUE if the element is currently selected, otherwise FALSE. */ BOOL IsSelected() const; /** * @brief * This method is called when the flow graph layout is changed. * @details * This method is called when the page zoom level, page scroll offset, * window/Node size, window handle, Node style, Node color, or * connection style is changed. */ void OnGraphChanged(); /** * @brief * This method is called when the element is removed. */ virtual void OnRemoved(); /** * @brief * Sets the caption to be displayed for this element. * @param lpszCaption The caption to be displayed for this element. */ virtual void SetCaption(LPCTSTR lpszCaption) = 0; /** * @brief * Gets the caption displayed for this element. * @return * The caption displayed for this element. */ virtual CString GetCaption() const = 0; public: BOOL m_bDirty; /**< Internally used to tell the flow graph that the element has changed. This will tell Reposition to handle the element. */ protected: BOOL m_bSelected; /**< Specifies whether the element is selected. TRUE if selected, FALSE otherwise. */ friend class CXTPFlowGraphSelectedElements; # ifdef _XTP_ACTIVEX /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPFlowGraphElement) /** @endcond */ # endif }; /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPFLOWGRAPHELEMENT_H__) /** @endcond */