/** * @file XTPChartPieSeriesLabelBase.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(__XTPCHARTPIESERIESLABELBASE_H__) # define __XTPCHARTPIESERIESLABELBASE_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPChartSeriesView; class CXTPChartPieSeriesPointViewBase; class CXTPChartPieSeriesStyleBase; class CXTPChartPieSeriesLabelViewBase; /** * @brief * This enumeration tells the various positions available for the pie label. */ enum XTPChartPieLabelPosition { xtpChartPieLabelOutside, /**< Outside the pie.*/ xtpChartPieLabelInside, /**< Inside the pie.*/ xtpChartPieLabelRadial, /**< Radial label.*/ xtpChartPieLabelTwoColumns /**< 2 Columns*/ }; /** * @brief * CXTPChartPieSeriesLabelBase is a kind of CXTPChartSeriesLabel. This class * abstracts the label of a pie series. */ class _XTP_EXT_CLASS CXTPChartPieSeriesLabelBase : public CXTPChartSeriesLabel { DECLARE_DYNAMIC(CXTPChartPieSeriesLabelBase); public: /** * @brief * Constructs a CXTPChartPieSeriesLabelBase object. */ CXTPChartPieSeriesLabelBase(); /** * @brief * Destroys a CXTPChartPieSeriesLabelBase object, handles cleanup. */ virtual ~CXTPChartPieSeriesLabelBase(); public: /** * @brief * Call this function to get the label position. * * @return * A pie label position object describing the position of the pie label. */ XTPChartPieLabelPosition GetPosition() const; /** * @brief * Call this function to set the label position. * * @param nPosition A pie label position object describing the position of * the pie label. */ void SetPosition(XTPChartPieLabelPosition nPosition); /** * @brief * Call this function to get the basic style of the pie series. * * @return * A pointer to a CXTPChartPieSeriesStyleBase object. */ CXTPChartPieSeriesStyleBase* GetStyle() const; public: void DoPropExchange(CXTPPropExchange* pPX); protected: /** * @brief * This function creates the view of the pie series. * * @param pDC The chart device context object pointer. * @param pPointView The series point view. * @param pParentView Parent view pointer. * * @return * Returns a pointer to the associated label view object. */ virtual CXTPChartElementView* CreateView(CXTPChartDeviceContext* pDC, CXTPChartSeriesPointView* pPointView, CXTPChartElementView* pParentView) = 0; public: /** * @brief * Call this function to check whether the label is inside the pie. * * @return * Returns TRUE if the label is inside the pie, FALSE otherwise. */ BOOL IsInside() const; protected: XTPChartPieLabelPosition m_nPosition; /**< The pie label position.*/ # ifdef _XTP_ACTIVEX public: /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPChartPieSeriesLabelBase); /** @endcond */ # endif }; AFX_INLINE XTPChartPieLabelPosition CXTPChartPieSeriesLabelBase::GetPosition() const { return m_nPosition; } AFX_INLINE void CXTPChartPieSeriesLabelBase::SetPosition(XTPChartPieLabelPosition nPosition) { m_nPosition = nPosition; OnChartChanged(); } /** * @brief * Defines a base class interface for series label view. */ class CXTPChartPieSeriesLabelViewBase : public CXTPChartSeriesLabelView { DECLARE_DYNAMIC(CXTPChartPieSeriesLabelViewBase); protected: /** * @brief * Constructs a CXTPChartPieSeriesLabelViewBase object. * * @param pLabel Associated label model pointer. * @param pPointView Point view object pointer associated with the label. * @param pParentView Parent view pointer. */ CXTPChartPieSeriesLabelViewBase(CXTPChartSeriesLabel* pLabel, CXTPChartSeriesPointView* pPointView, CXTPChartElementView* pParentView); public: /** * @brief * Obtains label position. * * @return * Label position. */ XTPChartPieLabelPosition GetPosition() const; /** * @brief * Creates view drawing device command for the device context specified. * * @param pDC Device context pointer for which the drawing command is to be created. * * @return * A new instance of view drawing device command or NULL if no command * is provided. */ virtual CXTPChartDeviceCommand* CreateDeviceCommand(CXTPChartDeviceContext* pDC) = 0; /** * @brief * Creates connector drawing device command for the device context specified. * * @param pDC Device context pointer for which the drawing command is to be created. * * @return * A new instance of connector drawing device command or NULL if no command * is provided. */ virtual CXTPChartDeviceCommand* CreateConnectorDeviceCommand(CXTPChartDeviceContext* pDC) = 0; }; /** * @brief * Defines a base class interface for series label collection view. */ class _XTP_EXT_CLASS CXTPChartPieSeriesLabelsViewBase : public CXTPChartElementView { DECLARE_DYNAMIC(CXTPChartPieSeriesLabelsViewBase); protected: /** * @brief * Constructs a CXTPChartPieSeriesLabelsViewBase object. * * @param pParentView Parent view pointer. */ CXTPChartPieSeriesLabelsViewBase(CXTPChartElementView* pParentView); public: /** * @brief * Creates view drawing device command for the device context specified. * * @param pDC Device context pointer for which the drawing command is to be created. * * @return * A new instance of view drawing device command or NULL if no command * is provided. */ virtual CXTPChartDeviceCommand* CreateDeviceCommand(CXTPChartDeviceContext* pDC) = 0; /** * @brief * Resolves label overlapping in an implementation specific way. */ virtual void ResolveOverlapping() = 0; }; /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHARTPIESERIESLABELBASE_H__) /** @endcond */