/** * @file XTPChartPalette.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(__XTPCHARTPALETTE_H__) # define __XTPCHARTPALETTE_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** * @brief * This class represents a palette entry, which abstracts two 32 bit color * values of type ARGB. */ class _XTP_EXT_CLASS CXTPChartPaletteEntry { public: CXTPChartColor Color; CXTPChartColor Color2; }; /** * @brief * This type represents a collection of CXTPChartPaletteEntry objects, the * container here used is CArray. */ typedef CArray CXTPChartPaletteEntries; /** * @brief * This class abstracts a color palette. */ class _XTP_EXT_CLASS CXTPChartPalette : public CXTPChartElement { public: /** * @brief * Constructs a CXTPChartPalette object. * * @param pOwner The owner element of the palette object. */ CXTPChartPalette(CXTPChartElement* pOwner); /** * @brief * Destroys a CXTPChartPalette object, handles cleanup. */ virtual ~CXTPChartPalette(); public: /** * @brief * Call this function to get the first color at a particular index in * the palette. * * @param nIndex The zero-based index of the required palette entry. * @return Returns color */ CXTPChartColor GetColor(int nIndex) const; /** * @brief * Call this function to get the second color at a particular index in * the palette. * * @param nIndex The zero-based index of the required palette entry. * @return Returns second color */ CXTPChartColor GetColor2(int nIndex) const; /** * @brief * Call this function to get number of entris in the palette. * * @return An integer value specifying the number of entries in the palette. */ int GetCount() const; /** * @brief * Call this function to get the palette entries. * * @return A reference to the palette entry collection member. */ CXTPChartPaletteEntries& GetEntries(); public: /** * @brief * Call this member function to Store/Load the properties of palette object * using the specified data object. * * @param pPX Source or destination CXTPPropExchange data object reference. * * @details * This member function is used to store or load property data to or * from a storage. */ void DoPropExchange(CXTPPropExchange* pPX); # ifdef _XTP_ACTIVEX public: /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPChartPalette); afx_msg OLE_COLOR OleGetColor(int nIndex); afx_msg OLE_COLOR OleGetColor2(int nIndex); afx_msg void OleSetColor(int nIndex, OLE_COLOR clr); afx_msg void OleSetColor2(int nIndex, OLE_COLOR clr); afx_msg void OleDeleteAll(); afx_msg void OleAddEntry(OLE_COLOR clr, OLE_COLOR clr2); afx_msg int OleGetCount(); /** @endcond */ # endif protected: CXTPChartPaletteEntries m_arrEntries; /**< The palette entry collection object.*/ }; AFX_INLINE int CXTPChartPalette::GetCount() const { return (int)m_arrEntries.GetSize(); } AFX_INLINE CXTPChartPaletteEntries& CXTPChartPalette::GetEntries() { return m_arrEntries; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHARTPALETTE_H__) /** @endcond */