/** * @file XTPGridHyperlink.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(__XTPGRIDRECORDHYPERLINK_H__) # define __XTPGRIDRECORDHYPERLINK_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPPropExchange; /** * @brief * This class stores the anchor styles. */ class _XTP_EXT_CLASS CXTPGridHyperlinkStyle : public CXTPCmdTarget { public: /** * @brief * Constructs the object and initializes the color and text decoration. * @param color Color. * @param textDecoration Text decoration. */ CXTPGridHyperlinkStyle(COLORREF color, XTPGridTextDecoration textDecoration); /** * @brief * Gets the color of the anchor text. * @return * The color of the anchor text. */ COLORREF GetColor() const; /** * @brief * Sets the color for the anchor text. * @param color New color to be set. */ void SetColor(COLORREF color); /** * @brief * Gets the text decoration of the anchor text. * @return * The text decoration of the anchor text. */ XTPGridTextDecoration GetTextDecoration() const; /** * @brief * Sets the text decoration for the anchor text. * @param textDecoration New text decoration to be set. */ void SetTextDecoration(XTPGridTextDecoration textDecoration); protected: # ifdef _XTP_ACTIVEX /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPGridHyperlinkStyle); # define DECLARE_PROPERTY_UN(theProperty, theType) \ afx_msg theType OleGet##theProperty(); \ afx_msg void OleSet##theProperty(theType); DECLARE_PROPERTY_UN(Color, COLORREF); DECLARE_PROPERTY_UN(TextDecoration, int); /** @endcond */ # endif private: COLORREF m_color; /**< Color. */ XTPGridTextDecoration m_textDecoration; /**< Text decoration. */ }; /** * @brief * This class represents hyperlinks. It stores the start position * and length of a hyperlink item's text as well as the rectangle used * for drawing the hyperlink and identifying clicks on the hyperlink. * To create an instance of this class, you simply call its constructor * with the start position and length of a hyperlink item's text. */ class _XTP_EXT_CLASS CXTPGridHyperlink : public CXTPHeapObjectT { /** @cond */ DECLARE_DYNAMIC(CXTPGridHyperlink) /** @endcond */ public: /** * @brief * Default CXTPGridHyperlink constructor. * @param nHyperTextBegin Start position of the hyperlink item text * in the parent item caption. * @param nHyperTextLen Length of the hyperlink item text. */ CXTPGridHyperlink(int nHyperTextBegin = 0, int nHyperTextLen = 0); /** * @brief * Destroys a CXTPGridHyperlink object, handles cleanup and deallocation. */ virtual ~CXTPGridHyperlink(); /** * @brief * Call this member function to store/load a grid hyperlink * using the specified data object. * @param pPX Source/destination CXTPPropExchange data object reference. */ virtual void DoPropExchange(CXTPPropExchange* pPX); public: CRect m_rcHyperSpot; /**< Hyperlink draw place. */ int m_nHyperTextBegin; /**< Start position of the hyperlink item text in the parent item caption. */ int m_nHyperTextLen; /**< The length of the hyperlink item text. */ protected: # ifdef _XTP_ACTIVEX /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPGridHyperlink); /** @endcond */ # endif }; /** * @brief * This typedef is used to declare a base class for CXTPGridHyperlinks. */ typedef CXTPArrayT CXTPGridHyperlinks_base; /** * @brief * This class represents an array of pointers to CXTPGridHyperlink objects. * InternalRelease is called for each item in the array destructor. * Serialization for array items is provided (see the DoPropExchange method). */ class _XTP_EXT_CLASS CXTPGridHyperlinks : public CXTPHeapObjectT { /** @cond */ DECLARE_DYNAMIC(CXTPGridHyperlinks) typedef CXTPArrayT TBase; /** @endcond */ public: /** * @brief * Default CXTPGridHyperlink constructor. */ CXTPGridHyperlinks(); /** * @brief * Destroys a CXTPGridHyperlinks object, handles cleanup and deallocation. */ virtual ~CXTPGridHyperlinks(); /** * @brief * Call this member function to store/load a grid hyperlinks collection * using the specified data object. * @param pPX Source/destination CXTPPropExchange data object reference. */ virtual void DoPropExchange(CXTPPropExchange* pPX); /** * @brief * Removes the hyperlink at a specified index from the collection. * @param nIndex Zero-based index of the hyperlink to remove. * @see * CXTPGridHyperlink, CXTPArrayT */ virtual void RemoveAt(int nIndex); /** * @brief * Removes the hyperlink at a specified index from the collection. * @param nIndex Zero-based index of the hyperlink to remove. * @param nCount The number of elements to remove. * @see * CXTPGridHyperlink, CXTPArrayT */ virtual void RemoveAt(int nIndex, int nCount); /** * @brief * Removes all hyperlinks from the collection. * @see * RemoveAt, CXTPGridHyperlink, CXTPArrayT */ virtual void RemoveAll(); /** * @brief * Copies all members from a specified CXTPGridHyperlinks object * to this CXTPGridHyperlinks object. * @param pSrc Pointer to a CXTPGridHyperlinks object to copy from. */ virtual void CopyFrom(CXTPGridHyperlinks* pSrc); protected: # ifdef _XTP_ACTIVEX /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPGridHyperlinks); DECLARE_ENUM_VARIANT(CXTPGridHyperlinks) virtual LPDISPATCH OleGetItem(long nIndex); afx_msg LPDISPATCH OleAddHyperlink(long nHyperTextBegin, long nHyperTextLen); /** @endcond */ # endif }; ///////////////////////////////////////////////////////////////////////////// # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPGRIDRECORDHYPERLINK_H__) /** @endcond */