LibreOffice Module chart2 (master) 1
FormattedString.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#pragma once
20
21#include "OPropertySet.hxx"
23#include <comphelper/uno3.hxx>
24#include <com/sun/star/lang/XServiceInfo.hpp>
25#include <com/sun/star/chart2/XDataPointCustomLabelField.hpp>
26#include <com/sun/star/util/XCloneable.hpp>
28#include "PropertyHelper.hxx"
29
30namespace chart
31{
32
33namespace impl
34{
35typedef ::cppu::WeakImplHelper<
36 css::chart2::XDataPointCustomLabelField, // inherits from XFormattedString2
37 css::lang::XServiceInfo,
38 css::util::XCloneable,
39 css::util::XModifyBroadcaster,
40 css::util::XModifyListener >
42}
43
44class FormattedString final :
47{
48public:
49 explicit FormattedString();
50 virtual ~FormattedString() override;
51
53 virtual OUString SAL_CALL getImplementationName() override;
54 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
55 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
56
61
62 virtual void SAL_CALL setPropertyValue(const OUString& p1, const css::uno::Any& p2) override
64 virtual css::uno::Any SAL_CALL getPropertyValue(const OUString& p1) override
65 { return ::property::OPropertySet::getPropertyValue(p1); }
66 virtual void SAL_CALL addPropertyChangeListener(const OUString& p1, const css::uno::Reference<css::beans::XPropertyChangeListener>& p2) override
68 virtual void SAL_CALL removePropertyChangeListener(const OUString& p1, const css::uno::Reference<css::beans::XPropertyChangeListener>& p2) override
70 virtual void SAL_CALL addVetoableChangeListener(const OUString& p1, const css::uno::Reference<css::beans::XVetoableChangeListener>& p2) override
72 virtual void SAL_CALL removeVetoableChangeListener(const OUString& p1, const css::uno::Reference<css::beans::XVetoableChangeListener>& p2) override
74
75 explicit FormattedString( const FormattedString & rOther );
76
77 // ____ XFormattedString ____
78 virtual OUString SAL_CALL getString() override;
79 virtual void SAL_CALL setString( const OUString& String ) override;
80
81 // ____ XDataPointCustomLabelField ____
82 virtual css::chart2::DataPointCustomLabelFieldType SAL_CALL getFieldType() override;
83 virtual void SAL_CALL
84 setFieldType( const css::chart2::DataPointCustomLabelFieldType FieldType ) override;
85 virtual OUString SAL_CALL getGuid() override;
86 void SAL_CALL setGuid( const OUString& guid ) override;
87 virtual sal_Bool SAL_CALL getDataLabelsRange() override;
88 virtual void SAL_CALL setDataLabelsRange( sal_Bool dataLabelsRange ) override;
89 virtual OUString SAL_CALL getCellRange() override;
90 virtual void SAL_CALL setCellRange( const OUString& cellRange ) override;
91
92 // ____ OPropertySet ____
93 virtual void GetDefaultValue( sal_Int32 nHandle, css::uno::Any& rAny ) const override;
94
95 // ____ OPropertySet ____
96 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
97
98 // ____ XPropertySet ____
99 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
100 getPropertySetInfo() override;
101
102 // ____ XCloneable ____
103 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
104
105 // ____ XModifyBroadcaster ____
106 virtual void SAL_CALL addModifyListener(
107 const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
108 virtual void SAL_CALL removeModifyListener(
109 const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
110
111 // ____ XModifyListener ____
112 virtual void SAL_CALL modified(
113 const css::lang::EventObject& aEvent ) override;
114
115 // ____ XEventListener (base of XModifyListener) ____
116 virtual void SAL_CALL disposing(
117 const css::lang::EventObject& Source ) override;
118
119private:
120 // ____ OPropertySet ____
121 virtual void firePropertyChangeEvent() override;
122 using OPropertySet::disposing;
123
124 void fireModifyEvent();
125
126 // ____ XFormattedString ____
127 OUString m_aString;
128
129 // ____ XDataPointCustomLabelField ____
130 css::chart2::DataPointCustomLabelFieldType m_aType;
131 OUString m_aGuid;
132 OUString m_aCellRange;
134
136};
137
139
140} // namespace chart
141
142/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define OOO_DLLPUBLIC_CHARTTOOLS
virtual void GetDefaultValue(sal_Int32 nHandle, css::uno::Any &rAny) const override
implement this method to provide default values for all properties supporting defaults.
virtual void SAL_CALL addVetoableChangeListener(const OUString &p1, const css::uno::Reference< css::beans::XVetoableChangeListener > &p2) override
virtual OUString SAL_CALL getGuid() override
virtual void SAL_CALL removeModifyListener(const css::uno::Reference< css::util::XModifyListener > &aListener) override
css::chart2::DataPointCustomLabelFieldType m_aType
virtual OUString SAL_CALL getString() override
virtual OUString SAL_CALL getImplementationName() override
declare XServiceInfo methods
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual void SAL_CALL removePropertyChangeListener(const OUString &p1, const css::uno::Reference< css::beans::XPropertyChangeListener > &p2) override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &p1) override
rtl::Reference< ModifyEventForwarder > m_xModifyEventForwarder
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
The InfoHelper table contains all property names and types of this object.
virtual void SAL_CALL removeVetoableChangeListener(const OUString &p1, const css::uno::Reference< css::beans::XVetoableChangeListener > &p2) override
virtual void SAL_CALL addPropertyChangeListener(const OUString &p1, const css::uno::Reference< css::beans::XPropertyChangeListener > &p2) override
virtual void SAL_CALL addModifyListener(const css::uno::Reference< css::util::XModifyListener > &aListener) override
virtual void SAL_CALL setFieldType(const css::chart2::DataPointCustomLabelFieldType FieldType) override
virtual OUString SAL_CALL getCellRange() override
virtual void SAL_CALL setDataLabelsRange(sal_Bool dataLabelsRange) override
virtual void SAL_CALL setCellRange(const OUString &cellRange) override
virtual css::chart2::DataPointCustomLabelFieldType SAL_CALL getFieldType() override
void SAL_CALL setGuid(const OUString &guid) override
virtual sal_Bool SAL_CALL getDataLabelsRange() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL modified(const css::lang::EventObject &aEvent) override
virtual void firePropertyChangeEvent() override
implement this method in derived classes to get called when properties change.
virtual ~FormattedString() override
virtual void SAL_CALL setPropertyValue(const OUString &p1, const css::uno::Any &p2) override
merge XInterface implementations
virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual void SAL_CALL setString(const OUString &String) override
virtual void SAL_CALL addVetoableChangeListener(const ::rtl::OUString &aPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) SAL_OVERRIDE
void SAL_CALL disposing()
virtual void SAL_CALL removePropertyChangeListener(const ::rtl::OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) SAL_OVERRIDE
virtual void SAL_CALL removeVetoableChangeListener(const ::rtl::OUString &aPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) SAL_OVERRIDE
virtual void SAL_CALL setPropertyValue(const ::rtl::OUString &rPropertyName, const css::uno::Any &aValue) SAL_OVERRIDE
virtual void SAL_CALL addPropertyChangeListener(const ::rtl::OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) SAL_OVERRIDE
::cppu::WeakImplHelper< css::chart2::XDataPointCustomLabelField, css::lang::XServiceInfo, css::util::XCloneable, css::util::XModifyBroadcaster, css::util::XModifyListener > FormattedString_Base
OOO_DLLPUBLIC_CHARTTOOLSconst ::chart::tPropertyValueMap & StaticFormattedStringDefaults()
std::unordered_map< tPropertyValueMapKey, css::uno::Any > tPropertyValueMap
FieldType
unsigned char sal_Bool
#define DECLARE_XTYPEPROVIDER()
#define DECLARE_XINTERFACE()