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 uno::Reference< uno::XInterface > OFormatCondition::create(uno::Reference< uno::XComponentContext > const & xContext)
31 {
32  return *(new OFormatCondition(xContext));
33 }
34 
35 
36 OFormatCondition::OFormatCondition(uno::Reference< uno::XComponentContext > const & _xContext)
38 ,FormatConditionPropertySet(_xContext,IMPLEMENTS_PROPERTY_SET,uno::Sequence< OUString >())
39 ,m_bEnabled(true)
40 {
41 }
42 
44 {
45 }
46 
48 
49 void SAL_CALL OFormatCondition::dispose()
50 {
52  cppu::WeakComponentImplHelperBase::dispose();
53 }
54 
56 {
57  return "com.sun.star.comp.report.OFormatCondition";
58 }
59 
60 
62 {
64 }
65 
67 {
68  uno::Sequence< OUString > aServices { SERVICE_FORMATCONDITION };
69 
70  return aServices;
71 }
72 
73 uno::Sequence< OUString > SAL_CALL OFormatCondition::getSupportedServiceNames( )
74 {
76 }
77 
78 sal_Bool SAL_CALL OFormatCondition::supportsService(const OUString& ServiceName)
79 {
80  return cppu::supportsService(this, ServiceName);
81 }
82 
83 uno::Reference< beans::XPropertySetInfo > SAL_CALL OFormatCondition::getPropertySetInfo( )
84 {
86 }
87 
88 void SAL_CALL OFormatCondition::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue )
89 {
90  FormatConditionPropertySet::setPropertyValue( aPropertyName, aValue );
91 }
92 
93 uno::Any SAL_CALL OFormatCondition::getPropertyValue( const OUString& PropertyName )
94 {
96 }
97 
98 void SAL_CALL OFormatCondition::addPropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener )
99 {
100  FormatConditionPropertySet::addPropertyChangeListener( aPropertyName, xListener );
101 }
102 
103 void SAL_CALL OFormatCondition::removePropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener )
104 {
106 }
107 
108 void SAL_CALL OFormatCondition::addVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener )
109 {
111 }
112 
113 void SAL_CALL OFormatCondition::removeVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener )
114 {
116 }
117 
118 // XFormatCondition
120 {
121  ::osl::MutexGuard aGuard(m_aMutex);
122  return m_bEnabled;
123 }
124 
125 void SAL_CALL OFormatCondition::setEnabled( sal_Bool _enabled )
126 {
127  set(PROPERTY_ENABLED,_enabled,m_bEnabled);
128 }
129 
130 OUString SAL_CALL OFormatCondition::getFormula()
131 {
132  ::osl::MutexGuard aGuard(m_aMutex);
133  return m_sFormula;
134 }
135 
136 void SAL_CALL OFormatCondition::setFormula( const OUString& _formula )
137 {
138  set(PROPERTY_FORMULA,_formula,m_sFormula);
139 }
140 
141 // XReportControlFormat
142 REPORTCONTROLFORMAT_IMPL(OFormatCondition,m_aFormatProperties)
143 
144 } // namespace reportdesign
145 
146 
147 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static OUString getImplementationName_Static()
IMPLEMENT_FORWARD_XINTERFACE2(ChildWindowPane, ChildWindowPaneInterfaceBase, Pane)
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() SAL_OVERRIDE
virtual OUString SAL_CALL getFormula() override
static css::uno::Sequence< OUString > getSupportedServiceNames_Static()
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)
std::mutex m_aMutex
::cppu::WeakComponentImplHelper< css::report::XFormatCondition,css::lang::XServiceInfo > FormatConditionBase
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:189
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:133
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
static css::uno::Reference< css::uno::XInterface > create(css::uno::Reference< css::uno::XComponentContext > const &xContext)
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
constexpr OUStringLiteral SERVICE_FORMATCONDITION
Definition: strings.hxx:25
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