Remove duplicated include
[LibreOffice.git] / framework / inc / uielement / complextoolbarcontroller.hxx
blob0aa10471be443e42975e14d8a51c9350c98efe5e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 #pragma once
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>
32 class ToolBox;
34 namespace framework
37 class ComplexToolbarController : public svt::ToolboxController
40 public:
41 ComplexToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
42 const css::uno::Reference< css::frame::XFrame >& rFrame,
43 ToolBox* pToolBar,
44 ToolBoxItemId nID,
45 const OUString& aCommand );
46 virtual ~ComplexToolbarController() override;
48 // XComponent
49 virtual void SAL_CALL dispose() override;
51 // XToolbarController
52 virtual void SAL_CALL execute( sal_Int16 KeyModifier ) override;
54 // XStatusListener
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);
60 struct ExecuteInfo
62 css::uno::Reference< css::frame::XDispatch > xDispatch;
63 css::util::URL aTargetURL;
64 css::uno::Sequence< css::beans::PropertyValue > aArgs;
67 struct NotifyInfo
69 OUString aEventName;
70 css::uno::Reference< css::frame::XControlNotificationListener > xNotifyListener;
71 css::util::URL aSourceURL;
72 css::uno::Sequence< css::beans::NamedValue > aInfoSeq;
75 protected:
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;
89 ToolBoxItemId m_nID;
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: */