/** * @file XTPMarkupViewbox.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(__XTPMARKUPVIEWBOX_H__) # define __XTPMARKUPVIEWBOX_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPMarkupBrush; class CXTPMarkupBuilder; /** * @brief * CXTPMarkupViewbox is a CXTPMarkupDecorator derived class. * It implements the Border XAML Tag. */ class _XTP_EXT_CLASS CXTPMarkupViewbox : public CXTPMarkupDecorator { /** @cond */ DECLARE_MARKUPCLASS(CXTPMarkupViewbox); /** @endcond */ protected: /** * @brief * Constructs a CXTPMarkupViewbox object. */ CXTPMarkupViewbox(); /** * @brief * Destroys a CXTPMarkupViewbox object, handles cleanup and deallocation. */ virtual ~CXTPMarkupViewbox(); public: /** * @brief * Sets the stretch type of the image. * @param stretch New stretch type. */ void SetStretch(XTPMarkupStretch stretch); /** * @brief * Gets the current stretch type of the image. * @return * The current stretch type. */ XTPMarkupStretch GetStretch() const; protected: /** @cond */ // Implementation virtual CSize MeasureOverride(CXTPMarkupDrawingContext* pDC, CSize szAvailableSize); virtual CSize ArrangeOverride(CSize szFinalSize); /** * @brief Applies render transformation if necessary. * @return A structure that optionally describes the previous and the new * transformation matrices. */ virtual TransformationMatrices ApplyRenderTransform(CXTPMarkupDrawingContext* pContext); CXTPMarkupTransformationMatrix* ApplyTransform(const CXTPMarkupTransformationMatrix* pMatrix); BOOL HasElementSize(); CSize GetElementSize(); BOOL ChildHasElementSize(); CSize ChildGetElementSize(); protected: float m_scaleX; float m_scaleY; float m_centerX; float m_centerY; public: static CXTPMarkupDependencyProperty* m_pStretchProperty; /** @endcond */ /** @cond */ public: DECLARE_DISPATCH_MAP() # ifdef _XTP_ACTIVEX DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPMarkupViewbox); # endif afx_msg long OleGetStretch(); afx_msg void OleSetStretch(long stretch); afx_msg LPDISPATCH OleGetChild(); afx_msg void OleSetChild(LPDISPATCH lpDisp); /** @endcond */ }; # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPMARKUPVIEWBOX_H__) /** @endcond */