LibreOffice Module chart2 (master) 1
|
#include <ReferenceSizeProvider.hxx>
Public Types | |
enum | AutoResizeState { AUTO_RESIZE_YES , AUTO_RESIZE_NO , AUTO_RESIZE_AMBIGUOUS , AUTO_RESIZE_UNKNOWN } |
Public Member Functions | |
ReferenceSizeProvider (css::awt::Size aPageSize, const rtl::Reference<::chart::ChartModel > &xChartDoc) | |
const css::awt::Size & | getPageSize () const |
void | toggleAutoResizeState () |
sets or resets the auto-resize at all objects that support this feature for text to the opposite of the current setting. More... | |
SAL_DLLPRIVATE void | setValuesAtPropertySet (const css::uno::Reference< css::beans::XPropertySet > &xProp, bool bAdaptFontSizes=true) |
Sets the ReferencePageSize according to the internal settings of this class at the XPropertySet, and the adapted font sizes if bAdaptFontSizes is </sal_True>. More... | |
SAL_DLLPRIVATE void | setValuesAtTitle (const css::uno::Reference< css::chart2::XTitle > &xTitle) |
Sets the ReferencePageSize according to the internal settings of this class at the XTitle, and the adapted font sizes at the contained XFormattedStrings. More... | |
void | setValuesAtAllDataSeries () |
Sets the internal value at all data series in the currently set model. More... | |
Static Public Member Functions | |
static AutoResizeState | getAutoResizeState (const rtl::Reference<::chart::ChartModel > &xChartDoc) |
Retrieves the state auto-resize from all objects that support this feature. More... | |
Private Member Functions | |
SAL_DLLPRIVATE bool | useAutoScale () const |
SAL_DLLPRIVATE void | setAutoResizeState (AutoResizeState eNewState) |
sets the auto-resize at all objects that support this feature for text. More... | |
SAL_DLLPRIVATE void | impl_setValuesAtTitled (const css::uno::Reference< css::chart2::XTitled > &xTitled) |
Static Private Member Functions | |
static SAL_DLLPRIVATE void | getAutoResizeFromPropSet (const css::uno::Reference< css::beans::XPropertySet > &xProp, AutoResizeState &rInOutState) |
Retrieves the auto-resize state from the given propertyset. More... | |
static SAL_DLLPRIVATE void | impl_getAutoResizeFromTitled (const css::uno::Reference< css::chart2::XTitled > &xTitled, AutoResizeState &rInOutState) |
Private Attributes | |
css::awt::Size | m_aPageSize |
rtl::Reference<::chart::ChartModel > | m_xChartDoc |
bool | m_bUseAutoScale |
Definition at line 41 of file ReferenceSizeProvider.hxx.
Enumerator | |
---|---|
AUTO_RESIZE_YES | |
AUTO_RESIZE_NO | |
AUTO_RESIZE_AMBIGUOUS | |
AUTO_RESIZE_UNKNOWN |
Definition at line 45 of file ReferenceSizeProvider.hxx.
chart::ReferenceSizeProvider::ReferenceSizeProvider | ( | css::awt::Size | aPageSize, |
const rtl::Reference<::chart::ChartModel > & | xChartDoc | ||
) |
Definition at line 45 of file ReferenceSizeProvider.cxx.
|
staticprivate |
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.
Definition at line 167 of file ReferenceSizeProvider.cxx.
References AUTO_RESIZE_AMBIGUOUS, AUTO_RESIZE_NO, AUTO_RESIZE_UNKNOWN, and AUTO_RESIZE_YES.
Referenced by getAutoResizeState(), and impl_getAutoResizeFromTitled().
|
static |
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.
Definition at line 221 of file ReferenceSizeProvider.cxx.
References AUTO_RESIZE_AMBIGUOUS, AUTO_RESIZE_UNKNOWN, DBG_UNHANDLED_EXCEPTION, chart::AxisHelper::getAllAxesOfDiagram(), getAutoResizeFromPropSet(), idx, impl_getAutoResizeFromTitled(), and chart::DataSeriesProperties::PROP_DATASERIES_ATTRIBUTED_DATA_POINTS.
Referenced by setAutoResizeState(), and chart::impl::ModelState::update().
|
inline |
Definition at line 57 of file ReferenceSizeProvider.hxx.
Referenced by setValuesAtPropertySet(), and setValuesAtTitle().
|
staticprivate |
Definition at line 201 of file ReferenceSizeProvider.cxx.
References getAutoResizeFromPropSet().
Referenced by getAutoResizeState().
|
private |
Definition at line 53 of file ReferenceSizeProvider.cxx.
References setValuesAtTitle().
Referenced by setAutoResizeState().
|
private |
sets the auto-resize at all objects that support this feature for text.
eNewState must be either AUTO_RESIZE_YES or AUTO_RESIZE_NO
Definition at line 303 of file ReferenceSizeProvider.cxx.
References AUTO_RESIZE_YES, chart::AxisHelper::getAllAxesOfDiagram(), getAutoResizeState(), impl_setValuesAtTitled(), m_bUseAutoScale, m_xChartDoc, setValuesAtAllDataSeries(), and setValuesAtPropertySet().
Referenced by toggleAutoResizeState().
void chart::ReferenceSizeProvider::setValuesAtAllDataSeries | ( | ) |
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 some new data series via model functionality.
Definition at line 95 of file ReferenceSizeProvider.cxx.
References DBG_UNHANDLED_EXCEPTION, idx, m_xChartDoc, chart::DataSeriesProperties::PROP_DATASERIES_ATTRIBUTED_DATA_POINTS, and setValuesAtPropertySet().
Referenced by setAutoResizeState().
void chart::ReferenceSizeProvider::setValuesAtPropertySet | ( | const css::uno::Reference< css::beans::XPropertySet > & | xProp, |
bool | bAdaptFontSizes = true |
||
) |
Sets the ReferencePageSize according to the internal settings of this class at the XPropertySet, and the adapted font sizes if bAdaptFontSizes is </sal_True>.
Definition at line 129 of file ReferenceSizeProvider.cxx.
References chart::RelativeSizeHelper::adaptFontSizes(), DBG_UNHANDLED_EXCEPTION, getPageSize(), u, and useAutoScale().
Referenced by setAutoResizeState(), setValuesAtAllDataSeries(), and setValuesAtTitle().
void chart::ReferenceSizeProvider::setValuesAtTitle | ( | const css::uno::Reference< css::chart2::XTitle > & | xTitle | ) |
Sets the ReferencePageSize according to the internal settings of this class at the XTitle, and the adapted font sizes at the contained XFormattedStrings.
Definition at line 64 of file ReferenceSizeProvider.cxx.
References chart::RelativeSizeHelper::adaptFontSizes(), DBG_UNHANDLED_EXCEPTION, getPageSize(), setValuesAtPropertySet(), and useAutoScale().
Referenced by chart::TitleHelper::createTitle(), and impl_setValuesAtTitled().
void chart::ReferenceSizeProvider::toggleAutoResizeState | ( | ) |
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.
Definition at line 295 of file ReferenceSizeProvider.cxx.
References AUTO_RESIZE_NO, AUTO_RESIZE_YES, m_bUseAutoScale, and setAutoResizeState().
|
inlineprivate |
Definition at line 99 of file ReferenceSizeProvider.hxx.
Referenced by setValuesAtPropertySet(), and setValuesAtTitle().
|
private |
Definition at line 123 of file ReferenceSizeProvider.hxx.
|
private |
Definition at line 125 of file ReferenceSizeProvider.hxx.
Referenced by setAutoResizeState(), and toggleAutoResizeState().
|
private |
Definition at line 124 of file ReferenceSizeProvider.hxx.
Referenced by setAutoResizeState(), and setValuesAtAllDataSeries().