1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_REPORTDESIGN_SOURCE_UI_INC_TOOLBOXCONTROLLER_HXX
20 #define INCLUDED_REPORTDESIGN_SOURCE_UI_INC_TOOLBOXCONTROLLER_HXX
22 #include <sal/config.h>
26 #include <rtl/ref.hxx>
27 #include <svtools/toolboxcontroller.hxx>
28 #include <com/sun/star/lang/XServiceInfo.hpp>
29 #include <com/sun/star/uno/XComponentContext.hpp>
30 #include <com/sun/star/frame/XSubToolbarController.hpp>
31 #include <cppuhelper/implbase2.hxx>
33 class SfxToolBoxControl
;
36 typedef ::cppu::ImplHelper2
< ::com::sun::star::lang::XServiceInfo
,
37 ::com::sun::star::frame::XSubToolbarController
> TToolboxController_BASE
;
38 typedef rtl::Reference
<SfxToolBoxControl
> TToolbarHelper
;
40 class OToolboxController
: public ::svt::ToolboxController
41 ,public TToolboxController_BASE
43 typedef std::map
<OUString
, sal_Bool
> TCommandState
;
44 TCommandState m_aStates
;
45 TToolbarHelper m_pToolbarController
;
46 sal_uInt16 m_nToolBoxId
;
48 OToolboxController(const OToolboxController
&) SAL_DELETED_FUNCTION
;
49 void operator =(const OToolboxController
&) SAL_DELETED_FUNCTION
;
51 OToolboxController(const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& _rxORB
);
52 virtual ~OToolboxController();
55 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface( const ::com::sun::star::uno::Type
& aType
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
56 virtual void SAL_CALL
acquire() throw () SAL_OVERRIDE
;
57 virtual void SAL_CALL
release() throw () SAL_OVERRIDE
;
59 virtual OUString SAL_CALL
getImplementationName() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
60 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
61 // need by registration
62 static OUString
getImplementationName_Static() throw( ::com::sun::star::uno::RuntimeException
);
63 static ::com::sun::star::uno::Sequence
< OUString
> getSupportedServiceNames_Static() throw( ::com::sun::star::uno::RuntimeException
);
64 static ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
65 create(::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> const & xContext
);
66 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
69 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
, std::exception
) SAL_OVERRIDE
;
71 virtual void SAL_CALL
statusChanged( const ::com::sun::star::frame::FeatureStateEvent
& Event
) throw ( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
73 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XWindow
> SAL_CALL
createPopupWindow() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
74 virtual void SAL_CALL
execute( sal_Int16 KeyModifier
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
76 // XSubToolbarController
77 virtual sal_Bool SAL_CALL
opensSubToolbar( ) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
78 virtual OUString SAL_CALL
getSubToolbarName( ) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
79 virtual void SAL_CALL
functionSelected( const OUString
& aCommand
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
80 virtual void SAL_CALL
updateImage( ) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
81 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XWindow
> SAL_CALL
createItemWindow( const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XWindow
>& Parent
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
86 #endif // INCLUDED_REPORTDESIGN_SOURCE_UI_INC_TOOLBOXCONTROLLER_HXX
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */