Coverage Report

Created: 2026-05-16 09:25

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/chart2/source/inc/WrappedProperty.hxx
Line
Count
Source
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 <com/sun/star/beans/PropertyState.hpp>
22
#include <com/sun/star/uno/Any.hxx>
23
#include <rtl/ustring.hxx>
24
25
#include <map>
26
#include <memory>
27
28
namespace com::sun::star::beans { class XPropertySet; }
29
namespace com::sun::star::beans { class XPropertyState; }
30
namespace com::sun::star::uno { template <class interface_type> class Reference; }
31
32
namespace chart
33
{
34
35
class WrappedProperty
36
{
37
    /** The property visible to the outer PropertySet in the PropertySetWrapper may have a different name, type and value than
38
    a corresponding property of the inner PropertySet. Use this class to do the conversion between the two.
39
    */
40
public:
41
    WrappedProperty( OUString aOuterName, OUString aInnerName );
42
    virtual ~WrappedProperty();
43
44
0
    const OUString& getOuterName() const { return m_aOuterName;}
45
    virtual OUString getInnerName() const;
46
47
    /// @throws css::beans::UnknownPropertyException
48
    /// @throws css::beans::PropertyVetoException
49
    /// @throws css::lang::IllegalArgumentException
50
    /// @throws css::lang::WrappedTargetException
51
    /// @throws css::uno::RuntimeException
52
    virtual void setPropertyValue( const css::uno::Any& rOuterValue, const css::uno::Reference< css::beans::XPropertySet >& xInnerPropertySet ) const;
53
54
    /// @throws css::beans::UnknownPropertyException
55
    /// @throws css::lang::WrappedTargetException
56
    /// @throws css::uno::RuntimeException
57
    virtual css::uno::Any getPropertyValue( const css::uno::Reference< css::beans::XPropertySet >& xInnerPropertySet ) const;
58
59
    /// @throws css::beans::UnknownPropertyException
60
    /// @throws css::uno::RuntimeException
61
    virtual void setPropertyToDefault( const css::uno::Reference< css::beans::XPropertyState >& xInnerPropertyState ) const;
62
63
    /// @throws css::beans::UnknownPropertyException
64
    /// @throws css::lang::WrappedTargetException
65
    /// @throws css::uno::RuntimeException
66
    virtual css::uno::Any getPropertyDefault( const css::uno::Reference< css::beans::XPropertyState >& xInnerPropertyState ) const;
67
68
    /// @throws css::beans::UnknownPropertyException
69
    /// @throws css::uno::RuntimeException
70
    virtual css::beans::PropertyState getPropertyState( const css::uno::Reference< css::beans::XPropertyState >& xInnerPropertyState ) const;
71
72
protected:
73
    virtual css::uno::Any convertInnerToOuterValue( const css::uno::Any& rInnerValue ) const;
74
    virtual css::uno::Any convertOuterToInnerValue( const css::uno::Any& rOuterValue ) const;
75
76
protected:
77
    OUString             m_aOuterName;
78
    OUString             m_aInnerName;
79
};
80
81
typedef std::map< sal_Int32, std::unique_ptr<const WrappedProperty> > tWrappedPropertyMap;
82
83
} //namespace chart
84
85
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */