LibreOffice Module reportdesign (master)  1
FormatCondition.cxx
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 #include <FormatCondition.hxx>
20 #include <strings.hxx>
21 #include <tools/color.hxx>
23 #include <ReportHelperImpl.hxx>
24 
25 namespace reportdesign
26 {
27 
28  using namespace com::sun::star;
29 
30 OFormatCondition::OFormatCondition(uno::Reference< uno::XComponentContext > const & _xContext)
32 ,FormatConditionPropertySet(_xContext,IMPLEMENTS_PROPERTY_SET,uno::Sequence< OUString >())
33 ,m_bEnabled(true)
34 {
35 }
36 
38 {
39 }
40 
42 
43 void SAL_CALL OFormatCondition::dispose()
44 {
46  cppu::WeakComponentImplHelperBase::dispose();
47 }
48 
50 {
51  return "com.sun.star.comp.report.OFormatCondition";
52 }
53 
54 uno::Sequence< OUString > SAL_CALL OFormatCondition::getSupportedServiceNames( )
55 {
56  return { SERVICE_FORMATCONDITION };
57 }
58 
59 sal_Bool SAL_CALL OFormatCondition::supportsService(const OUString& ServiceName)
60 {
61  return cppu::supportsService(this, ServiceName);
62 }
63 
64 uno::Reference< beans::XPropertySetInfo > SAL_CALL OFormatCondition::getPropertySetInfo( )
65 {
67 }
68 
69 void SAL_CALL OFormatCondition::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue )
70 {
71  FormatConditionPropertySet::setPropertyValue( aPropertyName, aValue );
72 }
73 
74 uno::Any SAL_CALL OFormatCondition::getPropertyValue( const OUString& PropertyName )
75 {
77 }
78 
79 void SAL_CALL OFormatCondition::addPropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener )
80 {
82 }
83 
84 void SAL_CALL OFormatCondition::removePropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener )
85 {
87 }
88 
89 void SAL_CALL OFormatCondition::addVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener )
90 {
92 }
93 
94 void SAL_CALL OFormatCondition::removeVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener )
95 {
97 }
98 
99 // XFormatCondition
101 {
102  ::osl::MutexGuard aGuard(m_aMutex);
103  return m_bEnabled;
104 }
105 
106 void SAL_CALL OFormatCondition::setEnabled( sal_Bool _enabled )
107 {
108  set(PROPERTY_ENABLED,_enabled,m_bEnabled);
109 }
110 
111 OUString SAL_CALL OFormatCondition::getFormula()
112 {
113  ::osl::MutexGuard aGuard(m_aMutex);
114  return m_sFormula;
115 }
116 
117 void SAL_CALL OFormatCondition::setFormula( const OUString& _formula )
118 {
119  set(PROPERTY_FORMULA,_formula,m_sFormula);
120 }
121 
122 // XReportControlFormat
123 REPORTCONTROLFORMAT_IMPL(OFormatCondition,m_aFormatProperties)
124 
125 } // namespace reportdesign
126 
127 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
129  css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
130 {
131  return cppu::acquire(new reportdesign::OFormatCondition(context));
132 }
133 
134 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
IMPLEMENT_FORWARD_XINTERFACE2(ChildWindowPane, ChildWindowPaneInterfaceBase, Pane)
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
osl::Mutex m_aMutex
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() SAL_OVERRIDE
virtual OUString SAL_CALL getFormula() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
mutable::osl::Mutex m_aMutex
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
virtual void SAL_CALL removePropertyChangeListener(rtl::OUString const &propertyName, css::uno::Reference< css::beans::XPropertyChangeListener > const &listener) SAL_OVERRIDE
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
::cppu::WeakComponentImplHelper< css::report::XFormatCondition,css::lang::XServiceInfo > FormatConditionBase
::cppu::PropertySetMixin< css::report::XFormatCondition > FormatConditionPropertySet
#define SERVICE_FORMATCONDITION
Definition: strings.hxx:25
virtual void SAL_CALL setPropertyValue(rtl::OUString const &propertyName, css::uno::Any const &value) SAL_OVERRIDE
virtual void SAL_CALL setEnabled(sal_Bool _enabled) override
virtual sal_Bool SAL_CALL getEnabled() override
#define PROPERTY_FORMULA
Definition: strings.hxx:195
unsigned char sal_Bool
#define REPORTCONTROLFORMAT_IMPL(clazz, varName)
virtual void SAL_CALL addPropertyChangeListener(rtl::OUString const &propertyName, css::uno::Reference< css::beans::XPropertyChangeListener > const &listener) SAL_OVERRIDE
#define PROPERTY_ENABLED
Definition: strings.hxx:139
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * reportdesign_OFormatCondition_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual ~OFormatCondition() override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
virtual css::uno::Any SAL_CALL getPropertyValue(rtl::OUString const &propertyName) SAL_OVERRIDE
void set(const OUString &_sProperty, sal_Int16 Value, css::style::ParagraphAdjust &_member)
virtual void SAL_CALL addVetoableChangeListener(rtl::OUString const &propertyName, css::uno::Reference< css::beans::XVetoableChangeListener > const &listener) SAL_OVERRIDE
OFormatCondition(const OFormatCondition &)=delete
virtual void SAL_CALL setFormula(const OUString &_formula) override
virtual void SAL_CALL removeVetoableChangeListener(rtl::OUString const &propertyName, css::uno::Reference< css::beans::XVetoableChangeListener > const &listener) SAL_OVERRIDE
virtual OUString SAL_CALL getImplementationName() override