LibreOffice Module chart2 (master) 1
FeatureCommandDispatchBase.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#pragma once
20
21#include "CommandDispatch.hxx"
22
23#include <com/sun/star/frame/DispatchInformation.hpp>
24
26{
27 NONE = 0,
28
29 //Draw Command Ids:
31 DrawLine = 2,
33 DrawRect = 4,
34 DrawEllipse = 5,
36 DrawText = 7,
38 DrawCaption = 9,
46
47 //Shape Controller Command Ids:
48 ShapeFormatLine = 21,
49 ShapeFormatArea = 22,
55 ShapeForward = 29,
56 ShapeBackward = 30,
57 ShapeSendToBack = 31,
58 ShapeFontDialog = 35,
60};
61
62
63namespace chart
64{
65
66struct ControllerFeature: public css::frame::DispatchInformation
67{
69};
70
71typedef std::map< OUString,
73
75{
77 css::uno::Any aState;
78
79 FeatureState() : bEnabled( false ) { }
80};
81
85{
86public:
87 explicit FeatureCommandDispatchBase( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
88 virtual ~FeatureCommandDispatchBase() override;
89
90 // late initialisation, especially for adding as listener
91 virtual void initialize() override;
92
93 virtual bool isFeatureSupported( const OUString& rCommandURL );
94
95protected:
96 // XDispatch
97 virtual void SAL_CALL dispatch( const css::util::URL& URL,
98 const css::uno::Sequence< css::beans::PropertyValue >& Arguments ) override;
99
100 virtual void fireStatusEvent( const OUString& rURL,
101 const css::uno::Reference< css::frame::XStatusListener >& xSingleListener ) override;
102
103 // state of a feature
104 virtual FeatureState getState( const OUString& rCommand ) = 0;
105
106 // execute a feature
107 virtual void execute( const OUString& rCommand, const css::uno::Sequence< css::beans::PropertyValue>& rArgs ) = 0;
108
109 // all the features which should be handled by this class
110 virtual void describeSupportedFeatures() = 0;
111
125 void implDescribeSupportedFeature( const char* pAsciiCommandURL, ChartCommandID nId,
126 sal_Int16 nGroup );
127
129
131};
132
133} // namespace chart
134
135/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@ ShapeObjectTitleDescription
This is the base class for an XDispatch.
This is a base class for CommandDispatch implementations with feature support.
virtual void fireStatusEvent(const OUString &rURL, const css::uno::Reference< css::frame::XStatusListener > &xSingleListener) override
sends a status event for a specific command to all registered listeners or only the one given when se...
virtual void describeSupportedFeatures()=0
void implDescribeSupportedFeature(const char *pAsciiCommandURL, ChartCommandID nId, sal_Int16 nGroup)
describes a feature supported by the controller
virtual void SAL_CALL dispatch(const css::util::URL &URL, const css::uno::Sequence< css::beans::PropertyValue > &Arguments) override
virtual FeatureState getState(const OUString &rCommand)=0
virtual void execute(const OUString &rCommand, const css::uno::Sequence< css::beans::PropertyValue > &rArgs)=0
virtual bool isFeatureSupported(const OUString &rCommandURL)
FeatureCommandDispatchBase(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
NONE
std::map< OUString, ControllerFeature > SupportedFeatures
void DrawLine(OutputDevice &rDev, const basegfx::B2DPoint &rP1, const basegfx::B2DPoint &rP2, sal_uInt32 nWidth, SvxBorderLineStyle nDashing)