LibreOffice Module reportdesign (master) 1
RptDef.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
20#pragma once
21
22#include <memory>
23#include <map>
24
25#include <sal/config.h>
26
27#include "dllapi.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>
32
33namespace com::sun::star {
34 namespace report {
35 class XReportComponent;
36 class XReportDefinition;
37 }
38}
39
40namespace rptui
41{
42// not all used at the moment
46
47// allows the alignment and resizing of controls
49{
50 NONE = 0,
51 LEFT = 1,
52 RIGHT = 2,
53 TOP = 3,
54 BOTTOM = 4,
60 HEIGHT_GREATEST = 10,
61};
62
64{
65public:
66 virtual ~AnyConverter(){}
67 virtual css::uno::Any operator() (const OUString& /*_sPropertyName*/,const css::uno::Any& lhs) const
68 {
69 return lhs;
70 }
71};
72typedef ::std::pair< OUString, std::shared_ptr<AnyConverter> > TPropertyConverter;
73typedef std::map<OUString, TPropertyConverter> TPropertyNamePair;
78REPORTDESIGN_DLLPUBLIC css::uno::Reference< css::style::XStyle> getUsedStyle(const css::uno::Reference< css::report::XReportDefinition>& _xReport);
79
80template < typename T> T getStyleProperty(const css::uno::Reference< css::report::XReportDefinition>& _xReport,const OUString& _sPropertyName)
81{
82 T nReturn = T();
83 css::uno::Reference<css::beans::XPropertySet> xProp(getUsedStyle(_xReport),css::uno::UNO_QUERY_THROW);
84 xProp->getPropertyValue(_sPropertyName) >>= nReturn;
85 return nReturn;
86}
87
88}
89
90/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual ~AnyConverter()
Definition: RptDef.hxx:66
virtual css::uno::Any operator()(const OUString &, const css::uno::Any &lhs) const
Definition: RptDef.hxx:67
#define REPORTDESIGN_DLLPUBLIC
Definition: dllapi.h:28
NONE
const sal_uInt32 LEFT
const sal_uInt32 TOP
const sal_uInt32 BOTTOM
const sal_uInt32 RIGHT
uno::Reference< style::XStyle > getUsedStyle(const uno::Reference< report::XReportDefinition > &_xReport)
Definition: RptObject.cxx:1197
ControlModification
Definition: RptDef.hxx:49
std::map< OUString, TPropertyConverter > TPropertyNamePair
Definition: RptDef.hxx:73
constexpr SdrLayerID RPT_LAYER_HIDDEN(2)
constexpr SdrLayerID RPT_LAYER_FRONT(0)
const TPropertyNamePair & getPropertyNameMap(SdrObjKind _nObjectId)
returns the property name map for the given property id
Definition: RptObject.cxx:226
T getStyleProperty(const css::uno::Reference< css::report::XReportDefinition > &_xReport, const OUString &_sPropertyName)
Definition: RptDef.hxx:80
constexpr SdrLayerID RPT_LAYER_BACK(1)
::std::pair< OUString, std::shared_ptr< AnyConverter > > TPropertyConverter
Definition: RptDef.hxx:72
SdrObjKind