tdf#130857 qt weld: Implement QtInstanceWidget::get_text_height
[LibreOffice.git] / chart2 / source / controller / chartapiwrapper / AxisWrapper.hxx
blob3b63c45c100d3f9bda128d33678fa5c2d4380f9c
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 "ReferenceSizePropertyProvider.hxx"
23 #include <cppuhelper/implbase.hxx>
24 #include <comphelper/interfacecontainer4.hxx>
25 #include <com/sun/star/chart/XAxis.hpp>
26 #include <com/sun/star/drawing/XShape.hpp>
27 #include <com/sun/star/lang/XComponent.hpp>
28 #include <com/sun/star/lang/XServiceInfo.hpp>
29 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
30 #include <rtl/ref.hxx>
31 #include <memory>
33 namespace com::sun::star::chart2 { class XAxis; }
35 namespace chart::wrapper
37 class Chart2ModelContact;
38 class TitleWrapper;
39 class GridWrapper;
41 class AxisWrapper : public ::cppu::ImplInheritanceHelper<
42 WrappedPropertySet
43 , css::chart::XAxis
44 , css::drawing::XShape
45 , css::lang::XComponent
46 , css::lang::XServiceInfo
47 , css::util::XNumberFormatsSupplier
49 , public ReferenceSizePropertyProvider
51 public:
52 enum tAxisType
54 X_AXIS,
55 Y_AXIS,
56 Z_AXIS,
57 SECOND_X_AXIS,
58 SECOND_Y_AXIS
61 AxisWrapper(tAxisType eType, std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
62 virtual ~AxisWrapper() override;
64 static void getDimensionAndMainAxisBool( tAxisType eType, sal_Int32& rnDimensionIndex, bool& rbMainAxis );
66 /// XServiceInfo declarations
67 virtual OUString SAL_CALL getImplementationName() override;
68 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
69 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
71 //ReferenceSizePropertyProvider
72 virtual void updateReferenceSize() override;
73 virtual css::uno::Any getReferenceSize() override;
74 virtual css::awt::Size getCurrentSizeForReference() override;
76 // ____ XComponent ____
77 virtual void SAL_CALL dispose() override;
78 virtual void SAL_CALL addEventListener( const css::uno::Reference<
79 css::lang::XEventListener >& xListener ) override;
80 virtual void SAL_CALL removeEventListener( const css::uno::Reference<
81 css::lang::XEventListener >& aListener ) override;
83 // ____ chart::XAxis ____
84 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getAxisTitle( ) override;
85 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getMajorGrid( ) override;
86 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getMinorGrid( ) override;
88 // ____ XShape ____
89 virtual css::awt::Point SAL_CALL getPosition() override;
90 virtual void SAL_CALL setPosition( const css::awt::Point& aPosition ) override;
91 virtual css::awt::Size SAL_CALL getSize() override;
92 virtual void SAL_CALL setSize( const css::awt::Size& aSize ) override;
94 // ____ XShapeDescriptor (base of XShape) ____
95 virtual OUString SAL_CALL getShapeType() override;
97 // ____ XNumberFormatsSupplier ____
98 virtual css::uno::Reference<
99 css::beans::XPropertySet > SAL_CALL getNumberFormatSettings() override;
100 virtual css::uno::Reference<
101 css::util::XNumberFormats > SAL_CALL getNumberFormats() override;
103 protected:
104 // ____ WrappedPropertySet ____
105 virtual const css::uno::Sequence< css::beans::Property >& getPropertySequence() override;
106 virtual std::vector< std::unique_ptr<WrappedProperty> > createWrappedProperties() override;
107 virtual css::uno::Reference< css::beans::XPropertySet > getInnerPropertySet() override;
109 private: //methods
110 css::uno::Reference< css::chart2::XAxis > getAxis();
112 private: //member
113 std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
114 ::comphelper::OInterfaceContainerHelper4<css::lang::XEventListener> m_aEventListenerContainer;
116 tAxisType m_eType;
118 rtl::Reference< TitleWrapper > m_xAxisTitle;
119 rtl::Reference< GridWrapper > m_xMajorGrid;
120 rtl::Reference< GridWrapper > m_xMinorGrid;
123 } // namespace chart::wrapper
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */