Update git submodules
[LibreOffice.git] / chart2 / source / controller / main / DrawCommandDispatch.hxx
blob65200cca6323adb67b6db8b0912b4c54d6566f1d
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 .
19 #pragma once
21 #include <svx/svdobjkind.hxx>
22 #include "FeatureCommandDispatchBase.hxx"
23 #include <rtl/ref.hxx>
25 class SfxItemSet;
26 class SdrObject;
28 namespace chart
31 class ChartController;
33 /** This is a CommandDispatch implementation for drawing objects.
35 class DrawCommandDispatch: public FeatureCommandDispatchBase
37 public:
38 DrawCommandDispatch( const css::uno::Reference< css::uno::XComponentContext >& rxContext, ChartController* pController );
39 virtual ~DrawCommandDispatch() override;
41 virtual bool isFeatureSupported( const OUString& rCommandURL ) override;
43 void setAttributes( SdrObject* pObj );
44 void setLineEnds( SfxItemSet& rAttr );
46 protected:
47 // WeakComponentImplHelperBase
48 virtual void disposing( std::unique_lock<std::mutex>& rGuard ) override;
50 // XEventListener
51 virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
53 // state of a feature
54 virtual FeatureState getState( const OUString& rCommand ) override;
56 // execute a feature
57 virtual void execute( const OUString& rCommand, const css::uno::Sequence< css::beans::PropertyValue>& rArgs ) override;
59 // all the features which should be handled by this class
60 virtual void describeSupportedFeatures() override;
62 private:
63 void setInsertObj(SdrObjKind eObj);
64 rtl::Reference<SdrObject> createDefaultObject( const ChartCommandID nID );
66 bool parseCommandURL( const OUString& rCommandURL, ChartCommandID* pnFeatureId, OUString* pBaseCommand, OUString* pCustomShapeType );
68 ChartController* m_pChartController;
69 OUString m_aCustomShapeType;
72 } // namespace chart
74 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */