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_COMPLEXTOOLBARCONTROLLER_HXX
21 #define INCLUDED_FRAMEWORK_INC_UIELEMENT_COMPLEXTOOLBARCONTROLLER_HXX
23 #include <com/sun/star/util/URL.hpp>
24 #include <com/sun/star/beans/NamedValue.hpp>
25 #include <com/sun/star/frame/XDispatch.hpp>
26 #include <com/sun/star/frame/ControlCommand.hpp>
27 #include <com/sun/star/frame/XControlNotificationListener.hpp>
29 #include <svtools/toolboxcontroller.hxx>
30 #include <tools/link.hxx>
31 #include <vcl/vclptr.hxx>
34 namespace vcl
{ class Window
; }
41 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatch
> xDispatch
;
42 ::com::sun::star::util::URL aTargetURL
;
43 ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
> aArgs
;
49 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XControlNotificationListener
> xNotifyListener
;
50 ::com::sun::star::util::URL aSourceURL
;
51 ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::NamedValue
> aInfoSeq
;
54 class ComplexToolbarController
: public svt::ToolboxController
58 ComplexToolbarController( const com::sun::star::uno::Reference
< com::sun::star::uno::XComponentContext
>& rxContext
,
59 const com::sun::star::uno::Reference
< com::sun::star::frame::XFrame
>& rFrame
,
62 const OUString
& aCommand
);
63 virtual ~ComplexToolbarController();
66 virtual void SAL_CALL
dispose() throw ( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
69 virtual void SAL_CALL
execute( sal_Int16 KeyModifier
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
72 virtual void SAL_CALL
statusChanged( const ::com::sun::star::frame::FeatureStateEvent
& Event
) throw ( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
74 DECL_STATIC_LINK( ComplexToolbarController
, ExecuteHdl_Impl
, ExecuteInfo
* );
75 DECL_STATIC_LINK( ComplexToolbarController
, Notify_Impl
, NotifyInfo
* );
78 static sal_Int32
getFontSizePixel( const vcl::Window
* pWindow
);
79 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatch
> getDispatchFromCommand( const OUString
& aCommand
) const;
80 void addNotifyInfo( const OUString
& aEventName
,
81 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatch
>& xDispatch
,
82 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::NamedValue
>& rInfo
);
84 virtual void executeControlCommand( const ::com::sun::star::frame::ControlCommand
& rControlCommand
) = 0;
85 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
> getExecuteArgs(sal_Int16 KeyModifier
) const;
86 const ::com::sun::star::util::URL
& getInitializedURL();
87 void notifyFocusGet();
88 void notifyFocusLost();
89 void notifyTextChanged( const OUString
& aText
);
91 VclPtr
<ToolBox
> m_pToolbar
;
93 bool m_bMadeInvisible
;
94 mutable ::com::sun::star::util::URL m_aURL
;
95 ::com::sun::star::uno::Reference
< ::com::sun::star::util::XURLTransformer
> m_xURLTransformer
;
100 #endif // INCLUDED_FRAMEWORK_INC_UIELEMENT_COMPLEXTOOLBARCONTROLLER_HXX
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */