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 #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>
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
>())
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(1);
76 aServices
.getArray()[0] = SERVICE_FORMATCONDITION
;
81 uno::Sequence
< OUString
> SAL_CALL
OFormatCondition::getSupportedServiceNames( ) throw(uno::RuntimeException
, std::exception
)
83 return getSupportedServiceNames_Static();
86 sal_Bool SAL_CALL
OFormatCondition::supportsService(const OUString
& ServiceName
) throw( uno::RuntimeException
, std::exception
)
88 return cppu::supportsService(this, ServiceName
);
91 uno::Reference
< beans::XPropertySetInfo
> SAL_CALL
OFormatCondition::getPropertySetInfo( ) throw(uno::RuntimeException
, std::exception
)
93 return FormatConditionPropertySet::getPropertySetInfo();
96 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
)
98 FormatConditionPropertySet::setPropertyValue( aPropertyName
, aValue
);
101 uno::Any SAL_CALL
OFormatCondition::getPropertyValue( const OUString
& PropertyName
) throw (beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
, std::exception
)
103 return FormatConditionPropertySet::getPropertyValue( PropertyName
);
106 void SAL_CALL
OFormatCondition::addPropertyChangeListener( const OUString
& aPropertyName
, const uno::Reference
< beans::XPropertyChangeListener
>& xListener
) throw (beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
, std::exception
)
108 FormatConditionPropertySet::addPropertyChangeListener( aPropertyName
, xListener
);
111 void SAL_CALL
OFormatCondition::removePropertyChangeListener( const OUString
& aPropertyName
, const uno::Reference
< beans::XPropertyChangeListener
>& aListener
) throw (beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
, std::exception
)
113 FormatConditionPropertySet::removePropertyChangeListener( aPropertyName
, aListener
);
116 void SAL_CALL
OFormatCondition::addVetoableChangeListener( const OUString
& PropertyName
, const uno::Reference
< beans::XVetoableChangeListener
>& aListener
) throw (beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
, std::exception
)
118 FormatConditionPropertySet::addVetoableChangeListener( PropertyName
, aListener
);
121 void SAL_CALL
OFormatCondition::removeVetoableChangeListener( const OUString
& PropertyName
, const uno::Reference
< beans::XVetoableChangeListener
>& aListener
) throw (beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
, std::exception
)
123 FormatConditionPropertySet::removeVetoableChangeListener( PropertyName
, aListener
);
127 sal_Bool SAL_CALL
OFormatCondition::getEnabled() throw (uno::RuntimeException
, std::exception
)
129 ::osl::MutexGuard
aGuard(m_aMutex
);
133 void SAL_CALL
OFormatCondition::setEnabled( sal_Bool _enabled
) throw (uno::RuntimeException
, std::exception
)
135 set(PROPERTY_ENABLED
,_enabled
,m_bEnabled
);
138 OUString SAL_CALL
OFormatCondition::getFormula() throw (uno::RuntimeException
, std::exception
)
140 ::osl::MutexGuard
aGuard(m_aMutex
);
144 void SAL_CALL
OFormatCondition::setFormula( const OUString
& _formula
) throw (uno::RuntimeException
, std::exception
)
146 set(PROPERTY_FORMULA
,_formula
,m_sFormula
);
149 // XReportControlFormat
150 REPORTCONTROLFORMAT_IMPL(OFormatCondition
,m_aFormatProperties
)
152 } // namespace reportdesign
155 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */