/** * @file XTPCommandBarList.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(__XTPCOMMANDBARLIST_H__) # define __XTPCOMMANDBARLIST_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPCommandBar; class CXTPCommandBars; /** * @brief * CXTPCommandBarList is a CList derived class. It is used as a collection * of CXTPCommandBar classes. */ class _XTP_EXT_CLASS CXTPCommandBarList : public CXTPCmdTarget { public: /** * @brief * Constructs a CXTPCommandBarList object. * @param pCommandBars Parent CXTPCommandBars pointer. */ CXTPCommandBarList(CXTPCommandBars* pCommandBars) { m_pCommandBars = pCommandBars; } /** * @brief * Destroys a CXTPCommandBarList object, handles cleanup and * deallocation. */ virtual ~CXTPCommandBarList(); public: /** * @brief * Call this method to find the command bar with the specified identifier. * @param nBarID Identifier of the command bar to find. * @return * A pointer to a CXTPCommandBar object. */ CXTPCommandBar* FindCommandBar(UINT nBarID) const; /** * @brief * Call this method to get the CXTPCommandBars parent object attached to the list. * @return * Pointer to the CXTPCommandBars parent object. * @see * CXTPCommandBars, CXTPCommandBar */ CXTPCommandBars* GetCommandBars() const { return m_pCommandBars; } /** * @brief * Call this method to get the command bar at the specified index in the list. * @param nIndex Index of the command bar to return. * @return * Pointer to the CXTPCommandBar object. * @see * GetCount */ CXTPCommandBar* GetAt(int nIndex) const; /** * @brief * Call this method to get the number of command bars in the list. * @return * Number of command bars in the list. * @see * GetAt */ int GetCount() const; /** * @brief * Call this method to add a new command bar to the list. * @param pCommandBar Pointer to the CXTPCommandBar object to be added. * @return * Pointer to the newly added CXTPCommandBar object. * @see * GetAt, GetCount */ virtual CXTPCommandBar* Add(CXTPCommandBar* pCommandBar); /** * @brief * Call this method to check if a specified command bar is in the list. * @param pCommandBar Pointer to the CXTPCommandBar object to check. * @return * TRUE if the CXTPCommandBar object is in the list, otherwise FALSE. */ BOOL Lookup(CXTPCommandBar* pCommandBar) const; /** * @brief * Call this method to remove all command bars from the list. * @see * Remove */ void RemoveAll(); /** * @brief * Call this method to remove a specified command bar from the list. * @param pCommandBar Pointer to the CXTPCommandBar object to be removed. * @see * RemoveAll */ void Remove(CXTPCommandBar* pCommandBar); protected: CXTPCommandBars* m_pCommandBars; /**< Parent CXTPCommandBars object */ CArray m_arrBars; /**< Array of CommandBars */ }; /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // !defined(__XTPCOMMANDBARLIST_H__) /** @endcond */