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 .
22 #include <com/sun/star/util/URL.hpp>
23 #include <com/sun/star/beans/NamedValue.hpp>
24 #include <com/sun/star/frame/XDispatch.hpp>
25 #include <com/sun/star/frame/ControlCommand.hpp>
26 #include <com/sun/star/frame/XControlNotificationListener.hpp>
28 #include <svtools/toolboxcontroller.hxx>
29 #include <tools/link.hxx>
30 #include <vcl/vclptr.hxx>
37 class ComplexToolbarController
: public svt::ToolboxController
41 ComplexToolbarController( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
,
42 const css::uno::Reference
< css::frame::XFrame
>& rFrame
,
45 const OUString
& aCommand
);
46 virtual ~ComplexToolbarController() override
;
49 virtual void SAL_CALL
dispose() override
;
52 virtual void SAL_CALL
execute( sal_Int16 KeyModifier
) override
;
55 virtual void SAL_CALL
statusChanged( const css::frame::FeatureStateEvent
& Event
) override
;
57 DECL_STATIC_LINK( ComplexToolbarController
, ExecuteHdl_Impl
, void*, void );
58 DECL_STATIC_LINK( ComplexToolbarController
, Notify_Impl
, void*, void);
62 css::uno::Reference
< css::frame::XDispatch
> xDispatch
;
63 css::util::URL aTargetURL
;
64 css::uno::Sequence
< css::beans::PropertyValue
> aArgs
;
70 css::uno::Reference
< css::frame::XControlNotificationListener
> xNotifyListener
;
71 css::util::URL aSourceURL
;
72 css::uno::Sequence
< css::beans::NamedValue
> aInfoSeq
;
76 css::uno::Reference
< css::frame::XDispatch
> getDispatchFromCommand( const OUString
& aCommand
) const;
77 void addNotifyInfo( const OUString
& aEventName
,
78 const css::uno::Reference
< css::frame::XDispatch
>& xDispatch
,
79 const css::uno::Sequence
< css::beans::NamedValue
>& rInfo
);
81 virtual void executeControlCommand( const css::frame::ControlCommand
& rControlCommand
) = 0;
82 virtual css::uno::Sequence
< css::beans::PropertyValue
> getExecuteArgs(sal_Int16 KeyModifier
) const;
83 const css::util::URL
& getInitializedURL();
84 void notifyFocusGet();
85 void notifyFocusLost();
86 void notifyTextChanged( const OUString
& aText
);
88 VclPtr
<ToolBox
> m_xToolbar
;
90 bool m_bMadeInvisible
;
91 mutable css::util::URL m_aURL
;
92 css::uno::Reference
< css::util::XURLTransformer
> m_xURLTransformer
;
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */