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 .
25 #include <sal/config.h>
28 #include <com/sun/star/beans/XPropertySet.hpp>
29 #include <com/sun/star/style/XStyle.hpp>
30 #include <svx/svdobjkind.hxx>
31 #include <svx/svdtypes.hxx>
33 namespace com::sun::star
{
35 class XReportComponent
;
36 class XReportDefinition
;
42 // not all used at the moment
43 constexpr SdrLayerID
RPT_LAYER_FRONT (0);
44 constexpr SdrLayerID
RPT_LAYER_BACK (1);
45 constexpr SdrLayerID
RPT_LAYER_HIDDEN (2);
47 // allows the alignment and resizing of controls
48 enum class ControlModification
55 CENTER_HORIZONTAL
= 5,
66 virtual ~AnyConverter(){}
67 virtual css::uno::Any
operator() (const OUString
& /*_sPropertyName*/,const css::uno::Any
& lhs
) const
72 typedef ::std::pair
< OUString
, std::shared_ptr
<AnyConverter
> > TPropertyConverter
;
73 typedef std::map
<OUString
, TPropertyConverter
> TPropertyNamePair
;
74 /** returns the property name map for the given property id
75 @param _nObjectId the object id
77 REPORTDESIGN_DLLPUBLIC
const TPropertyNamePair
& getPropertyNameMap(SdrObjKind _nObjectId
);
78 REPORTDESIGN_DLLPUBLIC
css::uno::Reference
< css::style::XStyle
> getUsedStyle(const css::uno::Reference
< css::report::XReportDefinition
>& _xReport
);
80 template < typename T
> T
getStyleProperty(const css::uno::Reference
< css::report::XReportDefinition
>& _xReport
,const OUString
& _sPropertyName
)
83 css::uno::Reference
<css::beans::XPropertySet
> xProp(getUsedStyle(_xReport
),css::uno::UNO_QUERY_THROW
);
84 xProp
->getPropertyValue(_sPropertyName
) >>= nReturn
;
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */