/** * @file XTPMarkupContext.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(__XTPMARKUPCONTEXT_H__) # define __XTPMARKUPCONTEXT_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableAdvancedWarnings.h" # include # include # include "Common/Base/Diagnostic/XTPEnableAdvancedWarnings.h" # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPDpi; class CXTPMarkupObject; class CXTPImageManager; class CXTPMarkupUIElement; class CXTPMarkupInputElement; class CXTPMarkupContext; class CXTPMarkupEventHandlerMap; class CXTPMarkupRoutedEventArgs; class CXTPMarkupRoutedEvent; class CXTPMarkupDelegate; class CXTPMarkupFont; class CXTPMarkupType; class CXTPMarkupKeyboardNavigation; class CXTPToolTipContext; class CXTPMarkupParser; class CXTPMarkupBuilder; class CXTPActiveScriptEngine; class CXTPActiveScriptStdRuntime; class CXTPMarkupDelegateMap; class CXTPMarkupStaticExtension; template class CXTPMarkupTypedSimpleStack; class CXTPMarkupDeviceDependentImage; class CXTPMarkupDeviceContext; struct IXTPMarkupDeviceDependentImageSite; /** * @brief * Defines markup smoothing mode. */ enum XTPMarkupSmoothingMode { xtpMarkupSmoothingDefault, /**< Default implementation defined smoothing */ xtpMarkupSmoothingNone, /**< Smoothing is disabled for best performance */ xtpMarkupSmoothingHighSpeed, /**< Smoothing is enabled but with trade-offs for better performance */ xtpMarkupSmoothingHighQuality, /**< High quality smoothing is enabled */ xtpMarkupSmoothingAntiAlias, /**< Anti-aliasing smoothing is enabled */ }; /** * @brief * Defines default implementation of the markup client site interface. * @see * CXTPMarkupContext */ struct IXTPMarkupClientSite { /** * @brief * Handles object destruction. */ virtual ~IXTPMarkupClientSite() { } /** * @brief * Gets called by the markup context before executing script code chunk. * Can be used for code enchancing depending on the provided list of requirements. * @param pCode Code chunk text. * @param requirements The list of requirements as specified in the xtp:Script element. * @return * If the provided code chunk has to be modified then the method must return a newly * allocated buffer using new/malloc with the modified code text. If no code modifications * are required then the return value can be either the value of pCode or NULL. */ virtual LPWSTR PrepareCodeChunk(LPCWSTR pCode, const CList& requirements) { XTP_UNUSED_PARAMETER(pCode); XTP_UNUSED_PARAMETER(requirements); return NULL; } }; # ifdef _XTP_ACTIVEX class _XTP_EXT_CLASS CXTPMarkupContext : public CXTPCmdTarget # else /** @cond */ class CXTPMarkupContextInternalDispatch; /** @endcond */ /** * @brief * CXTPMarkupContext is a standalone class used to provide common * settings for Markup objects. */ class _XTP_EXT_CLASS CXTPMarkupContext # endif { protected: class CInputElementCollection; public: /** * @brief * Constructs a CXTPMarkupContext object. */ CXTPMarkupContext(); protected: /** * @brief * Destroys a CXTPMarkupContext object, handles cleanup and deallocation. */ virtual ~CXTPMarkupContext(); public: /** * @brief * Gets a client site pointer. * @return * The current client site interface poitner. The context object is not responsible for the * client site pointer deallocation. */ IXTPMarkupClientSite* GetClientSite() const; /** * @brief * Sets a client site pointer. * @param pSite A new client site interface pointer or NULL. */ void SetClientSite(IXTPMarkupClientSite* pSite); /** * @brief * Performs internal cleanup necessary for the final release. * @details * The context can be reused after shutdown, but all previous data * and states will be lost. */ void Shutdown(); /** * @brief * Gets the default font properties of markup objects. * @return * The default font properties of markup objects. */ LOGFONT* GetDefaultLogFont(); /** * @brief * Gets the default text color of TextBlock objects. * @return * The default text color of TextBlock objects. */ COLORREF GetDefaultForeground(); /** * @brief * Sets the default text color for TextBlock objects. * @param clr New default text color to set. */ void SetDefaultTextColor(COLORREF clr); /** * @brief * Sets the default font for TextBlock objects. * @param font New default font to set. */ void SetDefaultFont(HFONT font); /** * @brief * Sets the default font for TextBlock objects. * @param font New default font to set. */ void SetDefaultFont(LOGFONT* font); /** * @brief * Gets the default smoothing mode to be used for any drawing * context that uses the context. By default, smoothing mode is * applied to all graphical elements except text. To enable text * smoothing, refer to SetDefaultTextSmoothing. * @return * Current/previous smoothing mode; returns one of the values defined * by the XTPMarkupSmoothingMode enumeration. * @see * GetDefaultTextSmoothing, SetDefaultTextSmoothing */ XTPMarkupSmoothingMode GetDefaultSmoothingMode() const; /** * @brief * Sets the default smoothing mode to be used for any drawing * context that uses the context. By default, smoothing mode is * applied to all graphical elements except text. To enable text * smoothing, refer to SetDefaultTextSmoothing. * @param smoothingMode New smoothing mode to set; must be one of the values * defined by the XTPMarkupSmoothingMode enumeration. * @return * Current/previous smoothing mode; returns one of the values defined * by the XTPMarkupSmoothingMode enumeration. * @see * GetDefaultTextSmoothing, SetDefaultTextSmoothing */ XTPMarkupSmoothingMode SetDefaultSmoothingMode(XTPMarkupSmoothingMode smoothingMode); /** * @brief * Determines/specifies if text smoothing is enabled for any drawing * context that uses the context. By default, smoothing mode is * applied to all graphical elements except text. * @return * Current/previous text smoothing setting. TRUE if text smoothing * is/was enabled, FALSE if text smoothing is/was disabled. * @see * GetDefaultSmoothingMode, SetDefaultSmoothingMode */ BOOL GetDefaultTextSmoothing() const; /** * @brief * Determines/specifies if text smoothing is enabled for any drawing * context that uses the context. By default, smoothing mode is * applied to all graphical elements except text. * @param bEnableTextSmoothing TRUE to enable text smoothing according to * the overall smoothing mode. * @return * Current/previous text smoothing setting. TRUE if text smoothing * is/was enabled, FALSE if text smoothing is/was disabled. * @see * GetDefaultSmoothingMode, SetDefaultSmoothingMode */ BOOL SetDefaultTextSmoothing(BOOL bEnableTextSmoothing); /** * @brief * Creates a Markup tree from its XML string. * @param lpszBuffer XML Markup string. * @return * The top level Markup element. */ CXTPMarkupUIElement* Parse(LPCSTR lpszBuffer); /** * @brief * Creates a Markup tree from its XML string. * @param lpszBuffer XML Markup string. * @return * The top level Markup element. */ CXTPMarkupUIElement* Parse(LPCWSTR lpszBuffer); /** * @brief * Validates XML correctness. * @param lpszBuffer XML data to parse and validate. * @return * A validation status message. */ CString ValidateXML(LPCSTR lpszBuffer); /** * @brief * Validates XML correctness. * @param lpszBuffer XML data to parse and validate. * @return * A validation status message. */ CString ValidateXML(LPCWSTR lpszBuffer); /** * @brief * Connects a Markup event with a class member or static method delegate. * @param pEvent Markup event. * @param pDelegate Class member or static method delegate. * * Example: *
	 * m_wndStatic.AddHandler(CXTPMarkupHyperlink::m_pClickEvent,
	 * CreateMarkupClassDelegate(this, &CMarkupSampleDlg::OnHyperlinkClick));
	 * 
