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 <strings.hxx>
21 #include <tools/color.hxx>
22 #include <cppuhelper/supportsservice.hxx>
23 #include <ReportHelperImpl.hxx>
25 namespace reportdesign
28 using namespace com::sun::star
;
30 uno::Reference
< uno::XInterface
> OFormatCondition::create(uno::Reference
< uno::XComponentContext
> const & xContext
)
32 return *(new OFormatCondition(xContext
));
36 OFormatCondition::OFormatCondition(uno::Reference
< uno::XComponentContext
> const & _xContext
)
37 :FormatConditionBase(m_aMutex
)
38 ,FormatConditionPropertySet(_xContext
,IMPLEMENTS_PROPERTY_SET
,uno::Sequence
< OUString
>())
43 OFormatCondition::~OFormatCondition()
47 IMPLEMENT_FORWARD_XINTERFACE2(OFormatCondition
,FormatConditionBase
,FormatConditionPropertySet
)
49 void SAL_CALL
OFormatCondition::dispose()
51 FormatConditionPropertySet::dispose();
52 cppu::WeakComponentImplHelperBase::dispose();
55 OUString
OFormatCondition::getImplementationName_Static( )
57 return u
"com.sun.star.comp.report.OFormatCondition"_ustr
;
61 OUString SAL_CALL
OFormatCondition::getImplementationName( )
63 return getImplementationName_Static();
66 uno::Sequence
< OUString
> OFormatCondition::getSupportedServiceNames_Static( )
68 uno::Sequence
< OUString
> aServices
{ SERVICE_FORMATCONDITION
};
73 uno::Sequence
< OUString
> SAL_CALL
OFormatCondition::getSupportedServiceNames( )
75 return getSupportedServiceNames_Static();
78 sal_Bool SAL_CALL
OFormatCondition::supportsService(const OUString
& ServiceName
)
80 return cppu::supportsService(this, ServiceName
);
83 uno::Reference
< beans::XPropertySetInfo
> SAL_CALL
OFormatCondition::getPropertySetInfo( )
85 return FormatConditionPropertySet::getPropertySetInfo();
88 void SAL_CALL
OFormatCondition::setPropertyValue( const OUString
& aPropertyName
, const uno::Any
& aValue
)
90 FormatConditionPropertySet::setPropertyValue( aPropertyName
, aValue
);
93 uno::Any SAL_CALL
OFormatCondition::getPropertyValue( const OUString
& PropertyName
)
95 return FormatConditionPropertySet::getPropertyValue( PropertyName
);
98 void SAL_CALL
OFormatCondition::addPropertyChangeListener( const OUString
& aPropertyName
, const uno::Reference
< beans::XPropertyChangeListener
>& xListener
)
100 FormatConditionPropertySet::addPropertyChangeListener( aPropertyName
, xListener
);
103 void SAL_CALL
OFormatCondition::removePropertyChangeListener( const OUString
& aPropertyName
, const uno::Reference
< beans::XPropertyChangeListener
>& aListener
)
105 FormatConditionPropertySet::removePropertyChangeListener( aPropertyName
, aListener
);
108 void SAL_CALL
OFormatCondition::addVetoableChangeListener( const OUString
& PropertyName
, const uno::Reference
< beans::XVetoableChangeListener
>& aListener
)
110 FormatConditionPropertySet::addVetoableChangeListener( PropertyName
, aListener
);
113 void SAL_CALL
OFormatCondition::removeVetoableChangeListener( const OUString
& PropertyName
, const uno::Reference
< beans::XVetoableChangeListener
>& aListener
)
115 FormatConditionPropertySet::removeVetoableChangeListener( PropertyName
, aListener
);
119 sal_Bool SAL_CALL
OFormatCondition::getEnabled()
121 ::osl::MutexGuard
aGuard(m_aMutex
);
125 void SAL_CALL
OFormatCondition::setEnabled( sal_Bool _enabled
)
127 set(PROPERTY_ENABLED
,_enabled
,m_bEnabled
);
130 OUString SAL_CALL
OFormatCondition::getFormula()
132 ::osl::MutexGuard
aGuard(m_aMutex
);
136 void SAL_CALL
OFormatCondition::setFormula( const OUString
& _formula
)
138 set(PROPERTY_FORMULA
,_formula
,m_sFormula
);
141 // XReportControlFormat
142 REPORTCONTROLFORMAT_IMPL(OFormatCondition
,m_aFormatProperties
)
144 } // namespace reportdesign
147 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */