/** * @file XTPMarkupRun.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(__XTPMARKUPRUN_H__) # define __XTPMARKUPRUN_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPMarkupDependencyProperty; class CXTPMarkupFont; class CXTPMarkupDrawingContext; class CXTPMarkupBuilder; class CXTPMarkupObject; class CXTPMarkupString; struct XTPMarkupFontMetrics; class _XTP_EXT_CLASS CXTPMarkupRun : public CXTPMarkupInline { /** @cond */ DECLARE_MARKUPCLASS(CXTPMarkupRun) /** @endcond */ protected: CXTPMarkupRun(); virtual ~CXTPMarkupRun(); protected: virtual void OnFinalRelease(); public: CString GetText() const; LPCWSTR GetTextW() const; void SetText(LPCWSTR lpszText); void SetText(CXTPMarkupString* pText); public: virtual POSITION GetContentStartPosition() const; virtual void GetContentNextPosition(POSITION& pos) const; virtual BOOL IsWordBreakPosition(POSITION pos) const; virtual BOOL IsLineBreakPosition(POSITION pos) const; virtual BOOL IsCaretReturnPosition(POSITION pos) const; virtual BOOL IsWhiteSpacePosition(POSITION pos) const; virtual CSize Measure(CXTPMarkupDrawingContext* pDC, POSITION posStart, POSITION posEnd); virtual void Measure(CXTPMarkupDrawingContext* pDC, POSITION posStart, POSITION posEnd, CXTPSizeF& size); virtual void Render(CXTPMarkupDrawingContext* pDC, CRect rc, POSITION posStart, POSITION posEnd); protected: virtual void GetLogFont(LOGFONT* lf) const; protected: virtual void SetContentObject(CXTPMarkupBuilder* pBuilder, CXTPMarkupObject* pContent); virtual BOOL HasContentObject() const; virtual void PrepareMeasure(CXTPMarkupDrawingContext* pDC); /** @cond */ public: DECLARE_DISPATCH_MAP() # ifdef _XTP_ACTIVEX DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPMarkupRun); # endif afx_msg VARIANT OleGetText(); afx_msg void OleSetText(const VARIANT& lpCaption); /** @endcond */ protected: int m_nBaseline; virtual int GetBaseline() const; virtual const XTPMarkupFontMetrics* GetFontMetrics() const; CXTPMarkupFont* m_pFont; private: XTPMarkupFontMetrics* m_pFontMetrics; public: static CXTPMarkupDependencyProperty* m_pTextProperty; }; # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPMARKUPRUN_H__) /** @endcond */