tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / chart2 / source / view / inc / VDiagram.hxx
blob04f1a288317faf03df12b9df5291e17233cc64df
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 <basegfx/range/b2irectangle.hxx>
22 #include <com/sun/star/drawing/Direction3D.hpp>
23 #include <com/sun/star/awt/Size.hpp>
24 #include <com/sun/star/awt/Point.hpp>
25 #include <svx/unoshape.hxx>
26 #include <rtl/ref.hxx>
28 namespace com::sun::star::beans { class XPropertySet; }
29 namespace com::sun::star::chart2 { class XDiagram; }
30 namespace com::sun::star::lang { class XMultiServiceFactory; }
31 namespace com::sun::star::drawing { class XShape; }
34 namespace chart
36 class Diagram;
37 class ShapeFactory;
39 /** The VDiagram is responsible to generate the visible parts of the Diagram
40 that is wall, floor, axes and data series.
41 The axes and data series are subobjects which are created and managed by the
42 diagram.
45 class VDiagram final
47 public: //methods
48 VDiagram( const rtl::Reference<::chart::Diagram>& xDiagram,
49 const css::drawing::Direction3D& rPreferredAspectRatio,
50 sal_Int32 nDimension );
51 ~VDiagram();
53 void init(
54 const rtl::Reference<SvxShapeGroupAnyD>& xTarget );
56 void createShapes( const css::awt::Point& rPos
57 , const css::awt::Size& rSize );
59 const rtl::Reference<SvxShapeGroupAnyD> &
60 getCoordinateRegion() const { return m_xCoordinateRegionShape; }
62 /**
63 * Get current bounding rectangle for the diagram without axes.
65 basegfx::B2IRectangle getCurrentRectangle() const;
67 void reduceToMinimumSize();
69 ::basegfx::B2IRectangle adjustPosAndSize( const css::awt::Point& rPos
70 , const css::awt::Size& rAvailableSize );
72 ::basegfx::B2IRectangle adjustInnerSize( const ::basegfx::B2IRectangle& rConsumedOuterRect );
74 private: //methods
75 void createShapes_2d();
76 void createShapes_3d();
78 ::basegfx::B2IRectangle adjustPosAndSize_2d( const css::awt::Point& rPos
79 , const css::awt::Size& rAvailableSize );
80 ::basegfx::B2IRectangle adjustPosAndSize_3d( const css::awt::Point& rPos
81 , const css::awt::Size& rAvailableSize );
83 void adjustAspectRatio3d( const css::awt::Size& rAvailableSize );
85 private: //members
86 VDiagram(const VDiagram& rD) = delete;
88 rtl::Reference<SvxShapeGroupAnyD> m_xTarget;
90 // this is the surrounding shape which contains floor, wall and coordinate
91 rtl::Reference<SvxShapeGroupAnyD> m_xOuterGroupShape;
92 // this is an additional inner shape that represents the coordinate region - that is - where to place data points
93 rtl::Reference<SvxShapeGroupAnyD> m_xCoordinateRegionShape;
94 rtl::Reference<SvxShapeRect> m_xWall2D;
96 sal_Int32 m_nDimensionCount;
97 rtl::Reference< ::chart::Diagram > m_xDiagram;
99 css::drawing::Direction3D m_aPreferredAspectRatio;
100 rtl::Reference< Svx3DSceneObject > m_xAspectRatio3D;
102 double m_fXAnglePi;
103 double m_fYAnglePi;
104 double m_fZAnglePi;
106 css::awt::Point m_aAvailablePosIncludingAxes;
107 css::awt::Size m_aAvailableSizeIncludingAxes;
109 css::awt::Point m_aCurrentPosWithoutAxes;
110 css::awt::Size m_aCurrentSizeWithoutAxes;
112 bool m_bRightAngledAxes;
115 } //namespace chart
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */