LibreOffice Module framework (master) 1
buttontoolbarcontroller.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/lang/XInitialization.hpp>
23#include <com/sun/star/util/XUpdatable.hpp>
24#include <com/sun/star/frame/XFrame.hpp>
25#include <com/sun/star/frame/XStatusListener.hpp>
26#include <com/sun/star/util/XURLTransformer.hpp>
27#include <com/sun/star/frame/XToolbarController.hpp>
28#include <com/sun/star/uno/XComponentContext.hpp>
29
31#include <cppuhelper/weak.hxx>
32#include <vcl/vclptr.hxx>
33
34class ToolBox;
35
36namespace framework
37{
38
39class ButtonToolbarController final : public css::frame::XStatusListener,
40 public css::frame::XToolbarController,
41 public css::lang::XInitialization,
42 public css::util::XUpdatable,
43 public css::lang::XComponent,
44 public ::cppu::BaseMutex,
46{
47 public:
48 ButtonToolbarController( css::uno::Reference< css::uno::XComponentContext > xContext,
49 ToolBox* pToolBar,
50 OUString aCommand );
51 virtual ~ButtonToolbarController() override;
52
53 // XInterface
54 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
55 virtual void SAL_CALL acquire() noexcept override;
56 virtual void SAL_CALL release() noexcept override;
57
58 // XInitialization
59 virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
60
61 // XUpdatable
62 virtual void SAL_CALL update() override;
63
64 // XComponent
65 virtual void SAL_CALL dispose() override;
66 virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override;
67 virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override;
68
69 // XEventListener
70 virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
71
72 // XStatusListener
73 virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) override;
74
75 // XToolbarController
76 virtual void SAL_CALL execute( sal_Int16 KeyModifier ) override;
77 virtual void SAL_CALL click() override;
78 virtual void SAL_CALL doubleClick() override;
79 virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createPopupWindow() override;
80 virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) override;
81
82 private:
85 OUString m_aCommandURL;
86 css::uno::Reference< css::frame::XFrame > m_xFrame;
87 css::uno::Reference< css::uno::XComponentContext > m_xContext;
88 css::uno::Reference< css::util::XURLTransformer > m_xURLTransformer;
90};
91
92}
93
94/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createPopupWindow() override
css::uno::Reference< css::frame::XFrame > m_xFrame
virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow(const css::uno::Reference< css::awt::XWindow > &Parent) override
virtual void SAL_CALL execute(sal_Int16 KeyModifier) override
css::uno::Reference< css::util::XURLTransformer > m_xURLTransformer
virtual void SAL_CALL click() override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
virtual void SAL_CALL doubleClick() override
virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent &Event) override
css::uno::Reference< css::uno::XComponentContext > m_xContext
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
virtual void SAL_CALL update() override
ButtonToolbarController(css::uno::Reference< css::uno::XComponentContext > xContext, ToolBox *pToolBar, OUString aCommand)
virtual void SAL_CALL dispose() override
virtual void SAL_CALL release() noexcept override
virtual void SAL_CALL acquire() noexcept override
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
Sequence< PropertyValue > aArguments
OUString aCommand