1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_CHART2_SOURCE_INC_WRAPPEDPROPERTY_HXX
20 #define INCLUDED_CHART2_SOURCE_INC_WRAPPEDPROPERTY_HXX
22 #include <com/sun/star/beans/PropertyState.hpp>
23 #include <com/sun/star/uno/Any.hxx>
24 #include <rtl/ustring.hxx>
25 #include "charttoolsdllapi.hxx"
30 namespace com
{ namespace sun
{ namespace star
{ namespace beans
{ class XPropertySet
; } } } }
31 namespace com
{ namespace sun
{ namespace star
{ namespace beans
{ class XPropertyState
; } } } }
32 namespace com
{ namespace sun
{ namespace star
{ namespace uno
{ template <class interface_type
> class Reference
; } } } }
37 class OOO_DLLPUBLIC_CHARTTOOLS WrappedProperty
39 /** The property visible to the outer PropertySet in the PropertySetWrapper may have a different name, type and value than
40 a corresponding property of the inner PropertySet. Use this class to do the conversion between the two.
43 WrappedProperty( const OUString
& rOuterName
, const OUString
& rInnerName
);
44 virtual ~WrappedProperty();
46 const OUString
& getOuterName() const { return m_aOuterName
;}
47 virtual OUString
getInnerName() const;
49 /// @throws css::beans::UnknownPropertyException
50 /// @throws css::beans::PropertyVetoException
51 /// @throws css::lang::IllegalArgumentException
52 /// @throws css::lang::WrappedTargetException
53 /// @throws css::uno::RuntimeException
54 virtual void setPropertyValue( const css::uno::Any
& rOuterValue
, const css::uno::Reference
< css::beans::XPropertySet
>& xInnerPropertySet
) const;
56 /// @throws css::beans::UnknownPropertyException
57 /// @throws css::lang::WrappedTargetException
58 /// @throws css::uno::RuntimeException
59 virtual css::uno::Any
getPropertyValue( const css::uno::Reference
< css::beans::XPropertySet
>& xInnerPropertySet
) const;
61 /// @throws css::beans::UnknownPropertyException
62 /// @throws css::uno::RuntimeException
63 virtual void setPropertyToDefault( const css::uno::Reference
< css::beans::XPropertyState
>& xInnerPropertyState
) const;
65 /// @throws css::beans::UnknownPropertyException
66 /// @throws css::lang::WrappedTargetException
67 /// @throws css::uno::RuntimeException
68 virtual css::uno::Any
getPropertyDefault( const css::uno::Reference
< css::beans::XPropertyState
>& xInnerPropertyState
) const;
70 /// @throws css::beans::UnknownPropertyException
71 /// @throws css::uno::RuntimeException
72 virtual css::beans::PropertyState
getPropertyState( const css::uno::Reference
< css::beans::XPropertyState
>& xInnerPropertyState
) const;
75 virtual css::uno::Any
convertInnerToOuterValue( const css::uno::Any
& rInnerValue
) const;
76 virtual css::uno::Any
convertOuterToInnerValue( const css::uno::Any
& rOuterValue
) const;
79 OUString m_aOuterName
;
80 OUString m_aInnerName
;
83 typedef std::map
< sal_Int32
, std::unique_ptr
<const WrappedProperty
> > tWrappedPropertyMap
;
87 // INCLUDED_CHART2_SOURCE_INC_WRAPPEDPROPERTY_HXX
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */