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