/** * @file XTPMarkupContentControl.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(__XTPMARKUPCONTENTCONTROL_H__) # define __XTPMARKUPCONTENTCONTROL_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPMarkupDependencyProperty; class CXTPMarkupUIElement; class CXTPMarkupVisual; class CXTPMarkupBuilder; class CXTPMarkupObject; /** * @brief * CXTPMarkupContentControl is a CXTPMarkupControl derived class. It * implements a base class for all control elements with a single child. */ class _XTP_EXT_CLASS CXTPMarkupContentControl : public CXTPMarkupControl { /** @cond */ DECLARE_MARKUPCLASS(CXTPMarkupContentControl); /** @endcond */ protected: /** * @brief * Constructs a CXTPMarkupContentControl object. */ CXTPMarkupContentControl(); /** * @brief * Destroys a CXTPMarkupContentControl object, handles cleanup and deallocation. */ virtual ~CXTPMarkupContentControl(); public: /** * @brief * Gets the child object of the ControlContent element. * @return * The child CXTPMarkupUIElement object. * @see * SetContent */ CXTPMarkupUIElement* GetContent() const; /** * @brief * Sets the child object for the ControlContent element. * @param pContent New child CXTPMarkupUIElement object. * @see * GetContent */ void SetContent(CXTPMarkupUIElement* pContent); 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: static CXTPMarkupDependencyProperty* m_pContentProperty; /** @endcond */ /** @cond */ public: DECLARE_DISPATCH_MAP() # ifdef _XTP_ACTIVEX DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPMarkupContentControl); # endif afx_msg LPDISPATCH OleGetContent(); afx_msg void OleSetContent(LPDISPATCH lpContent); /** @endcond */ }; /** @cond */ AFX_INLINE int CXTPMarkupContentControl::GetVisualChildrenCount() const { return GetContent() != NULL ? 1 : 0; } AFX_INLINE CXTPMarkupVisual* CXTPMarkupContentControl::GetVisualChild(int nIndex) const { return nIndex == 0 ? GetContent() : NULL; } /** @endcond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPMARKUPCONTENTCONTROL_H__) /** @endcond */