/** * @file XTPChartLegendItem.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(__XTPCHARTLEGENDITEM_H__) # define __XTPCHARTLEGENDITEM_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** * @brief * CXTPChartLegendItemView is an abstract base class which represents a chart * legend item. This class can also act as a multiple inheritance base class. */ class _XTP_EXT_CLASS CXTPChartLegendItemView { public: /** * Handles object destruction */ virtual ~CXTPChartLegendItemView() { } /** * @brief * This function returns the legend name. It is a pure virtual * function so it should be implemented in the derived classes. * * @return * Returns the legend name represented by the CXTPChartString class. */ virtual CXTPChartString GetLegendName() const = 0; /** * @brief * This function creates a CXTPChartDeviceCommand object, this object * represents the rendering of a legend item in the chart. * @param pDC Pointer to a valid device context. * @param rcBounds The bounding rectange. * @return * Returns a CXTPChartDeviceCommand object. This object handles * the rendering of an element in the chart. Here it handles * the drawing of the legend item. */ virtual CXTPChartDeviceCommand* CreateLegendDeviceCommand(CXTPChartDeviceContext* pDC, CRect rcBounds) = 0; }; class _XTP_EXT_CLASS CXTPChartLegendItem : public CXTPChartElement { private: enum { UseDefaultLineThickness = -1, }; public: CXTPChartLegendItem(); void SetLineThickness(int nLineThickness); int GetActualLineThickness() const; /** * @brief * Call this function to set dash line style. * * @param nDashStyle An enumerated value specifying the line style of choice. */ void SetDashStyle(XTPChartDashStyle nDashStyle); /** * @brief * Call this function to get the dash line style. * * @return * An enumerated value specifying the line style. */ XTPChartDashStyle GetDashStyle() const; protected: int m_nLineThickness; XTPChartDashStyle m_nDashStyle; /**< The dash style.*/ # ifdef _XTP_ACTIVEX public: /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPChartLegendItem); /** @endcond */ # endif friend class CXTPChartSeries; }; /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHARTLEGENDITEM_H__) /** @endcond */