/** * @file XTPRibbonThemeOffice2013.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(__XTPRIBBONTHEMEOFFICE2013_H__) # define __XTPRIBBONTHEMEOFFICE2013_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** * @brief * Struct used to define context tab colors for the ribbon control. */ struct XTPRIBBON_HEADER_COLOR { COLORREF clrEdge; /**< An RGB value representing context tab border color. */ COLORREF clrBack; /**< An RGB value representing context tab background color. */ COLORREF clrText; /**< An RGB value representing context tab text color. */ }; /** * @brief * CXTPRibbonOffice2013Theme is a CXTPRibbonMarkupTheme derived class * used to represent an Office 2013 ribbon theme. */ class _XTP_EXT_CLASS CXTPRibbonOffice2013Theme : public CXTPRibbonMarkupTheme { /** @cond */ DECLARE_DYNAMIC(CXTPRibbonOffice2013Theme) /** @endcond */ public: /** * @brief * Constructs a CXTPRibbonOffice2013Theme object. * @param pPaintManager A CXTPPaintManager object. */ CXTPRibbonOffice2013Theme(CXTPPaintManager* pPaintManager); /** * @brief * Destroys a CXTPRibbonOffice2013Theme object, handles cleanup and deallocation. */ virtual ~CXTPRibbonOffice2013Theme(); /** * @brief * This method is called to refresh the visual metrics of the manager. * @details * Refreshes all of the colors in the ribbon bar. Many of the colors * used are set with the GROUP_COLOR structure. * @see * GROUP_COLOR */ virtual void RefreshMetrics(); /** * @brief * Calculates the ribbon caption height. * @param pRibbonBar Pointer to the parent ribbon bar. * @return * The ribbon caption height. */ virtual int GetRibbonCaptionHeight(const CXTPRibbonBar* pRibbonBar) const; /** * @brief * Draws the specified control which is a part of the Quick Access panel. * @param pDC Pointer to a valid device context * @param pControl Control to draw. * @param pRibbon Pointer to the ribbon bar to draw the caption for. */ virtual void DrawQuickAccessControl(CDC* pDC, CXTPRibbonBar* pRibbon, CXTPControl* pControl); /** * @brief * This method is called to draw a single tab of the ribbon bar. * @param pDC Pointer to a valid device context. * @param pItem Ribbon tab to draw. */ virtual void DrawRibbonTab(CDC* pDC, CXTPRibbonTab* pItem); /** * @brief * This method is called to draw ribbon context headers. * @param pDC Pointer to a valid device context. * @param pContextHeaders Collection of context headers. * @param pRibbonBar Pointer to the parent ribbon bar. */ virtual void DrawRibbonFrameContextHeaders(CDC* pDC, CXTPRibbonBar* pRibbonBar, CXTPRibbonTabContextHeaders* pContextHeaders); /** * @brief * This method is called to fill the background of a ribbon bar control. * @param pDC Pointer to a valid device context * @param pRibbonBar Pointer to the parent ribbon bar. */ virtual void FillRibbonBar(CDC* pDC, CXTPRibbonBar* pRibbonBar); /** * @brief * This method is called to draw the ribbon caption if EnableFrameTheme * was not called. * @param pDC Pointer to a valid device context. * @param pRibbonBar Pointer to the ribbon bar to draw the caption for. * @param bActive TRUE if the ribbon frame is active. */ virtual void DrawRibbonFrameCaptionBar(CDC* pDC, CXTPRibbonBar* pRibbonBar, BOOL bActive); /** * @brief * This method is called to draw the Ribbon caption. * @param pDC Pointer to a valid device context. * @param pRibbonBar Pointer to the ribbon bar to draw the caption for. * @param bActive TRUE if the ribbon frame is active. */ virtual void DrawRibbonFrameCaption(CDC* pDC, CXTPRibbonBar* pRibbonBar, BOOL bActive); /** * @brief * This member function will set the background image for the Office * ribbon bar. * @param nImage Identifies the background image to set, can be one of * the following IDs: *
* XTPNone * XTPCalligraphy * XTPCirclesAndStripes * XTPCircuit * XTPClouds * XTPDoodleCircles * XTPDoodleDiamonds * XTPGeometry * XTPLunchBox * XTPSchoolSupplies * XTPSpring * XTPStars * XTPStraws * XTPTreeRings * XTPUnderWater ** @see * GetBackImageName */ virtual void SetBackImage(int nImage); /** * @brief * Draws the top-left system button. * @param pDC Pointer to a valid device context. * @param pControl System button control. * @param rc Bounding rectangle of the control. */ virtual void DrawRibbonFrameSystemButton(CDC* pDC, CXTPRibbonControlSystemButton* pControl, CRect rc); protected: /** * @brief * This member function is used to get the name of the background * image located in the Office 2013 resource .DLL. * @return * A string representing the name of the background image located * in the Office 2013 resource .DLL. * @see * SetBackImage */ virtual CString GetBackImageName(); /** * @brief * Used by the theme to draw the background image for the ribbon bar. * @param pDC Pointer to a valid device context. * @param pRibbonBar Pointer to the ribbon bar to draw the background image for. */ virtual void DrawBackImage(CDC* pDC, CXTPRibbonBar* pRibbonBar); /** * @brief * Loads markup parts. * @param bReload Re-loads previously loaded parts if TRUE. */ virtual void LoadParts(BOOL bReload = FALSE); /** * @brief * Helper class used to define variables to be used by XAML Markup code. */ class CThemeStaticExtension : public CXTPMarkupStaticExtension { public: /** * @brief * Default constructor, initializes CXTPMarkupStaticExtension variables. */ CThemeStaticExtension(); }; XTPRIBBON_HEADER_COLOR m_clrHeader[24]; /**< Array of color values used for rendering the Ribbon's */ /** * context tabs. */ COLORREF m_clrRibbonInactiveFaceState; // Color of the ribbon when the application is inactive. COLORREF m_clrTabBackInactiveState; /**< Color of the ribbon tab when the application is inactive. */ COLORREF m_clrTabBackackstageLeft; /**< Color of left part of the ribbon tab when new backstage is */ /** * pop-up. */ COLORREF m_clrTabBackackstageRight; // Color of right part of the ribbon tab when new backstage /** * is pop-up. */ COLORREF m_clrRibbonTabDelimeter; // Tab delimiter color when item is shrinked. private: int m_nBackImage; int m_nCaptionHeight; CString m_strThemeName; }; # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPRIBBONTHEMEOFFICE2013_H__) /** @endcond */