cURL: follow redirects
[LibreOffice.git] / reportdesign / source / core / api / FormatCondition.cxx
blob92835ea2d82afba60515ba8574d6afb8ae549841
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 .
19 #include "FormatCondition.hxx"
20 #include <com/sun/star/beans/PropertyAttribute.hpp>
21 #include "corestrings.hrc"
22 #include <tools/color.hxx>
23 #include <tools/debug.hxx>
24 #include <connectivity/dbtools.hxx>
25 #include <comphelper/property.hxx>
26 #include <cppuhelper/supportsservice.hxx>
27 #include "Tools.hxx"
28 #include <com/sun/star/text/ParagraphVertAlign.hpp>
29 #include "ReportHelperImpl.hxx"
31 namespace reportdesign
34 using namespace com::sun::star;
35 using namespace comphelper;
37 uno::Reference< uno::XInterface > OFormatCondition::create(uno::Reference< uno::XComponentContext > const & xContext)
39 return *(new OFormatCondition(xContext));
43 OFormatCondition::OFormatCondition(uno::Reference< uno::XComponentContext > const & _xContext)
44 :FormatConditionBase(m_aMutex)
45 ,FormatConditionPropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),uno::Sequence< OUString >())
46 ,m_bEnabled(true)
50 OFormatCondition::~OFormatCondition()
54 IMPLEMENT_FORWARD_XINTERFACE2(OFormatCondition,FormatConditionBase,FormatConditionPropertySet)
56 void SAL_CALL OFormatCondition::dispose() throw(uno::RuntimeException, std::exception)
58 FormatConditionPropertySet::dispose();
59 cppu::WeakComponentImplHelperBase::dispose();
62 OUString OFormatCondition::getImplementationName_Static( ) throw(uno::RuntimeException)
64 return OUString("com.sun.star.comp.report.OFormatCondition");
68 OUString SAL_CALL OFormatCondition::getImplementationName( ) throw(uno::RuntimeException, std::exception)
70 return getImplementationName_Static();
73 uno::Sequence< OUString > OFormatCondition::getSupportedServiceNames_Static( ) throw(uno::RuntimeException)
75 uno::Sequence< OUString > aServices { SERVICE_FORMATCONDITION };
77 return aServices;
80 uno::Sequence< OUString > SAL_CALL OFormatCondition::getSupportedServiceNames( ) throw(uno::RuntimeException, std::exception)
82 return getSupportedServiceNames_Static();
85 sal_Bool SAL_CALL OFormatCondition::supportsService(const OUString& ServiceName) throw( uno::RuntimeException, std::exception )
87 return cppu::supportsService(this, ServiceName);
90 uno::Reference< beans::XPropertySetInfo > SAL_CALL OFormatCondition::getPropertySetInfo( ) throw(uno::RuntimeException, std::exception)
92 return FormatConditionPropertySet::getPropertySetInfo();
95 void SAL_CALL OFormatCondition::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
97 FormatConditionPropertySet::setPropertyValue( aPropertyName, aValue );
100 uno::Any SAL_CALL OFormatCondition::getPropertyValue( const OUString& PropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
102 return FormatConditionPropertySet::getPropertyValue( PropertyName);
105 void SAL_CALL OFormatCondition::addPropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
107 FormatConditionPropertySet::addPropertyChangeListener( aPropertyName, xListener );
110 void SAL_CALL OFormatCondition::removePropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
112 FormatConditionPropertySet::removePropertyChangeListener( aPropertyName, aListener );
115 void SAL_CALL OFormatCondition::addVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
117 FormatConditionPropertySet::addVetoableChangeListener( PropertyName, aListener );
120 void SAL_CALL OFormatCondition::removeVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
122 FormatConditionPropertySet::removeVetoableChangeListener( PropertyName, aListener );
125 // XFormatCondition
126 sal_Bool SAL_CALL OFormatCondition::getEnabled() throw (uno::RuntimeException, std::exception)
128 ::osl::MutexGuard aGuard(m_aMutex);
129 return m_bEnabled;
132 void SAL_CALL OFormatCondition::setEnabled( sal_Bool _enabled ) throw (uno::RuntimeException, std::exception)
134 set(PROPERTY_ENABLED,_enabled,m_bEnabled);
137 OUString SAL_CALL OFormatCondition::getFormula() throw (uno::RuntimeException, std::exception)
139 ::osl::MutexGuard aGuard(m_aMutex);
140 return m_sFormula;
143 void SAL_CALL OFormatCondition::setFormula( const OUString& _formula ) throw (uno::RuntimeException, std::exception)
145 set(PROPERTY_FORMULA,_formula,m_sFormula);
148 // XReportControlFormat
149 REPORTCONTROLFORMAT_IMPL(OFormatCondition,m_aFormatProperties)
151 } // namespace reportdesign
154 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */