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 .
20 #ifndef INCLUDED_FRAMEWORK_INC_UIELEMENT_BUTTONTOOLBARCONTROLLER_HXX
21 #define INCLUDED_FRAMEWORK_INC_UIELEMENT_BUTTONTOOLBARCONTROLLER_HXX
23 #include <com/sun/star/lang/XInitialization.hpp>
24 #include <com/sun/star/util/XUpdatable.hpp>
25 #include <com/sun/star/frame/XFrame.hpp>
26 #include <com/sun/star/frame/XDispatch.hpp>
27 #include <com/sun/star/frame/XStatusListener.hpp>
28 #include <com/sun/star/util/XURLTransformer.hpp>
29 #include <com/sun/star/beans/NamedValue.hpp>
30 #include <com/sun/star/frame/ControlCommand.hpp>
31 #include <com/sun/star/frame/XLayoutManager.hpp>
32 #include <com/sun/star/frame/XToolbarController.hpp>
33 #include <com/sun/star/uno/XComponentContext.hpp>
35 #include <comphelper/broadcasthelper.hxx>
36 #include <cppuhelper/weak.hxx>
37 #include <vcl/vclptr.hxx>
44 class ButtonToolbarController
: public ::com::sun::star::frame::XStatusListener
,
45 public ::com::sun::star::frame::XToolbarController
,
46 public ::com::sun::star::lang::XInitialization
,
47 public ::com::sun::star::util::XUpdatable
,
48 public ::com::sun::star::lang::XComponent
,
49 public ::comphelper::OBaseMutex
,
50 public ::cppu::OWeakObject
53 ButtonToolbarController( const com::sun::star::uno::Reference
< com::sun::star::uno::XComponentContext
>& rxContext
,
55 const OUString
& aCommand
);
56 virtual ~ButtonToolbarController();
59 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
;
60 virtual void SAL_CALL
acquire() throw () SAL_OVERRIDE
;
61 virtual void SAL_CALL
release() throw () SAL_OVERRIDE
;
64 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
;
67 virtual void SAL_CALL
update() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
70 virtual void SAL_CALL
dispose() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
71 virtual void SAL_CALL
addEventListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
72 virtual void SAL_CALL
removeEventListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
>& aListener
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
75 virtual void SAL_CALL
disposing( const com::sun::star::lang::EventObject
& Source
) throw ( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
78 virtual void SAL_CALL
statusChanged( const ::com::sun::star::frame::FeatureStateEvent
& Event
) throw ( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
81 virtual void SAL_CALL
execute( sal_Int16 KeyModifier
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
82 virtual void SAL_CALL
click() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
83 virtual void SAL_CALL
doubleClick() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
84 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XWindow
> SAL_CALL
createPopupWindow() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
85 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
;
88 bool m_bInitialized
: 1,
90 OUString m_aCommandURL
;
91 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
> m_xFrame
;
92 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> m_xContext
;
93 ::com::sun::star::uno::Reference
< ::com::sun::star::util::XURLTransformer
> m_xURLTransformer
;
94 VclPtr
<ToolBox
> m_pToolbar
;
99 #endif // INCLUDED_FRAMEWORK_INC_UIELEMENT_BUTTONTOOLBARCONTROLLER_HXX
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */