LibreOffice Module chart2 (master) 1
AxisWrapper.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
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
31#include <memory>
32
33namespace com::sun::star::chart2 { class XAxis; }
34
35namespace chart::wrapper
36{
37class Chart2ModelContact;
38
39class AxisWrapper : public ::cppu::ImplInheritanceHelper<
40 WrappedPropertySet
41 , css::chart::XAxis
42 , css::drawing::XShape
43 , css::lang::XComponent
44 , css::lang::XServiceInfo
45 , css::util::XNumberFormatsSupplier
46 >
48{
49public:
51 {
57 };
58
59 AxisWrapper(tAxisType eType, std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
60 virtual ~AxisWrapper() override;
61
62 static void getDimensionAndMainAxisBool( tAxisType eType, sal_Int32& rnDimensionIndex, bool& rbMainAxis );
63
65 virtual OUString SAL_CALL getImplementationName() override;
66 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
67 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
68
69 //ReferenceSizePropertyProvider
70 virtual void updateReferenceSize() override;
71 virtual css::uno::Any getReferenceSize() override;
72 virtual css::awt::Size getCurrentSizeForReference() override;
73
74 // ____ XComponent ____
75 virtual void SAL_CALL dispose() override;
76 virtual void SAL_CALL addEventListener( const css::uno::Reference<
77 css::lang::XEventListener >& xListener ) override;
78 virtual void SAL_CALL removeEventListener( const css::uno::Reference<
79 css::lang::XEventListener >& aListener ) override;
80
81 // ____ chart::XAxis ____
82 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getAxisTitle( ) override;
83 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getMajorGrid( ) override;
84 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getMinorGrid( ) override;
85
86 // ____ XShape ____
87 virtual css::awt::Point SAL_CALL getPosition() override;
88 virtual void SAL_CALL setPosition( const css::awt::Point& aPosition ) override;
89 virtual css::awt::Size SAL_CALL getSize() override;
90 virtual void SAL_CALL setSize( const css::awt::Size& aSize ) override;
91
92 // ____ XShapeDescriptor (base of XShape) ____
93 virtual OUString SAL_CALL getShapeType() override;
94
95 // ____ XNumberFormatsSupplier ____
96 virtual css::uno::Reference<
97 css::beans::XPropertySet > SAL_CALL getNumberFormatSettings() override;
98 virtual css::uno::Reference<
99 css::util::XNumberFormats > SAL_CALL getNumberFormats() override;
100
101protected:
102 // ____ WrappedPropertySet ____
103 virtual const css::uno::Sequence< css::beans::Property >& getPropertySequence() override;
104 virtual std::vector< std::unique_ptr<WrappedProperty> > createWrappedProperties() override;
105 virtual css::uno::Reference< css::beans::XPropertySet > getInnerPropertySet() override;
106
107private: //methods
108 css::uno::Reference< css::chart2::XAxis > getAxis();
109
110private: //member
111 std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
113
115
116 css::uno::Reference< css::beans::XPropertySet > m_xAxisTitle;
117 css::uno::Reference< css::beans::XPropertySet > m_xMajorGrid;
118 css::uno::Reference< css::beans::XPropertySet > m_xMinorGrid;
119};
120
121} // namespace chart::wrapper
122
123/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL setSize(const css::awt::Size &aSize) override
virtual void updateReferenceSize() override
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getMajorGrid() override
css::uno::Reference< css::beans::XPropertySet > m_xMinorGrid
static void getDimensionAndMainAxisBool(tAxisType eType, sal_Int32 &rnDimensionIndex, bool &rbMainAxis)
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
css::uno::Reference< css::beans::XPropertySet > m_xAxisTitle
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getNumberFormatSettings() override
virtual css::awt::Point SAL_CALL getPosition() override
virtual void SAL_CALL dispose() override
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getMinorGrid() override
virtual css::awt::Size getCurrentSizeForReference() override
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getAxisTitle() override
virtual css::uno::Any getReferenceSize() override
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact
::comphelper::OInterfaceContainerHelper4< css::lang::XEventListener > m_aEventListenerContainer
AxisWrapper(tAxisType eType, std::shared_ptr< Chart2ModelContact > spChart2ModelContact)
virtual void SAL_CALL setPosition(const css::awt::Point &aPosition) override
css::uno::Reference< css::beans::XPropertySet > m_xMajorGrid
css::uno::Reference< css::chart2::XAxis > getAxis()
virtual ~AxisWrapper() override
virtual OUString SAL_CALL getShapeType() override
virtual const css::uno::Sequence< css::beans::Property > & getPropertySequence() override
virtual css::uno::Reference< css::beans::XPropertySet > getInnerPropertySet() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual std::vector< std::unique_ptr< WrappedProperty > > createWrappedProperties() override
virtual css::awt::Size SAL_CALL getSize() override
virtual css::uno::Reference< css::util::XNumberFormats > SAL_CALL getNumberFormats() override
virtual OUString SAL_CALL getImplementationName() override
XServiceInfo declarations.
unsigned char sal_Bool