/** * @file XTPMarkupDecorator.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(__XTPMARKUPDECORATOR_H__) # define __XTPMARKUPDECORATOR_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPMarkupUIElement; class CXTPMarkupBuilder; class CXTPMarkupObject; class CXTPMarkupVisual; /** * @brief * CXTPMarkupDecorator is a CXTPMarkupFrameworkElement derived class. * It implements a basic framework element with a single child. */ class _XTP_EXT_CLASS CXTPMarkupDecorator : public CXTPMarkupFrameworkElement { protected: /** * @brief * Constructs a CXTPMarkupDecorator object. */ CXTPMarkupDecorator(); /** * @brief * Destroys a CXTPMarkupDecorator object, handles cleanup and deallocation. */ virtual ~CXTPMarkupDecorator(); public: /** * @brief * Sets a new child object for the decorator element. * @param pChild New child CXTPMarkupUIElement object. * @see * GetChild */ void SetChild(CXTPMarkupUIElement* pChild); /** * @brief * Retrieves the child object of the decorator element. * @return * The child CXTPMarkupUIElement object. * @see * SetChild */ CXTPMarkupUIElement* GetChild() const; protected: /** @cond */ // Implementation virtual void SetContentObject(CXTPMarkupBuilder* pBuilder, CXTPMarkupObject* pContent); virtual BOOL HasContentObject() const; public: virtual int GetVisualChildrenCount() const; virtual CXTPMarkupVisual* GetVisualChild(int nIndex) const; protected: CXTPMarkupUIElement* m_pChild; /** @endcond */ }; /** @cond */ AFX_INLINE int CXTPMarkupDecorator::GetVisualChildrenCount() const { return m_pChild != NULL ? 1 : 0; } AFX_INLINE CXTPMarkupVisual* CXTPMarkupDecorator::GetVisualChild(int nIndex) const { return nIndex == 0 ? m_pChild : NULL; } /** @endcond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPMARKUPDECORATOR_H__) /** @endcond */