Debian Codegraph @

chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx

raw
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 <WrappedPropertySet.hxx>
22
23 #include <comphelper/interfacecontainer4.hxx>
24 #include <com/sun/star/chart/XDiagramPositioning.hpp>
25 #include <com/sun/star/chart2/XDiagramProvider.hpp>
26 #include <com/sun/star/chart/XDiagram.hpp>
27 #include <com/sun/star/chart/XAxisSupplier.hpp>
28 #include <com/sun/star/chart/XAxisZSupplier.hpp>
29 #include <com/sun/star/chart/XTwoAxisXSupplier.hpp>
30 #include <com/sun/star/chart/XTwoAxisYSupplier.hpp>
31 #include <com/sun/star/chart/XStatisticDisplay.hpp>
32 #include <com/sun/star/chart/X3DDisplay.hpp>
33 #include <com/sun/star/lang/XServiceInfo.hpp>
34 #include <com/sun/star/lang/XComponent.hpp>
35 #include <com/sun/star/chart/XSecondAxisTitleSupplier.hpp>
36 #include <com/sun/star/chart/X3DDefaultSetter.hpp>
37 #include <rtl/ref.hxx>
38 #include <memory>
39
40 namespace com::sun::star::lang { class XEventListener; }
41 namespace chart { class Diagram; }
42
43 namespace chart::wrapper
44 {
45 class AxisWrapper;
46 class WallFloorWrapper;
47 class MinMaxLineWrapper;
48 class UpDownBarWrapper;
49 class Chart2ModelContact;
50
51 class DiagramWrapper : public cppu::ImplInheritanceHelper<
52 WrappedPropertySet
53 , css::chart::XDiagram
54 , css::chart::XAxisSupplier
55 , css::chart::XAxisZSupplier
56 , css::chart::XTwoAxisXSupplier // : XAxisXSupplier
57 , css::chart::XTwoAxisYSupplier // : XAxisYSupplier
58 , css::chart::XStatisticDisplay
59 , css::chart::X3DDisplay
60 , css::chart::X3DDefaultSetter
61 , css::lang::XServiceInfo
62 , css::lang::XComponent
63 , css::chart::XDiagramPositioning
64 , css::chart2::XDiagramProvider
65 , css::chart::XSecondAxisTitleSupplier
66 >
67 {
68 public:
69 explicit DiagramWrapper(std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
70 virtual ~DiagramWrapper() override;
71
72 /// XServiceInfo declarations
73 virtual OUString SAL_CALL getImplementationName() override;
74 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
75 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
76
77 // ____ XComponent ____
78 virtual void SAL_CALL dispose() override;
79 virtual void SAL_CALL addEventListener( const css::uno::Reference<
80 css::lang::XEventListener >& xListener ) override;
81 virtual void SAL_CALL removeEventListener( const css::uno::Reference<
82 css::lang::XEventListener >& aListener ) override;
83
84 // ____ XDiagram ____
85 virtual OUString SAL_CALL getDiagramType() override;
86 virtual css::uno::Reference<
87 css::beans::XPropertySet > SAL_CALL getDataRowProperties( sal_Int32 nRow ) override;
88 virtual css::uno::Reference<
89 css::beans::XPropertySet > SAL_CALL getDataPointProperties( sal_Int32 nCol, sal_Int32 nRow ) override;
90
91 // ____ XShape (base of XDiagram) ____
92 virtual css::awt::Point SAL_CALL getPosition() override;
93 virtual void SAL_CALL setPosition( const css::awt::Point& aPosition ) override;
94 virtual css::awt::Size SAL_CALL getSize() override;
95 virtual void SAL_CALL setSize( const css::awt::Size& aSize ) override;
96
97 // ____ XShapeDescriptor (base of XShape) ____
98 virtual OUString SAL_CALL getShapeType() override;
99
100 // ____ XAxisSupplier ____
101 virtual css::uno::Reference<
102 css::chart::XAxis > SAL_CALL getAxis( sal_Int32 nDimensionIndex ) override;
103 virtual css::uno::Reference<
104 css::chart::XAxis > SAL_CALL getSecondaryAxis( sal_Int32 nDimensionIndex ) override;
105
106 // ____ XAxisZSupplier ____
107 virtual css::uno::Reference<
108 css::drawing::XShape > SAL_CALL getZAxisTitle() override;
109 virtual css::uno::Reference<
110 css::beans::XPropertySet > SAL_CALL getZMainGrid() override;
111 virtual css::uno::Reference<
112 css::beans::XPropertySet > SAL_CALL getZHelpGrid() override;
113 virtual css::uno::Reference<
114 css::beans::XPropertySet > SAL_CALL getZAxis() override;
115
116 // ____ XTwoAxisXSupplier ____
117 virtual css::uno::Reference<
118 css::beans::XPropertySet > SAL_CALL getSecondaryXAxis() override;
119
120 // ____ XAxisXSupplier (base of XTwoAxisXSupplier) ____
121 virtual css::uno::Reference<
122 css::drawing::XShape > SAL_CALL getXAxisTitle() override;
123 virtual css::uno::Reference<
124 css::beans::XPropertySet > SAL_CALL getXAxis() override;
125 virtual css::uno::Reference<
126 css::beans::XPropertySet > SAL_CALL getXMainGrid() override;
127 virtual css::uno::Reference<
128 css::beans::XPropertySet > SAL_CALL getXHelpGrid() override;
129
130 // ____ XTwoAxisYSupplier ____
131 virtual css::uno::Reference<
132 css::beans::XPropertySet > SAL_CALL getSecondaryYAxis() override;
133
134 // ____ XAxisYSupplier (base of XTwoAxisYSupplier) ____
135 virtual css::uno::Reference<
136 css::drawing::XShape > SAL_CALL getYAxisTitle() override;
137 virtual css::uno::Reference<
138 css::beans::XPropertySet > SAL_CALL getYAxis() override;
139 virtual css::uno::Reference<
140 css::beans::XPropertySet > SAL_CALL getYHelpGrid() override;
141 virtual css::uno::Reference<
142 css::beans::XPropertySet > SAL_CALL getYMainGrid() override;
143
144 // ____ XSecondAxisTitleSupplier ____
145 virtual css::uno::Reference<
146 css::drawing::XShape > SAL_CALL getSecondXAxisTitle() override;
147 virtual css::uno::Reference<
148 css::drawing::XShape > SAL_CALL getSecondYAxisTitle() override;
149
150 // ____ XStatisticDisplay ____
151 virtual css::uno::Reference<
152 css::beans::XPropertySet > SAL_CALL getUpBar() override;
153 virtual css::uno::Reference<
154 css::beans::XPropertySet > SAL_CALL getDownBar() override;
155 virtual css::uno::Reference<
156 css::beans::XPropertySet > SAL_CALL getMinMaxLine() override;
157
158 // ____ X3DDisplay ____
159 virtual css::uno::Reference<
160 css::beans::XPropertySet > SAL_CALL getWall() override;
161 virtual css::uno::Reference<
162 css::beans::XPropertySet > SAL_CALL getFloor() override;
163
164 // ____ X3DDefaultSetter ____
165 virtual void SAL_CALL set3DSettingsToDefault() override;
166 virtual void SAL_CALL setDefaultRotation() override;
167 virtual void SAL_CALL setDefaultIllumination() override;
168
169 // ____ XDiagramPositioning ____
170 virtual void SAL_CALL setAutomaticDiagramPositioning( ) override;
171 virtual sal_Bool SAL_CALL isAutomaticDiagramPositioning( ) override;
172 virtual void SAL_CALL setDiagramPositionExcludingAxes( const css::awt::Rectangle& PositionRect ) override;
173 virtual sal_Bool SAL_CALL isExcludingDiagramPositioning( ) override;
174 virtual css::awt::Rectangle SAL_CALL calculateDiagramPositionExcludingAxes( ) override;
175 virtual void SAL_CALL setDiagramPositionIncludingAxes( const css::awt::Rectangle& PositionRect ) override;
176 virtual css::awt::Rectangle SAL_CALL calculateDiagramPositionIncludingAxes( ) override;
177 virtual void SAL_CALL setDiagramPositionIncludingAxesAndAxisTitles( const css::awt::Rectangle& PositionRect ) override;
178 virtual css::awt::Rectangle SAL_CALL calculateDiagramPositionIncludingAxesAndAxisTitles( ) override;
179
180 // ____ XDiagramProvider ____
181 virtual css::uno::Reference< css::chart2::XDiagram > SAL_CALL getDiagram() override;
182 virtual void SAL_CALL setDiagram( const css::uno::Reference< css::chart2::XDiagram >& xDiagram ) override;
183
184 rtl::Reference< ::chart::Diagram > getUnderlyingDiagram();
185
186 protected:
187 // ____ WrappedPropertySet ____
188 virtual const css::uno::Sequence< css::beans::Property >& getPropertySequence() override;
189 virtual std::vector< std::unique_ptr<WrappedProperty> > createWrappedProperties() override;
190 virtual css::uno::Reference< css::beans::XPropertySet > getInnerPropertySet() override;
191
192 private:
193 std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
194 ::comphelper::OInterfaceContainerHelper4<css::lang::XEventListener> m_aEventListenerContainer;
195
196 rtl::Reference< AxisWrapper > m_xXAxis;
197 rtl::Reference< AxisWrapper > m_xYAxis;
198 rtl::Reference< AxisWrapper > m_xZAxis;
199 rtl::Reference< AxisWrapper > m_xSecondXAxis;
200 rtl::Reference< AxisWrapper > m_xSecondYAxis;
201 rtl::Reference< WallFloorWrapper > m_xWall;
202 rtl::Reference< WallFloorWrapper > m_xFloor;
203 rtl::Reference< MinMaxLineWrapper > m_xMinMaxLineWrapper;
204 rtl::Reference< UpDownBarWrapper > m_xUpBarWrapper;
205 rtl::Reference< UpDownBarWrapper > m_xDownBarWrapper;
206 };
207
208 } // namespace chart::wrapper
209
210 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */