2007-05-22 12:21:21 -05:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 15:16:27 -05:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2007-05-22 12:21:21 -05:00
|
|
|
*
|
2008-04-10 15:16:27 -05:00
|
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
2007-05-22 12:21:21 -05:00
|
|
|
*
|
2008-04-10 15:16:27 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2007-05-22 12:21:21 -05:00
|
|
|
*
|
2008-04-10 15:16:27 -05:00
|
|
|
* $RCSfile: ReferenceSizeProvider.hxx,v $
|
2008-10-01 02:35:04 -05:00
|
|
|
* $Revision: 1.3.44.1 $
|
2007-05-22 12:21:21 -05:00
|
|
|
*
|
2008-04-10 15:16:27 -05:00
|
|
|
* This file is part of OpenOffice.org.
|
2007-05-22 12:21:21 -05:00
|
|
|
*
|
2008-04-10 15:16:27 -05:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2007-05-22 12:21:21 -05:00
|
|
|
*
|
2008-04-10 15:16:27 -05:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2007-05-22 12:21:21 -05:00
|
|
|
*
|
2008-04-10 15:16:27 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2007-05-22 12:21:21 -05:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
#ifndef CHART2_REFERENCESIZEPROVIDER_HXX
|
|
|
|
#define CHART2_REFERENCESIZEPROVIDER_HXX
|
|
|
|
|
|
|
|
#include <com/sun/star/uno/Reference.hxx>
|
|
|
|
#include <com/sun/star/chart2/XChartDocument.hpp>
|
|
|
|
#include <com/sun/star/awt/Size.hpp>
|
2008-12-30 07:32:01 -06:00
|
|
|
#include "charttoolsdllapi.hxx"
|
2007-05-22 12:21:21 -05:00
|
|
|
|
|
|
|
namespace com { namespace sun { namespace star {
|
|
|
|
namespace chart2 {
|
|
|
|
class XTitle;
|
|
|
|
class XTitled;
|
|
|
|
}
|
|
|
|
}}}
|
|
|
|
|
|
|
|
// ----------------------------------------
|
|
|
|
namespace chart
|
|
|
|
{
|
|
|
|
|
2008-12-30 07:32:01 -06:00
|
|
|
class OOO_DLLPUBLIC_CHARTTOOLS ReferenceSizeProvider
|
2007-05-22 12:21:21 -05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
enum AutoResizeState
|
|
|
|
{
|
|
|
|
AUTO_RESIZE_YES,
|
|
|
|
AUTO_RESIZE_NO,
|
|
|
|
AUTO_RESIZE_AMBIGUOUS,
|
|
|
|
AUTO_RESIZE_UNKNOWN
|
|
|
|
};
|
|
|
|
|
|
|
|
ReferenceSizeProvider(
|
|
|
|
::com::sun::star::awt::Size aPageSize,
|
|
|
|
const ::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::chart2::XChartDocument > & xChartDoc );
|
|
|
|
|
|
|
|
::com::sun::star::awt::Size getPageSize() const;
|
|
|
|
|
|
|
|
/** Retrieves the state auto-resize from all objects that support this
|
|
|
|
feature. If all objects return the same state, AUTO_RESIZE_YES or
|
|
|
|
AUTO_RESIZE_NO is returned.
|
|
|
|
|
|
|
|
If no object supporting the feature is found, AUTO_RESIZE_UNKNOWN is
|
|
|
|
returned. If there are multiple objects, some with state YES and some
|
|
|
|
with state NO, AUTO_RESIZE_AMBIGUOUS is returned.
|
|
|
|
*/
|
|
|
|
static AutoResizeState getAutoResizeState(
|
|
|
|
const ::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::chart2::XChartDocument > & xChartDoc );
|
|
|
|
|
|
|
|
/** sets or resets the auto-resize at all objects that support this feature
|
|
|
|
for text to the opposite of the current setting. If the current state
|
|
|
|
is ambiguous, it is turned on. If the current state is unknown it stays
|
|
|
|
unknown.
|
|
|
|
*/
|
|
|
|
void toggleAutoResizeState();
|
|
|
|
|
|
|
|
|
|
|
|
/** Sets the ReferencePageSize according to the internal settings of this
|
|
|
|
class at the XPropertySet, and the adapted font sizes if bAdaptFontSizes
|
2008-10-01 02:35:04 -05:00
|
|
|
is </TRUE>.
|
2007-05-22 12:21:21 -05:00
|
|
|
*/
|
2009-06-04 04:41:18 -05:00
|
|
|
SAL_DLLPRIVATE void setValuesAtPropertySet(
|
2007-05-22 12:21:21 -05:00
|
|
|
const ::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::beans::XPropertySet > & xProp,
|
|
|
|
bool bAdaptFontSizes = true );
|
|
|
|
|
|
|
|
/** Sets the ReferencePageSize according to the internal settings of this
|
|
|
|
class at the XTitle, and the adapted font sizes at the contained
|
|
|
|
XFormattedStrings
|
|
|
|
*/
|
2009-06-04 04:41:18 -05:00
|
|
|
SAL_DLLPRIVATE void setValuesAtTitle(
|
2007-05-22 12:21:21 -05:00
|
|
|
const ::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::chart2::XTitle > & xTitle );
|
|
|
|
|
|
|
|
/** Sets the internal value at all data series in the currently set model.
|
|
|
|
This is useful, if you have changed a chart-type and thus probably added
|
2008-10-01 02:35:04 -05:00
|
|
|
some new data series via model functionality.
|
2007-05-22 12:21:21 -05:00
|
|
|
*/
|
|
|
|
void setValuesAtAllDataSeries();
|
|
|
|
|
2009-06-04 04:41:18 -05:00
|
|
|
private:
|
|
|
|
SAL_DLLPRIVATE bool useAutoScale() const;
|
|
|
|
|
|
|
|
/** sets the auto-resize at all objects that support this feature for text.
|
|
|
|
eNewState must be either AUTO_RESIZE_YES or AUTO_RESIZE_NO
|
|
|
|
*/
|
|
|
|
SAL_DLLPRIVATE void setAutoResizeState( AutoResizeState eNewState );
|
|
|
|
|
2007-05-22 12:21:21 -05:00
|
|
|
/** Retrieves the auto-resize state from the given propertyset. The result
|
|
|
|
will be put into eInOutState. If you initialize eInOutState with
|
|
|
|
AUTO_RESIZE_UNKNOWN, you will get the actual state. If you pass any
|
|
|
|
other state, the result will be the accumulated state,
|
|
|
|
esp. AUTO_RESIZE_AMBIGUOUS, if the value was NO before, and is YES for
|
|
|
|
the current property set, or the other way round.
|
|
|
|
*/
|
2009-06-04 04:41:18 -05:00
|
|
|
SAL_DLLPRIVATE static void getAutoResizeFromPropSet(
|
2007-05-22 12:21:21 -05:00
|
|
|
const ::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::beans::XPropertySet > & xProp,
|
|
|
|
AutoResizeState & rInOutState );
|
|
|
|
|
2009-06-04 04:41:18 -05:00
|
|
|
SAL_DLLPRIVATE void impl_setValuesAtTitled(
|
2007-05-22 12:21:21 -05:00
|
|
|
const ::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::chart2::XTitled > & xTitled );
|
2009-06-04 04:41:18 -05:00
|
|
|
SAL_DLLPRIVATE static void impl_getAutoResizeFromTitled(
|
2007-05-22 12:21:21 -05:00
|
|
|
const ::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::chart2::XTitled > & xTitled,
|
|
|
|
AutoResizeState & rInOutState );
|
|
|
|
|
|
|
|
::com::sun::star::awt::Size m_aPageSize;
|
|
|
|
::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::chart2::XChartDocument > m_xChartDoc;
|
|
|
|
bool m_bUseAutoScale;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace chart
|
|
|
|
|
|
|
|
// CHART2_REFERENCESIZEPROVIDER_HXX
|
|
|
|
#endif
|