*/ void AddHandler(CXTPMarkupRoutedEvent* pEvent, CXTPMarkupDelegate* pDelegate); /** * @brief * Sets a delegate for a Markup text event. * @param lpszDelegate Text event delegate. * @param pDelegate Method delegate. * * Example: *
\FTSE 100\\
	 * ....
	 * pPopup->GetMarkupContext()->SetDelegate(L"OnClick",
	 * CreateMarkupFunctionDelegate(&HyperlinkClick));
*/ void SetDelegate(LPCWSTR lpszDelegate, CXTPMarkupDelegate* pDelegate); /** * @brief * Enables/disables GDI+ usage. * @param bEnable TRUE to enable GDI+ usage, FALSE to disable. */ void EnableGdiPlus(BOOL bEnable); /** * @brief * Determines if GDI+ is enabled/disabled. * @return * TRUE if GDI+ usage is enabled, * FALSE if GDI+ usage is disabled. */ BOOL IsGdiPlusEnabled() const; /** * @brief * Call this method to get a pointer to the tooltip context. * @return * A pointer to the tooltip context. */ CXTPToolTipContext* GetToolTipContext() const; /** * @brief * Determines if custom positioning for tooltips is enabled/disabled. * @return * TRUE if custom positioning for tooltips is enabled, * FALSE if custom positioning for tooltips is disabled. * @see * SetUseCustomToolTipPosition, GetCustomToolTipPosition */ BOOL GetUseCustomToolTipPosition() const; /** * @brief * Enables/disables custom positioning for tooltips. * @param bUse TRUE to enable custom positioning for tooltips, FALSE to disable. * @param ptPos CPoint that specifies the x- and y- coordinates of the tooltip * window. These coordinates are always relative to the upper-left * corner of the window. * @details * This feature can be used before calling CXTPToolTipContext::FilterToolTipMessage * to place a tooltip window in a desirable location. * @see * GetUseCustomToolTipPosition, GetCustomToolTipPosition */ void SetUseCustomToolTipPosition(BOOL bUse, CPoint ptPos = CPoint(0, 0)); /** * @brief * Gets the custom x- and y- coordinates of the tooltip window. These * coordinates are always relative to the upper-left corner of the window. * @return * A CPoint object containing the custom x- and y- coordinates of the tooltip window. * @see * GetUseCustomToolTipPosition, SetUseCustomToolTipPosition */ CPoint GetCustomToolTipPosition() const; /** * @brief * Sets the isolated image manager for elements inside the Markup context. * @param pImageManager New image manager to use. * * Example: *
m_pMarkupContext->SetImageManager(new CXTPImageManager());
*/ void SetImageManager(CXTPImageManager* pImageManager); /** * @brief * Gets the isolated image manager for elements inside the Markup context. * @return * The isolated image manager for elements inside the Markup context. * @details * Function returns XTPImageManager(); by default, call SetImageManager to * set isolated images. */ CXTPImageManager* GetImageManager() const; /** * @brief * Sets the context specific color key for an image element. * @param crColorKey New color key value, or COLORREF_NULL. * @details * If the context specific color key is set to COLORREF_NULL, then * the color mask of the assigned image manager will be used in * place of the context specific color key. If the color mask of the * assigned image manager is also COLORREF_NULL, then a default * value of RGB(0, 0xff, 0) will be used instead. */ void SetImageColorKey(COLORREF crColorKey); /** * @brief * Gets the context specific color key for an image element. * @return * If the context specific color key is not COLORREF_NULL, then the * context specific color key will be returned. If the context specific * color key is COLORREF_NULL, then the color mask of the assigned * image manager will be returned. If the color mask of the assigned * image manager is also COLORREF_NULL, then a default value of * RGB(0, 0xff, 0) will be returned instead. */ COLORREF GetImageColorKey() const; /** * @brief * Gets a pointer to the extension root object used to add custom * Markup extensions. * @return * A pointer to the extension root object. */ CXTPMarkupStaticExtension* GetExtensionRoot(); /** * @brief * Determines if context DPI awareness is enabled * (i.e. graphics are scaled according to active DPI settings). * @return * TRUE if context DPI awareness is enabled. */ BOOL IsDpiAware() const; /** * @brief * Enables/disables context DPI awareness. * @param bSet TRUE to enable DPI awareness * (i.e. make graphics scale according to active DPI settings). */ void SetDpiAware(BOOL bSet = TRUE); /** * @brief * Enables/disables context DPI awareness. * @param bSet TRUE to enable DPI awareness * (i.e. make graphics scale according to active DPI settings). * @param hWnd If specified, then the window's device context information * will be used for DPI translation. */ void SetDpiAware(BOOL bSet, HWND hWnd); /** * @brief * Enables/disables context DPI awareness. * @param bSet TRUE to enable DPI awareness * (i.e. make graphics scale according to active DPI settings). * @param hDC If specified, then the device context information will be * used for DPI translation. */ void SetDpiAware(BOOL bSet, HDC hDC); /** * @brief * Performs x- and y- coordinate scaling according to active DPI settings * if the Markup context is DPI aware. * @param x Coordinates to scale according to active DPI settings. * @return * If the Markup context is DPI aware, then a scaled value is returned. * If the Markup context is not DPI aware, then an unchanged value is returned. * @see * SetDpiAware */ int ScaleX(int x) const; /** * @brief * Performs x- and y- coordinate scaling according to active DPI settings * if the Markup context is DPI aware. * @param y Coordinates to scale according to active DPI settings. * @return * If the Markup context is DPI aware, then a scaled value is returned. * If the Markup context is not DPI aware, then an unchanged value is returned. * @see * SetDpiAware */ int ScaleY(int y) const; /** * @brief * Performs x- and y- coordinate scaling according to active DPI settings * if the Markup context is DPI aware. * @param x Coordinates to scale according to active DPI settings. * @return * If the Markup context is DPI aware, then a scaled value is returned. * If the Markup context is not DPI aware, then an unchanged value is returned. * @see * SetDpiAware */ float ScaleX(float x) const; /** * @brief * Performs x- and y- coordinate scaling according to active DPI settings * if the Markup context is DPI aware. * @param y Coordinates to scale according to active DPI settings. * @return * If the Markup context is DPI aware, then a scaled value is returned. * If the Markup context is not DPI aware, then an unchanged value is returned. * @see * SetDpiAware */ float ScaleY(float y) const; /** * @brief * Performs x- and y- coordinate scaling according to active DPI settings * if the Markup context is DPI aware. * @param x Coordinates to scale according to active DPI settings. * @return * If the Markup context is DPI aware, then a scaled value is returned. * If the Markup context is not DPI aware, then an unchanged value is returned. * @see * SetDpiAware */ double ScaleX(double x) const; /** * @brief * Performs x- and y- coordinate scaling according to active DPI settings * if the Markup context is DPI aware. * @param y Coordinates to scale according to active DPI settings. * @return * If the Markup context is DPI aware, then a scaled value is returned. * If the Markup context is not DPI aware, then an unchanged value is returned. * @see * SetDpiAware */ double ScaleY(double y) const; /** * @brief * Performs x- and y- coordinate scaling according to active DPI settings * if the Markup context is DPI aware. * @param size Represents the item size. * @return * If the Markup context is DPI aware, then a scaled value is returned. * If the Markup context is not DPI aware, then an unchanged value is returned. * @see * SetDpiAware */ CSize Scale(const SIZE& size) const; double UnscaleX(double x) const; double UnscaleY(double y) const; /** * @brief * Loads a chunk of script code in a specified language. * @param pBuilder Pointer to the Markup builder from which code is loaded. * @param lpszLanguage Script code language. * @param lpszCode Script code. * @param lpszRequires An optional comma separated list of requirements. */ void LoadScriptCodeChunk(CXTPMarkupBuilder* pBuilder, LPCWSTR lpszLanguage, LPCWSTR lpszCode, LPCWSTR lpszRequires = NULL); /** * @brief * Runs script engine. * @param pBuilder Pointer to the Markup builder that runs script engine. */ void RunScriptEngine(CXTPMarkupBuilder* pBuilder); /** * @brief * Obtains the associated ActiveScript engine object pointer if there is a scripting * context assigned to the markup context. * @return * A valid ActiveScript engine object pointer or NULL is no scripting context assigned to * the markup context. * @see * AddCustomScriptItem, RemoveCustomScriptItem */ CXTPActiveScriptEngine* GetScriptEngine(); /** * @brief * Adds a custom scripting named item to the associated scripting context. Once added, the * associated scripting item object can be accessed in the script code by its name as a * global object. * @param lpName Scripting item name pointer. * @param pDisp Scripting item object. The markup context will hold its reference until * removed. * @see * RemoveCustomScriptItem, GetScriptEngine */ void AddCustomScriptItem(LPCWSTR lpName, LPDISPATCH pDisp); /** * @brief * Removes a previously added named sciripting item from the context. * @param lpName Scripting item name pointer. * @see * AddCustomScriptItem, GetScriptEngine */ void RemoveCustomScriptItem(LPCWSTR lpName); /** * @brief * Gets a window handle associated with markup context. The specified window provides * a devices context to render markup on and receives related notifications. * @return * The associated window handler. */ HWND GetContextWindow() const; /** * @brief * Sets a window handle associated with markup context. The specified window provides * a devices context to render markup on and receives related notifications. * @param hWnd Window handle. * @param pUpdateRect An optional update rectangle pointer. */ void SetContextWindow(HWND hWnd, LPCRECT pUpdateRect = NULL); /** @cond */ // Internal methods void ResetScriptEngine(BOOL bFinal = FALSE); void RegisterScriptNamedObjects(CXTPMarkupBuilder* pBuilder, CXTPMarkupObject* pObject); void ThrowScriptEngineException(CXTPMarkupBuilder* pBuilder, HRESULT hr); CXTPMarkupFont* GetFont(LOGFONT* pLogFont); static BOOL AFX_CDECL CompareFont(LOGFONT* pLogFont1, LOGFONT* pLogFont2); virtual BOOL OnWndMsg(CXTPMarkupUIElement* pUIElement, UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult); void RaiseEvent(CXTPMarkupObject* pSource, CXTPMarkupRoutedEventArgs* pEventArgs); CXTPMarkupDelegate* LookupDelegate(LPCWSTR lpszDelegate) const; void CaptureMouse(CXTPMarkupInputElement* pUIElement); void ReleaseMouseCapture(CXTPMarkupInputElement* pUIElement); CXTPMarkupInputElement* GetMouseCapture() const; CXTPMarkupKeyboardNavigation* GetKeyboardNavigation() const; ULONG AddRef(); ULONG Release(); INT_PTR OnToolHitTest(CPoint point, TOOLINFO* pToolInfo); CXTPMarkupDeviceDependentImage* LoadImage(const CString& strSource, CSize size, CXTPMarkupDeviceContext* pDC, IXTPMarkupDeviceDependentImageSite* pSite); public: void FreeCachedImages(); public: CRect GetClientBoundingRect(CXTPMarkupInputElement* pUIElement) const; CRect GetUpdateRect(CXTPMarkupInputElement* pUIElement) const; BOOL IsVisualChild(CXTPMarkupObject* pParent, CXTPMarkupObject* pChild) const; private: void HandleMouseMove(CXTPMarkupUIElement* pUIElement, CPoint point); void HandleMouseEnter(CXTPMarkupInputElement* pUIElement, CPoint point); BOOL HandleSetCursor(); BOOL HandleMouseWheel(int nDelta); BOOL HandleMouseUpDown(UINT message, WPARAM wParam, LPARAM lParam); void BuildInputList(CXTPMarkupObject* pUIElement, CInputElementCollection* list); void Cleanup(); void Redraw(LPCRECT pRect = NULL, BOOL bPending = FALSE); public: virtual void OnInvalidateVisual(CXTPMarkupUIElement* pUIElement); virtual void OnInvalidateArrange(CXTPMarkupUIElement* pUIElement); public: CXTPMarkupObject* CreateMarkupObject(CXTPMarkupType* pRuntimeClass); void FinalizeMarkupObject(CXTPMarkupObject* pObject); static void AFX_CDECL RegisterClasses(); static void AFX_CDECL UnregisterClasses(); protected: virtual void GetScriptNamedItemNames(CList& names); virtual HRESULT GetScriptNamedItem(LPCWSTR lpszName, IUnknown** ppiunkItem); protected: COLORREF m_clrForeground; COLORREF m_clrImgColorKey; LOGFONT m_logFont; XTPMarkupSmoothingMode m_DefaultSmoothingMode; BOOL m_bDefaultTextSmoothing; CXTPMarkupInputElement* m_pMouseOver; CXTPMarkupInputElement* m_pMouseCapture; CXTPMarkupUIElement* m_pActiveElement; CXTPMarkupTypedSimpleStack* m_pFonts; CXTPMarkupEventHandlerMap* m_pHandlers; CXTPMarkupDelegateMap* m_pDelegates; CXTPMarkupKeyboardNavigation* m_pKeyboardNavigation; CXTPToolTipContext* m_pToolTipContext; BOOL m_bUseCustomToolTipPos; CPoint m_ptCustomToolTipPos; friend class CXTPMarkupFont; class CTooltipContext; # ifndef _XTP_ACTIVEX LONG m_dwRef; # endif class _XTP_EXT_CLASS CCodeChunk { public: CCodeChunk(LPCWSTR pCode, LPCWSTR pRequirements = NULL); ~CCodeChunk(); LPCWSTR GetCode() const; const CList& GetRequirements() const; private: CComBSTR m_code; CList m_req; CCodeChunk& operator=(const CCodeChunk& rhs); }; class _XTP_EXT_CLASS CCustomScriptItem { public: CCustomScriptItem(LPCWSTR pName, LPDISPATCH pDisp); ~CCustomScriptItem(); LPCWSTR GetName() const; LPDISPATCH GetDispatch() const; private: CComBSTR m_name; LPDISPATCH m_pDisp; CCustomScriptItem& operator=(const CCustomScriptItem& rhs); }; CXTPImageManager* m_pImageManager; CXTPMarkupStaticExtension* m_pExtensionRoot; LPWSTR m_lpszScriptEngineLanguage; CXTPActiveScriptEngine* m_pScriptEngine; CList m_ScriptCodeChunks; CXTPActiveScriptStdRuntime* m_pScriptEngineStdRuntime; CMap m_CustomScriptItems; BOOL m_bEnableGdiPlus; CXTPDpi* m_pDpi; int m_nFreezeUpdatesCounter; private: HWND m_hContextWnd; CRect m_rcContextUpdateRect; static BOOL m_bClassesRegistered; BOOL m_bContainsPendingUpdates; IXTPMarkupClientSite* m_pSite; struct CachedImageData { CXTPMarkupDeviceDependentImage* pImage; CSize size; CRuntimeClass* pDCClass; IXTPMarkupDeviceDependentImageSite* pSite; }; CMap*, CList*> m_CachedImages; protected: # ifdef _XTP_ACTIVEX DECLARE_INTERFACE_MAP() # endif # pragma warning(push) // C4616: #pragma warning : warning number '...' out of range, must be between '4001' and '4999' // C4619: #pragma warning : there is no warning number 'number' // C5204: '...': class has virtual functions, but its trivial destructor is not virtual; instances // of objects derived from this class may not be destructed correctly # pragma warning(disable : 4616 4619 5204) BEGIN_INTERFACE_PART(ActiveScriptSite, IActiveScriptSite) STDMETHOD(GetLCID)(LCID* plcid); STDMETHOD(GetItemInfo) (LPCOLESTR pstrName, DWORD dwReturnMask, IUnknown** ppiunkItem, ITypeInfo** ppti); STDMETHOD(GetDocVersionString)(BSTR* pbstrVersion); STDMETHOD(OnScriptTerminate)(const VARIANT* pvarResult, const EXCEPINFO* pexcepinfo); STDMETHOD(OnStateChange)(SCRIPTSTATE ssScriptState); STDMETHOD(OnScriptError)(IActiveScriptError* pScriptError); STDMETHOD(OnEnterScript)(); STDMETHOD(OnLeaveScript)(); # ifndef _XTP_ACTIVEX CXTPMarkupContext* pThis; # endif END_INTERFACE_PART(ActiveScriptSite); # pragma warning(pop) # ifndef _XTP_ACTIVEX friend class XActiveScriptSite; # endif # ifdef _XTP_ACTIVEX public: DECLARE_DISPATCH_MAP() DECLARE_OLETYPELIB_EX(CXTPMarkupContext); # else protected: friend class CXTPMarkupContextInternalDispatch; CCmdTarget* m_pInternalDispatch; # endif CCmdTarget* AccessInternalDispatch(); protected: void OleSetMethod(LPDISPATCH lpHandler, LPCOLESTR lpName); void OleSetHandler(LPDISPATCH lpHandler); LPDISPATCH OleCreateObject(LPCOLESTR lpName); LPDISPATCH OleCreateSolidBrush(const VARIANT& clr); LPDISPATCH OleCreateThickness(long nLeft, long nTop, long nRight, long nBottom); LPDISPATCH OleParse(LPCTSTR lpText); BOOL OleIsDpiAware(); void OleSetDpiAware(BOOL bNewValue); LPDISPATCH OleGetToolTipContext(); void OleSetIcons(LPDISPATCH lpDisp); LPDISPATCH OleGetIcons(); BSTR OleValidateXML(LPCTSTR lpText); void OleFreezeUpdates(); void OleUnfreezeUpdates(); long OleGetDefaultSmoothingMode(); void OleSetDefaultSmoothingMode(long lMode); BOOL OleGetDefaultTextSmoothing(); void OleSetDefaultTextSmoothing(BOOL bEnableTextSmoothing); /** @endcond */ friend class CXTPMarkupInputElement; }; AFX_INLINE IXTPMarkupClientSite* CXTPMarkupContext::GetClientSite() const { return m_pSite; } AFX_INLINE void CXTPMarkupContext::SetClientSite(IXTPMarkupClientSite* pSite) { m_pSite = pSite; } AFX_INLINE LOGFONT* CXTPMarkupContext::GetDefaultLogFont() { return &m_logFont; } AFX_INLINE COLORREF CXTPMarkupContext::GetDefaultForeground() { return m_clrForeground; } AFX_INLINE void CXTPMarkupContext::SetDefaultTextColor(COLORREF clr) { m_clrForeground = clr; } AFX_INLINE void CXTPMarkupContext::SetDefaultFont(HFONT font) { LOGFONT lf; GetObject(font, sizeof(LOGFONT), &lf); m_logFont = lf; } AFX_INLINE void CXTPMarkupContext::SetDefaultFont(LOGFONT* pLogFont) { m_logFont = *pLogFont; } AFX_INLINE XTPMarkupSmoothingMode CXTPMarkupContext::GetDefaultSmoothingMode() const { return m_DefaultSmoothingMode; } AFX_INLINE XTPMarkupSmoothingMode CXTPMarkupContext::SetDefaultSmoothingMode(XTPMarkupSmoothingMode smoothingMode) { XTPMarkupSmoothingMode oldMode = m_DefaultSmoothingMode; m_DefaultSmoothingMode = smoothingMode; return oldMode; } AFX_INLINE BOOL CXTPMarkupContext::GetDefaultTextSmoothing() const { return m_bDefaultTextSmoothing; } AFX_INLINE BOOL CXTPMarkupContext::SetDefaultTextSmoothing(BOOL bEnableTextSmoothing) { BOOL bOldState = m_bDefaultTextSmoothing; m_bDefaultTextSmoothing = bEnableTextSmoothing; return bOldState; } AFX_INLINE void CXTPMarkupContext::SetImageColorKey(COLORREF crColorKey) { m_clrImgColorKey = crColorKey; } /** @cond */ AFX_INLINE CXTPMarkupKeyboardNavigation* CXTPMarkupContext::GetKeyboardNavigation() const { return m_pKeyboardNavigation; } AFX_INLINE CXTPMarkupInputElement* CXTPMarkupContext::GetMouseCapture() const { return m_pMouseCapture; } /** @endcond */ AFX_INLINE BOOL CXTPMarkupContext::IsGdiPlusEnabled() const { return m_bEnableGdiPlus; } AFX_INLINE void CXTPMarkupContext::EnableGdiPlus(BOOL bEnable) { m_bEnableGdiPlus = bEnable; } AFX_INLINE CXTPToolTipContext* CXTPMarkupContext::GetToolTipContext() const { return m_pToolTipContext; } AFX_INLINE BOOL CXTPMarkupContext::GetUseCustomToolTipPosition() const { return m_bUseCustomToolTipPos; } AFX_INLINE void CXTPMarkupContext::SetUseCustomToolTipPosition(BOOL bUse, CPoint ptPos /*= CPoint(0, 0)*/) { m_bUseCustomToolTipPos = bUse; m_ptCustomToolTipPos = ptPos; } AFX_INLINE CPoint CXTPMarkupContext::GetCustomToolTipPosition() const { return m_ptCustomToolTipPos; } AFX_INLINE BOOL CXTPMarkupContext::IsDpiAware() const { return NULL != m_pDpi; } AFX_INLINE void CXTPMarkupContext::SetDpiAware(BOOL bSet /*= TRUE*/) { SetDpiAware(bSet, HWND_DESKTOP); } AFX_INLINE CXTPActiveScriptEngine* CXTPMarkupContext::GetScriptEngine() { return m_pScriptEngine; } AFX_INLINE HWND CXTPMarkupContext::GetContextWindow() const { return m_hContextWnd; } # define MARKUP_CREATE(object_class, context) \ ((object_class*)context->CreateMarkupObject(MARKUP_TYPE(object_class))) # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPMARKUPCONTEXT_H__) /** @endcond */