/** * @file XTPMarkupPage.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(__XTPMARKUPPAGE_H__) # define __XTPMARKUPPAGE_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPMarkupUIElement; class CXTPMarkupVisual; class CXTPMarkupDrawingContext; class CXTPMarkupBuilder; class CXTPMarkupObject; class CXTPMarkupInputElement; class CXTPMarkupUIElement; /** * @brief * CXTPMarkupPage is a CXTPMarkupFrameworkElement derived class. * It implements the Page XAML Tag. */ class _XTP_EXT_CLASS CXTPMarkupPage : public CXTPMarkupFrameworkElement { /** @cond */ DECLARE_MARKUPCLASS(CXTPMarkupPage); /** @endcond */ protected: /** * @brief * Constructs a CXTPMarkupPage object. */ CXTPMarkupPage(); /** * @brief * Destroys a CXTPMarkupPage object, handles cleanup and deallocation. */ virtual ~CXTPMarkupPage(); public: /** * @brief * Sets the child object for the page element. * @param pContent Pointer to a CXTPMarkupUIElement object. * @see * GetContent */ void SetContent(CXTPMarkupUIElement* pContent); /** * @brief * Retrieves the child object for the page element. * @return * A pointer to a CXTPMarkupUIElement object. * @see * SetContent */ CXTPMarkupUIElement* GetContent() const; public: /** @cond */ // Implementation virtual int GetVisualChildrenCount() const; virtual CXTPMarkupVisual* GetVisualChild(int nIndex) const; protected: virtual CSize MeasureOverride(CXTPMarkupDrawingContext* pDC, CSize szAvailableSize); virtual CSize ArrangeOverride(CSize szFinalSize); virtual void SetContentObject(CXTPMarkupBuilder* pBuilder, CXTPMarkupObject* pContent); virtual BOOL HasContentObject() const; CXTPMarkupInputElement* InputHitTestOverride(CPoint /*point*/) const; protected: CXTPMarkupUIElement* m_pContent; /** @endcond */ /** @cond */ public: DECLARE_DISPATCH_MAP() # ifdef _XTP_ACTIVEX DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPMarkupPage); # endif afx_msg LPDISPATCH OleGetChild(); afx_msg void OleSetChild(LPDISPATCH lpDisp); /** @endcond */ }; class _XTP_EXT_CLASS CXTPMarkupWindowContainer : public CXTPMarkupFrameworkElement { DECLARE_MARKUPCLASS(CXTPMarkupWindowContainer); protected: /** * @brief * Constructs a CXTPMarkupWindowContainer object. */ CXTPMarkupWindowContainer(); /** * @brief * Destroys a CXTPMarkupWindowContainer object, handles cleanup and deallocation. */ virtual ~CXTPMarkupWindowContainer(); public: /** * @brief * Sets the child window for the page element. * @param hwndContent Child window to be set. * @see * SetContent */ void SetChild(HWND hwndContent); /** * @brief * Gets the child window of the page element. * @return * The child window of the page element. * @see * SetContent */ HWND GetChild() const; public: /** @cond */ // Implementation protected: virtual CSize MeasureOverride(CXTPMarkupDrawingContext* pDC, CSize szAvailableSize); virtual CSize ArrangeOverride(CSize szFinalSize); void OnRender(CXTPMarkupDrawingContext* pDC); void RenderClipped(CXTPMarkupDrawingContext* pDC); protected: HWND m_hWndChild; CSize m_szChild; /** @endcond */ /** @cond */ public: DECLARE_DISPATCH_MAP() # ifdef _XTP_ACTIVEX DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPMarkupWindowContainer); # endif afx_msg HWND OleGetChild(); afx_msg void OleSetChild(HWND hWnd); /** @endcond */ }; /** @cond */ AFX_INLINE int CXTPMarkupPage::GetVisualChildrenCount() const { return m_pContent != NULL ? 1 : 0; } AFX_INLINE CXTPMarkupVisual* CXTPMarkupPage::GetVisualChild(int nIndex) const { return nIndex == 0 ? m_pContent : NULL; } /** @endcond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPMARKUPPAGE_H__) /** @endcond */