29#include <unonames.hxx>
33#include <com/sun/star/beans/PropertyAttribute.hpp>
34#include <com/sun/star/chart/ChartAxisArrangeOrderType.hpp>
35#include <com/sun/star/chart/ChartAxisPosition.hpp>
36#include <com/sun/star/chart/ChartAxisLabelPosition.hpp>
37#include <com/sun/star/chart/ChartAxisMarkPosition.hpp>
38#include <com/sun/star/chart2/XAxis.hpp>
57using ::com::sun::star::beans::Property;
58using ::com::sun::star::uno::Reference;
59using ::com::sun::star::uno::Sequence;
60using ::com::sun::star::uno::Any;
71 PROP_AXIS_STEPHELP_COUNT,
74 PROP_AXIS_AUTO_STEPMAIN,
75 PROP_AXIS_AUTO_STEPHELP,
77 PROP_AXIS_TIME_INCREMENT,
78 PROP_AXIS_EXPLICIT_TIME_INCREMENT,
79 PROP_AXIS_LOGARITHMIC,
80 PROP_AXIS_REVERSEDIRECTION,
82 PROP_AXIS_CROSSOVER_POSITION,
83 PROP_AXIS_CROSSOVER_VALUE,
85 PROP_AXIS_AUTO_ORIGIN,
88 PROP_AXIS_MARK_POSITION,
89 PROP_AXIS_DISPLAY_LABELS,
90 PROP_AXIS_NUMBERFORMAT,
91 PROP_AXIS_LINK_NUMBERFORMAT_TO_SOURCE,
92 PROP_AXIS_LABEL_POSITION,
93 PROP_AXIS_TEXT_ROTATION,
94 PROP_AXIS_ARRANGE_ORDER,
96 PROP_AXIS_CAN_OVERLAP,
97 PROP_AXIS_STACKEDTEXT,
100 PROP_AXIS_DISPLAY_UNITS,
101 PROP_AXIS_BUILTINUNIT,
102 PROP_AXIS_TRY_STAGGERING_FIRST,
103 PROP_AXIS_MAJOR_ORIGIN
106void lcl_AddPropertiesToVector(
107 std::vector< Property > & rOutProperties )
110 rOutProperties.emplace_back(
"Max",
113 beans::PropertyAttribute::BOUND
114 | beans::PropertyAttribute::MAYBEVOID );
116 rOutProperties.emplace_back(
"Min",
119 beans::PropertyAttribute::BOUND
120 | beans::PropertyAttribute::MAYBEVOID );
122 rOutProperties.emplace_back(
"StepMain",
125 beans::PropertyAttribute::BOUND
126 | beans::PropertyAttribute::MAYBEVOID );
128 rOutProperties.emplace_back(
"StepHelpCount",
129 PROP_AXIS_STEPHELP_COUNT,
131 beans::PropertyAttribute::BOUND
132 | beans::PropertyAttribute::MAYBEVOID );
135 rOutProperties.emplace_back(
"StepHelp",
138 beans::PropertyAttribute::BOUND
139 | beans::PropertyAttribute::MAYBEVOID );
141 rOutProperties.emplace_back(
"AutoMax",
145 beans::PropertyAttribute::MAYBEDEFAULT );
147 rOutProperties.emplace_back(
"AutoMin",
151 beans::PropertyAttribute::MAYBEDEFAULT );
153 rOutProperties.emplace_back(
"AutoStepMain",
154 PROP_AXIS_AUTO_STEPMAIN,
157 beans::PropertyAttribute::MAYBEDEFAULT );
159 rOutProperties.emplace_back(
"AutoStepHelp",
160 PROP_AXIS_AUTO_STEPHELP,
163 beans::PropertyAttribute::MAYBEDEFAULT );
165 rOutProperties.emplace_back(
"AxisType",
169 beans::PropertyAttribute::MAYBEDEFAULT );
171 rOutProperties.emplace_back(
"TimeIncrement",
172 PROP_AXIS_TIME_INCREMENT,
175 beans::PropertyAttribute::MAYBEVOID );
177 rOutProperties.emplace_back(
"ExplicitTimeIncrement",
178 PROP_AXIS_EXPLICIT_TIME_INCREMENT,
180 beans::PropertyAttribute::READONLY |
181 beans::PropertyAttribute::MAYBEVOID );
183 rOutProperties.emplace_back(
"Logarithmic",
184 PROP_AXIS_LOGARITHMIC,
187 beans::PropertyAttribute::MAYBEDEFAULT );
189 rOutProperties.emplace_back(
"ReverseDirection",
190 PROP_AXIS_REVERSEDIRECTION,
193 beans::PropertyAttribute::MAYBEDEFAULT );
196 rOutProperties.emplace_back(
"Visible",
199 beans::PropertyAttribute::BOUND
200 | beans::PropertyAttribute::MAYBEDEFAULT );
202 rOutProperties.emplace_back(
"CrossoverPosition",
203 PROP_AXIS_CROSSOVER_POSITION,
205 beans::PropertyAttribute::MAYBEDEFAULT );
207 rOutProperties.emplace_back(
"CrossoverValue",
208 PROP_AXIS_CROSSOVER_VALUE,
210 beans::PropertyAttribute::MAYBEVOID );
212 rOutProperties.emplace_back(
"Origin",
215 beans::PropertyAttribute::BOUND
216 | beans::PropertyAttribute::MAYBEVOID );
218 rOutProperties.emplace_back(
"AutoOrigin",
219 PROP_AXIS_AUTO_ORIGIN,
222 beans::PropertyAttribute::MAYBEDEFAULT );
225 rOutProperties.emplace_back(
"Marks",
228 beans::PropertyAttribute::BOUND
229 | beans::PropertyAttribute::MAYBEDEFAULT );
231 rOutProperties.emplace_back(
"HelpMarks",
234 beans::PropertyAttribute::BOUND
235 | beans::PropertyAttribute::MAYBEDEFAULT );
237 rOutProperties.emplace_back(
"MarkPosition",
238 PROP_AXIS_MARK_POSITION,
240 beans::PropertyAttribute::MAYBEDEFAULT );
243 rOutProperties.emplace_back(
"DisplayLabels",
244 PROP_AXIS_DISPLAY_LABELS,
246 beans::PropertyAttribute::BOUND
247 | beans::PropertyAttribute::MAYBEDEFAULT );
250 PROP_AXIS_NUMBERFORMAT,
252 beans::PropertyAttribute::BOUND
253 | beans::PropertyAttribute::MAYBEDEFAULT );
256 PROP_AXIS_LINK_NUMBERFORMAT_TO_SOURCE,
258 beans::PropertyAttribute::BOUND
259 | beans::PropertyAttribute::MAYBEDEFAULT );
261 rOutProperties.emplace_back(
"LabelPosition",
262 PROP_AXIS_LABEL_POSITION,
264 beans::PropertyAttribute::MAYBEDEFAULT );
266 rOutProperties.emplace_back(
"TextRotation",
267 PROP_AXIS_TEXT_ROTATION,
269 beans::PropertyAttribute::BOUND
270 | beans::PropertyAttribute::MAYBEDEFAULT );
272 rOutProperties.emplace_back(
"ArrangeOrder",
273 PROP_AXIS_ARRANGE_ORDER,
275 beans::PropertyAttribute::BOUND
276 | beans::PropertyAttribute::MAYBEDEFAULT );
278 rOutProperties.emplace_back(
"TextBreak",
281 beans::PropertyAttribute::BOUND
282 | beans::PropertyAttribute::MAYBEDEFAULT );
284 rOutProperties.emplace_back(
"TextCanOverlap",
285 PROP_AXIS_CAN_OVERLAP,
287 beans::PropertyAttribute::BOUND
288 | beans::PropertyAttribute::MAYBEDEFAULT );
290 rOutProperties.emplace_back(
"StackedText",
291 PROP_AXIS_STACKEDTEXT,
293 beans::PropertyAttribute::BOUND
294 | beans::PropertyAttribute::MAYBEDEFAULT );
297 rOutProperties.emplace_back(
"Overlap",
301 beans::PropertyAttribute::MAYBEDEFAULT );
303 rOutProperties.emplace_back(
"GapWidth",
307 beans::PropertyAttribute::MAYBEDEFAULT );
310 rOutProperties.emplace_back(
"DisplayUnits",
311 PROP_AXIS_DISPLAY_UNITS,
313 beans::PropertyAttribute::BOUND
314 | beans::PropertyAttribute::MAYBEDEFAULT );
317 rOutProperties.emplace_back(
"BuiltInUnit",
318 PROP_AXIS_BUILTINUNIT,
320 beans::PropertyAttribute::BOUND
321 | beans::PropertyAttribute::MAYBEDEFAULT );
325 rOutProperties.emplace_back(
"TryStaggeringFirst",
326 PROP_AXIS_TRY_STAGGERING_FIRST,
328 beans::PropertyAttribute::BOUND
329 | beans::PropertyAttribute::MAYBEDEFAULT );
331 rOutProperties.emplace_back(
"MajorOrigin",
332 PROP_AXIS_MAJOR_ORIGIN,
334 beans::PropertyAttribute::BOUND
335 | beans::PropertyAttribute::MAYBEVOID );
338const Sequence< Property >& StaticAxisWrapperPropertyArray()
340 static Sequence< Property > aPropSeq = []()
343 lcl_AddPropertiesToVector( aProperties );
363 tAxisType eType, std::shared_ptr<Chart2ModelContact> spChart2ModelContact) :
459 OSL_FAIL(
"trying to set position of Axis" );
470 OSL_FAIL(
"trying to set size of Axis" );
476 return "com.sun.star.chart.ChartAxis";
484 return xChartModel->getNumberFormatSettings();
493 return xChartModel->getNumberFormats();
503 rnDimensionIndex = 0; rbMainAxis =
true;
break;
505 rnDimensionIndex = 1; rbMainAxis =
true;
break;
507 rnDimensionIndex = 2; rbMainAxis =
true;
break;
509 rnDimensionIndex = 0; rbMainAxis =
false;
break;
511 rnDimensionIndex = 1; rbMainAxis =
false;
break;
526 clearWrappedPropertySet();
549 if( xProp->getPropertyValue(
"ReferencePageSize").hasValue() )
550 xProp->setPropertyValue(
"ReferencePageSize",
uno::Any(
559 aRet = xProp->getPropertyValue(
"ReferencePageSize");
572 sal_Int32 nDimensionIndex = 0;
573 bool bMainAxis =
true;
582 xAxis->setPropertyValue(
"Show",
uno::Any(
false ) );
585 catch(
const uno::Exception & )
600 return StaticAxisWrapperPropertyArray();
605 std::vector< std::unique_ptr<WrappedProperty> > aWrappedProperties;
608 aWrappedProperties.emplace_back(
new WrappedProperty(
"Marks",
"MajorTickmarks") );
609 aWrappedProperties.emplace_back(
new WrappedProperty(
"HelpMarks",
"MinorTickmarks") );
610 aWrappedProperties.emplace_back(
new WrappedProperty(
"TextCanOverlap",
"TextOverlap") );
611 aWrappedProperties.emplace_back(
new WrappedProperty(
"ArrangeOrder",
"ArrangeOrder") );
612 aWrappedProperties.emplace_back(
new WrappedProperty(
"Visible",
"Show") );
618 aWrappedProperties.emplace_back(
new WrappedProperty(
"StackedText",
"StackCharacters") );
624 sal_Int32 nDimensionIndex = 0;
625 bool bMainAxis =
true;
626 sal_Int32 nAxisIndex = 0;
632 aWrappedProperties.emplace_back( pWrappedGapwidthProperty );
633 aWrappedProperties.emplace_back( pWrappedBarOverlapProperty );
641 return aWrappedProperties;
646 return "com.sun.star.comp.chart.Axis";
657 "com.sun.star.chart.ChartAxis",
658 "com.sun.star.xml.UserDefinedAttributesSupplier",
659 "com.sun.star.style.CharacterProperties"
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact
PropertiesInfo aProperties
static rtl::Reference< ::chart::Axis > getAxis(sal_Int32 nDimensionIndex, bool bMainAxis, const rtl::Reference< ::chart::Diagram > &xDiagram)
static rtl::Reference< ::chart::Axis > createAxis(sal_Int32 nDimensionIndex, bool bMainAxis, const rtl::Reference< ::chart::Diagram > &xDiagram, const css::uno::Reference< css::uno::XComponentContext > &xContext, ReferenceSizeProvider *pRefSizeProvider=nullptr)
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.
void setDimensionAndAxisIndex(sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex)
static void addWrappedProperties(std::vector< std::unique_ptr< WrappedProperty > > &rList, ReferenceSizePropertyProvider *pRefSizePropProvider)
static void addWrappedProperties(std::vector< std::unique_ptr< WrappedProperty > > &rList, const std::shared_ptr< Chart2ModelContact > &spChart2ModelContact)
static void addProperties(std::vector< css::beans::Property > &rOutProperties)
static void addWrappedProperties(std::vector< std::unique_ptr< WrappedProperty > > &rList, const std::shared_ptr< Chart2ModelContact > &spChart2ModelContact)
sal_Int32 addInterface(std::unique_lock< std::mutex > &rGuard, const css::uno::Reference< ListenerT > &rxIFace)
void disposeAndClear(::std::unique_lock<::std::mutex > &rGuard, const css::lang::EventObject &rEvt)
sal_Int32 removeInterface(std::unique_lock< std::mutex > &rGuard, const css::uno::Reference< ListenerT > &rxIFace)
#define DBG_UNHANDLED_EXCEPTION(...)
OOO_DLLPUBLIC_CHARTTOOLS void AddPropertiesToVector(std::vector< css::beans::Property > &rOutProperties)
void DisposeAndClear(css::uno::Reference< T > &rInterface)
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
constexpr OUStringLiteral CHART_UNONAME_LINK_TO_SRC_NUMFMT
constexpr OUStringLiteral CHART_UNONAME_NUMFMT