Line data Source code
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 <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"
30 :
31 : namespace reportdesign
32 : {
33 :
34 : using namespace com::sun::star;
35 : using namespace comphelper;
36 :
37 1 : uno::Reference< uno::XInterface > OFormatCondition::create(uno::Reference< uno::XComponentContext > const & xContext)
38 : {
39 1 : return *(new OFormatCondition(xContext));
40 : }
41 :
42 :
43 1 : 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 1 : ,m_bEnabled(true)
47 : {
48 1 : }
49 :
50 2 : OFormatCondition::~OFormatCondition()
51 : {
52 2 : }
53 :
54 26 : IMPLEMENT_FORWARD_XINTERFACE2(OFormatCondition,FormatConditionBase,FormatConditionPropertySet)
55 :
56 1 : void SAL_CALL OFormatCondition::dispose() throw(uno::RuntimeException, std::exception)
57 : {
58 1 : FormatConditionPropertySet::dispose();
59 1 : cppu::WeakComponentImplHelperBase::dispose();
60 1 : }
61 :
62 9 : OUString OFormatCondition::getImplementationName_Static( ) throw(uno::RuntimeException)
63 : {
64 9 : return OUString("com.sun.star.comp.report.OFormatCondition");
65 : }
66 :
67 :
68 1 : OUString SAL_CALL OFormatCondition::getImplementationName( ) throw(uno::RuntimeException, std::exception)
69 : {
70 1 : return getImplementationName_Static();
71 : }
72 :
73 2 : uno::Sequence< OUString > OFormatCondition::getSupportedServiceNames_Static( ) throw(uno::RuntimeException)
74 : {
75 2 : uno::Sequence< OUString > aServices(1);
76 2 : aServices.getArray()[0] = SERVICE_FORMATCONDITION;
77 :
78 2 : return aServices;
79 : }
80 :
81 1 : uno::Sequence< OUString > SAL_CALL OFormatCondition::getSupportedServiceNames( ) throw(uno::RuntimeException, std::exception)
82 : {
83 1 : return getSupportedServiceNames_Static();
84 : }
85 :
86 0 : sal_Bool SAL_CALL OFormatCondition::supportsService(const OUString& ServiceName) throw( uno::RuntimeException, std::exception )
87 : {
88 0 : return cppu::supportsService(this, ServiceName);
89 : }
90 :
91 0 : uno::Reference< beans::XPropertySetInfo > SAL_CALL OFormatCondition::getPropertySetInfo( ) throw(uno::RuntimeException, std::exception)
92 : {
93 0 : return FormatConditionPropertySet::getPropertySetInfo();
94 : }
95 :
96 0 : 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 : {
98 0 : FormatConditionPropertySet::setPropertyValue( aPropertyName, aValue );
99 0 : }
100 :
101 0 : uno::Any SAL_CALL OFormatCondition::getPropertyValue( const OUString& PropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
102 : {
103 0 : return FormatConditionPropertySet::getPropertyValue( PropertyName);
104 : }
105 :
106 0 : void SAL_CALL OFormatCondition::addPropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
107 : {
108 0 : FormatConditionPropertySet::addPropertyChangeListener( aPropertyName, xListener );
109 0 : }
110 :
111 0 : void SAL_CALL OFormatCondition::removePropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
112 : {
113 0 : FormatConditionPropertySet::removePropertyChangeListener( aPropertyName, aListener );
114 0 : }
115 :
116 0 : void SAL_CALL OFormatCondition::addVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
117 : {
118 0 : FormatConditionPropertySet::addVetoableChangeListener( PropertyName, aListener );
119 0 : }
120 :
121 0 : void SAL_CALL OFormatCondition::removeVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
122 : {
123 0 : FormatConditionPropertySet::removeVetoableChangeListener( PropertyName, aListener );
124 0 : }
125 :
126 : // XFormatCondition
127 0 : sal_Bool SAL_CALL OFormatCondition::getEnabled() throw (uno::RuntimeException, std::exception)
128 : {
129 0 : ::osl::MutexGuard aGuard(m_aMutex);
130 0 : return m_bEnabled;
131 : }
132 :
133 0 : void SAL_CALL OFormatCondition::setEnabled( sal_Bool _enabled ) throw (uno::RuntimeException, std::exception)
134 : {
135 0 : set(PROPERTY_ENABLED,_enabled,m_bEnabled);
136 0 : }
137 :
138 0 : OUString SAL_CALL OFormatCondition::getFormula() throw (uno::RuntimeException, std::exception)
139 : {
140 0 : ::osl::MutexGuard aGuard(m_aMutex);
141 0 : return m_sFormula;
142 : }
143 :
144 0 : void SAL_CALL OFormatCondition::setFormula( const OUString& _formula ) throw (uno::RuntimeException, std::exception)
145 : {
146 0 : set(PROPERTY_FORMULA,_formula,m_sFormula);
147 0 : }
148 :
149 : // XReportControlFormat
150 0 : REPORTCONTROLFORMAT_IMPL(OFormatCondition,m_aFormatProperties)
151 :
152 : } // namespace reportdesign
153 :
154 :
155 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|