1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * Effective License of whole file:
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License version 2.1, as published by the Free Software Foundation.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 * Parts "Copyright by Sun Microsystems, Inc" prior to August 2011:
22 * The Contents of this file are made available subject to the terms of
23 * the GNU Lesser General Public License Version 2.1
25 * Copyright: 2000 by Sun Microsystems, Inc.
27 * Contributor(s): Joerg Budischewski
29 * All parts contributed on or after August 2011:
31 * This Source Code Form is subject to the terms of the Mozilla Public
32 * License, v. 2.0. If a copy of the MPL was not distributed with this
33 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
35 ************************************************************************/
38 #include <cppuhelper/propshlp.hxx>
39 #include <cppuhelper/compbase.hxx>
41 #include <com/sun/star/lang/XServiceInfo.hpp>
42 #include <com/sun/star/container/XNamed.hpp>
44 #include "pq_xcontainer.hxx"
46 namespace pq_sdbc_driver
49 typedef ::cppu::WeakComponentImplHelper
< css::lang::XServiceInfo
,
50 css::sdbcx::XDataDescriptorFactory
,
51 css::container::XNamed
52 > ReflectionBase_BASE
;
54 class ReflectionBase
:
55 public ReflectionBase_BASE
,
56 public cppu::OPropertySetHelper
59 const OUString m_implName
;
60 const css::uno::Sequence
< OUString
> m_supportedServices
;
61 ::rtl::Reference
< comphelper::RefCountedMutex
> m_xMutex
;
62 css::uno::Reference
< css::sdbc::XConnection
> m_conn
;
63 ConnectionSettings
*m_pSettings
;
64 cppu::IPropertyArrayHelper
& m_propsDesc
;
65 std::vector
< css::uno::Any
> m_values
;
69 const css::uno::Sequence
< OUString
> &supportedServices
,
70 const ::rtl::Reference
< comphelper::RefCountedMutex
>& refMutex
,
71 css::uno::Reference
< css::sdbc::XConnection
> conn
,
72 ConnectionSettings
*pSettings
,
73 cppu::IPropertyArrayHelper
& props
/* must survive this object !*/ );
76 void copyValuesFrom( const css::uno::Reference
< css::beans::XPropertySet
> &set
);
78 public: // for initialization purposes only, not exported via an interface !
79 void setPropertyValue_NoBroadcast_public(
80 const OUString
& name
, const css::uno::Any
& value
);
83 virtual void SAL_CALL
acquire() noexcept override
{ ReflectionBase_BASE::acquire(); }
84 virtual void SAL_CALL
release() noexcept override
{ ReflectionBase_BASE::release(); }
85 virtual css::uno::Any SAL_CALL
queryInterface(
86 const css::uno::Type
& reqType
) override
;
88 public: // OPropertySetHelper
89 virtual cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() override
;
91 virtual sal_Bool SAL_CALL
convertFastPropertyValue(
92 css::uno::Any
& rConvertedValue
,
93 css::uno::Any
& rOldValue
,
95 const css::uno::Any
& rValue
) override
;
97 virtual void SAL_CALL
setFastPropertyValue_NoBroadcast(
99 const css::uno::Any
& rValue
) override
;
101 using ::cppu::OPropertySetHelper::getFastPropertyValue
;
103 void SAL_CALL
getFastPropertyValue(
104 css::uno::Any
& rValue
,
105 sal_Int32 nHandle
) const override
;
108 css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo() override
;
110 public: // XServiceInfo
111 virtual OUString SAL_CALL
getImplementationName() override
;
112 virtual sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
) override
;
113 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
115 public: // XTypeProvider, first implemented by OPropertySetHelper
116 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() override
;
117 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
119 public: // XDataDescriptorFactory
120 virtual css::uno::Reference
< css::beans::XPropertySet
> SAL_CALL
121 createDataDescriptor( ) override
= 0;
124 virtual OUString SAL_CALL
getName( ) override
;
125 virtual void SAL_CALL
setName( const OUString
& aName
) override
;
131 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */