/** * @file XTPRibbonQuickAccessControls.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(__XTPRIBBONQUICKACCESSCONTROLS_H__) # define __XTPRIBBONQUICKACCESSCONTROLS_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** * @brief * CXTPRibbonControls is a CXTPControls derived class. * It represents a collection of controls for a Ribbon Bar. */ class _XTP_EXT_CLASS CXTPRibbonControls : public CXTPControls { /** @cond */ DECLARE_DYNCREATE(CXTPRibbonControls) /** @endcond */ public: /** * @brief * Constructs a CXTPRibbonControls object. */ CXTPRibbonControls(); protected: /** * @brief * This method is called when a control is removed from the collection. * @param pControl Control that was removed from the collection. */ virtual void OnControlRemoved(CXTPControl* pControl); /** * @brief * This method is called when a control is about to be removed from * the collection. * @param pControl Control that is about to be removed from the collection. * @return * TRUE to cancel the removal of the control. */ virtual BOOL OnControlRemoving(CXTPControl* pControl); /** * @brief * This method is called to check if a control has changed and must * be saved. * @param pControl Control to check. * @return * TRUE if the control must be saved. */ virtual BOOL ShouldSerializeControl(CXTPControl* pControl); /** * @brief * This method is called to copy controls. * @param pControls Controls to be copied. * @param bRecursive TRUE to copy recursively. */ virtual void Copy(CXTPControls* pControls, BOOL bRecursive = FALSE); }; /** * @brief * CXTPRibbonQuickAccessControls is a CXTPControls derived class. * It represents a collection of Quick Access controls for a Ribbon Bar. */ class _XTP_EXT_CLASS CXTPRibbonQuickAccessControls : public CXTPControls { public: /** * @brief * Constructs a CXTPRibbonQuickAccessControls object. */ CXTPRibbonQuickAccessControls(); /** * @brief * Destroys a CXTPRibbonQuickAccessControls object, handles cleanup and deallocation. */ virtual ~CXTPRibbonQuickAccessControls(); public: /** * @brief * Call this member to remove a control. * @param pControl Control to be removed. */ void Remove(CXTPControl* pControl); /** * @brief * Call this method to reset Quick Access controls. */ void Reset(); /** * @brief * Call this method to find a duplicate of a control. * @param pControl Control with a duplicate to find. * @return * A pointer to a duplicate of the control if successful, otherwise NULL. */ CXTPControl* FindDuplicate(CXTPControl* pControl); /** * @brief * Retrieves the index of a specified control from the Quick Access bar. * @param pControl Control whose index must be retrieved. * @return * The index of the specified control if successful, otherwise -1. */ int IndexOf(CXTPControl* pControl) const; protected: /** * @brief * This method is called when a control is added to the collection. * @param pControl Control that was added to the collection. */ virtual void OnControlAdded(CXTPControl* pControl); /** * @brief * This method is called when a control is removed from the collection. * @param pControl Control that was removed from the collection. */ virtual void OnControlRemoved(CXTPControl* pControl); protected: /** @cond */ virtual void RefreshIndexes(); /** @endcond */ }; # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPRIBBONQUICKACCESSCONTROLS_H__) /** @endcond */