nss: upgrade to release 3.73
[LibreOffice.git] / chart2 / source / controller / inc / ChartDocumentWrapper.hxx
blob7eeb4646bfc7c7bf7de663f28f2764110fef0ba5
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 <WrappedPropertySet.hxx>
22 #include <com/sun/star/chart/XChartDocument.hpp>
23 #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
24 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
25 #include <com/sun/star/uno/XAggregation.hpp>
26 #include <com/sun/star/lang/XServiceInfo.hpp>
27 #include <cppuhelper/implbase.hxx>
28 #include <unotools/eventlisteneradapter.hxx>
30 #include <memory>
32 namespace com::sun::star::uno { class XComponentContext; }
33 namespace com::sun::star::util { class XRefreshable; }
35 namespace chart::wrapper
38 class Chart2ModelContact;
40 class ChartDocumentWrapper_Base : public ::cppu::ImplInheritanceHelper
41 < WrappedPropertySet
42 , css::chart::XChartDocument
43 , css::drawing::XDrawPageSupplier
44 , css::lang::XMultiServiceFactory
45 , css::lang::XServiceInfo
46 , css::uno::XAggregation
51 class ChartDocumentWrapper : public ChartDocumentWrapper_Base
52 , public ::utl::OEventListenerAdapter
54 public:
55 explicit ChartDocumentWrapper( const css::uno::Reference< css::uno::XComponentContext > & xContext );
56 virtual ~ChartDocumentWrapper() override;
58 /// XServiceInfo declarations
59 virtual OUString SAL_CALL getImplementationName() override;
60 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
61 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
63 void setAddIn( const css::uno::Reference< css::util::XRefreshable >& xAddIn );
64 const css::uno::Reference< css::util::XRefreshable >& getAddIn() const { return m_xAddIn;}
66 void setUpdateAddIn( bool bUpdateAddIn );
67 bool getUpdateAddIn() const { return m_bUpdateAddIn;}
69 void setBaseDiagram( const OUString& rBaseDiagram );
70 const OUString& getBaseDiagram() const { return m_aBaseDiagram;}
72 css::uno::Reference< css::drawing::XShapes > getAdditionalShapes() const;
74 /// @throws css::uno::RuntimeException
75 css::uno::Reference< css::drawing::XDrawPage > impl_getDrawPage() const;
77 protected:
79 // ____ chart::XChartDocument ____
80 virtual css::uno::Reference< css::drawing::XShape > SAL_CALL getTitle() override;
81 virtual css::uno::Reference< css::drawing::XShape > SAL_CALL getSubTitle() override;
82 virtual css::uno::Reference< css::drawing::XShape > SAL_CALL getLegend() override;
83 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getArea() override;
84 virtual css::uno::Reference< css::chart::XDiagram > SAL_CALL getDiagram() override;
85 virtual void SAL_CALL setDiagram( const css::uno::Reference<
86 css::chart::XDiagram >& xDiagram ) override;
87 virtual css::uno::Reference< css::chart::XChartData > SAL_CALL getData() override;
88 virtual void SAL_CALL attachData( const css::uno::Reference<
89 css::chart::XChartData >& xData ) override;
91 // ____ XModel ____
92 virtual sal_Bool SAL_CALL attachResource( const OUString& URL,
93 const css::uno::Sequence< css::beans::PropertyValue >& Arguments ) override;
94 virtual OUString SAL_CALL getURL() override;
95 virtual css::uno::Sequence<
96 css::beans::PropertyValue > SAL_CALL getArgs() override;
97 virtual void SAL_CALL connectController( const css::uno::Reference<
98 css::frame::XController >& Controller ) override;
99 virtual void SAL_CALL disconnectController( const css::uno::Reference<
100 css::frame::XController >& Controller ) override;
101 virtual void SAL_CALL lockControllers() override;
102 virtual void SAL_CALL unlockControllers() override;
103 virtual sal_Bool SAL_CALL hasControllersLocked() override;
104 virtual css::uno::Reference<
105 css::frame::XController > SAL_CALL getCurrentController() override;
106 virtual void SAL_CALL setCurrentController( const css::uno::Reference< css::frame::XController >& Controller ) override;
107 virtual css::uno::Reference<css::uno::XInterface > SAL_CALL getCurrentSelection() override;
109 // ____ XComponent ____
110 virtual void SAL_CALL dispose() override;
111 virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override;
112 virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override;
114 // ____ XInterface (for new interfaces) ____
115 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
117 // ____ ::utl::OEventListenerAdapter ____
118 virtual void _disposing( const css::lang::EventObject& rSource ) override;
120 // ____ XDrawPageSupplier ____
121 virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL getDrawPage() override;
123 // ____ XMultiServiceFactory ____
124 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( const OUString& aServiceSpecifier ) override;
125 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments(
126 const OUString& ServiceSpecifier,
127 const css::uno::Sequence< css::uno::Any >& Arguments ) override;
128 virtual css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames() override;
130 // ____ XAggregation ____
131 virtual void SAL_CALL setDelegator(
132 const css::uno::Reference< css::uno::XInterface >& rDelegator ) override;
133 virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type& aType ) override;
135 // ____ WrappedPropertySet ____
136 virtual const css::uno::Sequence< css::beans::Property >& getPropertySequence() override;
137 virtual std::vector< std::unique_ptr<WrappedProperty> > createWrappedProperties() override;
138 virtual css::uno::Reference< css::beans::XPropertySet > getInnerPropertySet() override;
140 private: //methods
141 void impl_resetAddIn();
143 private: //member
144 std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
146 css::uno::Reference< css::uno::XInterface > m_xDelegator;
148 css::uno::Reference< css::drawing::XShape > m_xTitle;
149 css::uno::Reference< css::drawing::XShape > m_xSubTitle;
150 css::uno::Reference< css::drawing::XShape > m_xLegend;
151 css::uno::Reference< css::chart::XChartData > m_xChartData;
152 css::uno::Reference< css::chart::XDiagram > m_xDiagram;
153 css::uno::Reference< css::beans::XPropertySet > m_xArea;
155 css::uno::Reference< css::util::XRefreshable > m_xAddIn;
156 OUString m_aBaseDiagram;
157 bool m_bUpdateAddIn;
159 css::uno::Reference< css::uno::XInterface > m_xChartView;
160 css::uno::Reference< css::lang::XMultiServiceFactory>
161 m_xShapeFactory;
163 bool m_bIsDisposed;
166 } // namespace chart::wrapper
168 // CHART_CHARTDOCUMENT_HXX
170 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */