/** * @file XTPMarkupThickness.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(__XTPMARKUPTHICKNESS_H__) # define __XTPMARKUPTHICKNESS_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPMarkupObject; class CXTPMarkupBuilder; /** * @brief * The CXTPMarkupThickness class describes the thickness of the * left, top, right, and bottom sides of a rectangle. */ class _XTP_EXT_CLASS CXTPMarkupThickness : public CXTPMarkupObject { /** @cond */ DECLARE_MARKUPCLASS(CXTPMarkupThickness); /** @endcond */ struct DefaultThicknessTag { }; public: /** * @brief * Constructs a CXTPMarkupThickness object and sets * the left, top, right, and bottom thickness to 0. */ CXTPMarkupThickness(); /** * @brief * Constructs a CXTPMarkupThickness object and sets * the left, top, right, and bottom thickness. * @param other The left, top, right, and bottom thickness. */ CXTPMarkupThickness(const CXTPMarkupThickness& other); /** * @brief * Constructs a CXTPMarkupThickness object and sets * the left, top, right, and bottom thickness. * @param nThickness The left, top, right, and bottom thickness. */ CXTPMarkupThickness(long nThickness); /** * @brief * Constructs a CXTPMarkupThickness object and sets * the left/right and top/bottom thickness. * @param nXThickness The left and right thickness. * @param nYThickness The top and bottom thickness. */ CXTPMarkupThickness(long nXThickness, long nYThickness); /** * @brief * Constructs a CXTPMarkupThickness object and sets * the left, top, right, and bottom thickness. * @param nLeft The left thickness. * @param nTop The top thickness. * @param nRight The right thickness. * @param nBottom The bottom thickness. */ CXTPMarkupThickness(long nLeft, long nTop, long nRight, long nBottom); public: static CXTPMarkupThickness* AFX_CDECL CreateValue(); CSize GetSize() const; BOOL IsZero() const; static CRect AFX_CDECL HelperDeflateRect(CRect rt, CXTPMarkupThickness* thick); CXTPMarkupObject* ConvertFrom(CXTPMarkupBuilder* pBuilder, CXTPMarkupObject* pObject) const; /** * @brief * Gets the left thickness. * @return * The left thickness. */ long GetLeft() const; /** * @brief * Sets the left thickness. * @param nThickness New left thickness. */ void SetLeft(long nThickness); /** * @brief * Gets the top thickness. * @return * The top thickness. */ long GetTop() const; /** * @brief * Gets the right thickness. * @return * The right thickness. */ long GetRight() const; /** * @brief * Gets the bottom thickness. * @return * The bottom thickness. */ long GetBottom() const; virtual BOOL IsEqual(const CXTPMarkupObject* pObject) const; /** @cond */ public: DECLARE_DISPATCH_MAP() # ifdef _XTP_ACTIVEX DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPMarkupThickness); # endif /** @endcond */ protected: long m_left; long m_top; long m_right; long m_bottom; }; AFX_INLINE long CXTPMarkupThickness::GetLeft() const { return m_left; } AFX_INLINE long CXTPMarkupThickness::GetTop() const { return m_top; } AFX_INLINE long CXTPMarkupThickness::GetRight() const { return m_right; } AFX_INLINE long CXTPMarkupThickness::GetBottom() const { return m_bottom; } AFX_INLINE CSize CXTPMarkupThickness::GetSize() const { return CSize(m_left + m_right, m_top + m_bottom); } AFX_INLINE BOOL CXTPMarkupThickness::IsZero() const { return m_left == 0 && m_right == 0 && m_top == 0 && m_bottom == 0; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // #if !defined(__XTPMARKUPTHICKNESS_H__) /** @endcond */