2004-02-25 10:37:56 -06:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-11 01:39:57 -05:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2004-02-25 10:37:56 -06:00
|
|
|
*
|
2008-04-11 01:39:57 -05:00
|
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
2004-02-25 10:37:56 -06:00
|
|
|
*
|
2008-04-11 01:39:57 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2004-02-25 10:37:56 -06:00
|
|
|
*
|
2008-04-11 01:39:57 -05:00
|
|
|
* $RCSfile: menubarwrapper.hxx,v $
|
|
|
|
* $Revision: 1.8 $
|
2004-02-25 10:37:56 -06:00
|
|
|
*
|
2008-04-11 01:39:57 -05:00
|
|
|
* This file is part of OpenOffice.org.
|
2004-02-25 10:37:56 -06:00
|
|
|
*
|
2008-04-11 01:39:57 -05:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2004-02-25 10:37:56 -06:00
|
|
|
*
|
2008-04-11 01:39:57 -05:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2004-02-25 10:37:56 -06:00
|
|
|
*
|
2008-04-11 01:39:57 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2004-02-25 10:37:56 -06:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __FRAMEWORK_UIELEMENT_MENUBARWRAPPER_HXX_
|
|
|
|
#define __FRAMEWORK_UIELEMENT_MENUBARWRAPPER_HXX_
|
|
|
|
|
|
|
|
//_________________________________________________________________________________________________________________
|
|
|
|
// my own includes
|
|
|
|
//_________________________________________________________________________________________________________________
|
|
|
|
|
|
|
|
#include <helper/uiconfigelementwrapperbase.hxx>
|
|
|
|
#include <uielement/menubarmanager.hxx>
|
|
|
|
|
|
|
|
//_________________________________________________________________________________________________________________
|
|
|
|
// interface includes
|
|
|
|
//_________________________________________________________________________________________________________________
|
|
|
|
#include <com/sun/star/frame/XFrame.hpp>
|
2006-12-13 08:05:05 -06:00
|
|
|
#include <com/sun/star/frame/XDispatchProvider.hpp>
|
2004-02-25 10:37:56 -06:00
|
|
|
#include <com/sun/star/lang/XComponent.hpp>
|
|
|
|
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
2006-12-13 08:05:05 -06:00
|
|
|
#ifndef __COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
|
|
|
|
#include <com/sun/star/container/XNameAccess.hpp>
|
|
|
|
#endif
|
2004-02-25 10:37:56 -06:00
|
|
|
|
|
|
|
//_________________________________________________________________________________________________________________
|
|
|
|
// other includes
|
|
|
|
//_________________________________________________________________________________________________________________
|
|
|
|
|
2007-04-19 03:20:23 -05:00
|
|
|
#include <hash_map>
|
2006-12-13 08:05:05 -06:00
|
|
|
|
2004-02-25 10:37:56 -06:00
|
|
|
namespace framework
|
|
|
|
{
|
|
|
|
|
2006-12-13 08:05:05 -06:00
|
|
|
class MenuBarWrapper : public UIConfigElementWrapperBase,
|
|
|
|
public ::com::sun::star::container::XNameAccess
|
|
|
|
|
2004-02-25 10:37:56 -06:00
|
|
|
{
|
|
|
|
public:
|
2004-05-03 07:18:41 -05:00
|
|
|
// #110897#
|
|
|
|
MenuBarWrapper(
|
|
|
|
const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
|
2004-02-25 10:37:56 -06:00
|
|
|
virtual ~MenuBarWrapper();
|
|
|
|
|
2006-12-13 08:05:05 -06:00
|
|
|
//---------------------------------------------------------------------------------------------------------
|
|
|
|
// XInterface, XTypeProvider
|
|
|
|
//---------------------------------------------------------------------------------------------------------
|
|
|
|
FWK_DECLARE_XINTERFACE
|
|
|
|
FWK_DECLARE_XTYPEPROVIDER
|
|
|
|
|
2004-05-03 07:18:41 -05:00
|
|
|
// #110897#
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& getServiceFactory();
|
|
|
|
|
2004-02-25 10:37:56 -06:00
|
|
|
MenuBarManager* GetMenuBarManager() const { return static_cast< MenuBarManager* >( m_xMenuBarManager.get() ); }
|
2006-12-13 08:05:05 -06:00
|
|
|
void InvalidatePopupControllerCache() { m_bRefreshPopupControllerCache = sal_True; }
|
2004-02-25 10:37:56 -06:00
|
|
|
|
|
|
|
// XComponent
|
|
|
|
virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
// XInitialization
|
|
|
|
virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
// XUIElement
|
|
|
|
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getRealInterface() throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
// XUIElementSettings
|
|
|
|
virtual void SAL_CALL updateSettings( ) throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getSettings( sal_Bool bWriteable ) throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL setSettings( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& UISettings ) throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
|
2006-12-13 08:05:05 -06:00
|
|
|
// XElementAccess
|
|
|
|
virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual ::sal_Bool SAL_CALL hasElements() throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
// XNameAccess
|
|
|
|
virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames() throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void fillPopupControllerCache();
|
|
|
|
|
|
|
|
sal_Bool m_bRefreshPopupControllerCache : 1;
|
2006-06-19 05:05:11 -05:00
|
|
|
com::sun::star::uno::Reference< com::sun::star::lang::XComponent > m_xMenuBarManager;
|
2004-05-03 07:18:41 -05:00
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& mxServiceFactory;
|
2006-12-13 08:05:05 -06:00
|
|
|
PopupControllerCache m_aPopupControllerCache;
|
2004-02-25 10:37:56 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace framework
|
|
|
|
|
|
|
|
#endif // __FRAMEWORK_UIELEMENT_MENUBARWRAPPER_HXX_
|