Bump version to 6.0-36
[LibreOffice.git] / reportdesign / inc / RptDef.hxx
blobed4fba1721dc22bd7bcb5a4d4d84529393c5099c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #ifndef INCLUDED_REPORTDESIGN_INC_RPTDEF_HXX
21 #define INCLUDED_REPORTDESIGN_INC_RPTDEF_HXX
23 #include <memory>
24 #include <map>
26 #include <sal/config.h>
28 #include "dllapi.h"
29 #include <com/sun/star/beans/XPropertySet.hpp>
30 #include <comphelper/uno3.hxx>
31 #include <svx/fmglob.hxx>
32 #include <svx/svdobj.hxx>
34 namespace com { namespace sun { namespace star {
35 namespace report {
36 class XReportComponent;
37 class XReportDefinition;
39 namespace style {
40 class XStyle;
42 }}}
44 namespace rptui
46 // not all used at the moment
47 constexpr SdrLayerID RPT_LAYER_FRONT (0);
48 constexpr SdrLayerID RPT_LAYER_BACK (1);
49 constexpr SdrLayerID RPT_LAYER_HIDDEN (2);
53 #define OBJ_DLG_FIXEDTEXT ((sal_uInt16) OBJ_MAXI + 1)
54 #define OBJ_DLG_IMAGECONTROL OBJ_FM_IMAGECONTROL
55 #define OBJ_DLG_FORMATTEDFIELD ((sal_uInt16) OBJ_MAXI + 3)
56 #define OBJ_DLG_HFIXEDLINE ((sal_uInt16) OBJ_MAXI + 4)
57 #define OBJ_DLG_VFIXEDLINE ((sal_uInt16) OBJ_MAXI + 5)
58 #define OBJ_DLG_SUBREPORT ((sal_uInt16) OBJ_MAXI + 6)
60 // allows the alignment and resizing of controls
61 enum class ControlModification
63 NONE = 0,
64 LEFT = 1,
65 RIGHT = 2,
66 TOP = 3,
67 BOTTOM = 4,
68 CENTER_HORIZONTAL = 5,
69 CENTER_VERTICAL = 6,
70 WIDTH_SMALLEST = 7,
71 HEIGHT_SMALLEST = 8,
72 WIDTH_GREATEST = 9,
73 HEIGHT_GREATEST = 10,
76 class AnyConverter
78 public:
79 virtual ~AnyConverter(){}
80 virtual css::uno::Any operator() (const OUString& /*_sPropertyName*/,const css::uno::Any& lhs) const
82 return lhs;
85 typedef ::std::pair< OUString, std::shared_ptr<AnyConverter> > TPropertyConverter;
86 typedef std::map<OUString, TPropertyConverter> TPropertyNamePair;
87 /** returns the property name map for the given property id
88 @param _nObjectId the object id
90 REPORTDESIGN_DLLPUBLIC const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId);
91 REPORTDESIGN_DLLPUBLIC css::uno::Reference< css::style::XStyle> getUsedStyle(const css::uno::Reference< css::report::XReportDefinition>& _xReport);
93 template < typename T> T getStyleProperty(const css::uno::Reference< css::report::XReportDefinition>& _xReport,const OUString& _sPropertyName)
95 T nReturn = T();
96 css::uno::Reference<css::beans::XPropertySet> xProp(getUsedStyle(_xReport),css::uno::UNO_QUERY_THROW);
97 xProp->getPropertyValue(_sPropertyName) >>= nReturn;
98 return nReturn;
103 #endif // INCLUDED_REPORTDESIGN_INC_RPTDEF_HXX
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */