LibreOffice Module framework (master) 1
complextoolbarcontroller.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
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>
27
29#include <tools/link.hxx>
30#include <vcl/vclptr.hxx>
31
32class ToolBox;
33
34namespace framework
35{
36
38
39{
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;
47
48 // XComponent
49 virtual void SAL_CALL dispose() override;
50
51 // XToolbarController
52 virtual void SAL_CALL execute( sal_Int16 KeyModifier ) override;
53
54 // XStatusListener
55 virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) override;
56
57 DECL_STATIC_LINK( ComplexToolbarController, ExecuteHdl_Impl, void*, void );
58 DECL_STATIC_LINK( ComplexToolbarController, Notify_Impl, void*, void);
59
61 {
62 css::uno::Reference< css::frame::XDispatch > xDispatch;
63 css::util::URL aTargetURL;
64 css::uno::Sequence< css::beans::PropertyValue > aArgs;
65 };
66
68 {
69 OUString aEventName;
70 css::uno::Reference< css::frame::XControlNotificationListener > xNotifyListener;
71 css::util::URL aSourceURL;
72 css::uno::Sequence< css::beans::NamedValue > aInfoSeq;
73 };
74
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 );
80
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 );
87
91 mutable css::util::URL m_aURL;
92 css::uno::Reference< css::util::XURLTransformer > m_xURLTransformer;
93};
94
95}
96
97/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::frame::XDispatch > getDispatchFromCommand(const OUString &aCommand) const
css::uno::Reference< css::util::XURLTransformer > m_xURLTransformer
virtual void executeControlCommand(const css::frame::ControlCommand &rControlCommand)=0
DECL_STATIC_LINK(ComplexToolbarController, Notify_Impl, void *, void)
virtual void SAL_CALL dispose() override
void addNotifyInfo(const OUString &aEventName, const css::uno::Reference< css::frame::XDispatch > &xDispatch, const css::uno::Sequence< css::beans::NamedValue > &rInfo)
virtual css::uno::Sequence< css::beans::PropertyValue > getExecuteArgs(sal_Int16 KeyModifier) const
DECL_STATIC_LINK(ComplexToolbarController, ExecuteHdl_Impl, void *, void)
ComplexToolbarController(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::frame::XFrame > &rFrame, ToolBox *pToolBar, ToolBoxItemId nID, const OUString &aCommand)
virtual void SAL_CALL execute(sal_Int16 KeyModifier) override
virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent &Event) override
css::uno::Sequence< css::beans::PropertyValue > aArgs
css::uno::Reference< css::frame::XDispatch > xDispatch
css::uno::Reference< css::frame::XControlNotificationListener > xNotifyListener
css::uno::Sequence< css::beans::NamedValue > aInfoSeq
OUString aCommand