1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: VLegend.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
33 #include <com/sun/star/chart2/XLegend.hpp>
34 #include <com/sun/star/drawing/XShapes.hpp>
35 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
36 #include <com/sun/star/uno/XComponentContext.hpp>
37 #include <com/sun/star/awt/Rectangle.hpp>
38 #include <com/sun/star/frame/XModel.hpp>
42 //.............................................................................
45 //.............................................................................
47 class LegendEntryProvider
;
49 //-----------------------------------------------------------------------------
56 VLegend( const ::com::sun::star::uno::Reference
<
57 ::com::sun::star::chart2::XLegend
> & xLegend
,
58 const ::com::sun::star::uno::Reference
<
59 ::com::sun::star::uno::XComponentContext
> & xContext
,
60 const std::vector
< LegendEntryProvider
* >& rLegendEntryProviderList
);
62 void SAL_CALL
init( const ::com::sun::star::uno::Reference
<
63 ::com::sun::star::drawing::XShapes
>& xTargetPage
,
64 const ::com::sun::star::uno::Reference
<
65 ::com::sun::star::lang::XMultiServiceFactory
>& xFactory
,
66 const ::com::sun::star::uno::Reference
<
67 ::com::sun::star::frame::XModel
> & xModel
);
69 void setDefaultWritingMode( sal_Int16 nDefaultWritingMode
);
71 void createShapes( const ::com::sun::star::awt::Size
& rAvailableSpace
,
72 const ::com::sun::star::awt::Size
& rPageSize
);
74 /** Sets the position according to its internal anchor.
76 @param rOutAvailableSpace
77 is modified by the method, if the legend is in a standard position,
78 such that the space allocated by the legend is removed from it.
81 is used to calculate the offset (default 2%) from the edge.
84 ::com::sun::star::awt::Rectangle
& rOutAvailableSpace
,
85 const ::com::sun::star::awt::Size
& rReferenceSize
);
87 static bool isVisible(
88 const ::com::sun::star::uno::Reference
<
89 ::com::sun::star::chart2::XLegend
> & xLegend
);
92 ::com::sun::star::uno::Reference
<
93 ::com::sun::star::drawing::XShapes
> m_xTarget
;
94 ::com::sun::star::uno::Reference
<
95 ::com::sun::star::lang::XMultiServiceFactory
> m_xShapeFactory
;
96 ::com::sun::star::uno::Reference
<
97 ::com::sun::star::chart2::XLegend
> m_xLegend
;
98 ::com::sun::star::uno::Reference
<
99 ::com::sun::star::drawing::XShape
> m_xShape
;
100 ::com::sun::star::uno::Reference
<
101 ::com::sun::star::frame::XModel
> m_xModel
;
102 ::com::sun::star::uno::Reference
<
103 ::com::sun::star::uno::XComponentContext
> m_xContext
;
105 std::vector
< LegendEntryProvider
* > m_aLegendEntryProviderList
;
107 sal_Int16 m_nDefaultWritingMode
;//to be used when writing mode is set to page
110 //.............................................................................
112 //.............................................................................