LibreOffice Module connectivity (master) 1
pq_xbase.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*************************************************************************
3 *
4 * Effective License of whole file:
5 *
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.
9 *
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.
14 *
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,
18 * MA 02111-1307 USA
19 *
20 * Parts "Copyright by Sun Microsystems, Inc" prior to August 2011:
21 *
22 * The Contents of this file are made available subject to the terms of
23 * the GNU Lesser General Public License Version 2.1
24 *
25 * Copyright: 2000 by Sun Microsystems, Inc.
26 *
27 * Contributor(s): Joerg Budischewski
28 *
29 * All parts contributed on or after August 2011:
30 *
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/.
34 *
35 ************************************************************************/
36
37#pragma once
40
41#include <com/sun/star/lang/XServiceInfo.hpp>
42#include <com/sun/star/container/XNamed.hpp>
43
44#include "pq_xcontainer.hxx"
45
46namespace pq_sdbc_driver
47{
48
49typedef ::cppu::WeakComponentImplHelper< css::lang::XServiceInfo,
50 css::sdbcx::XDataDescriptorFactory,
51 css::container::XNamed
53
57{
58protected:
59 const OUString m_implName;
60 const css::uno::Sequence< OUString > m_supportedServices;
62 css::uno::Reference< css::sdbc::XConnection > m_conn;
65 std::vector< css::uno::Any > m_values;
66public:
68 OUString implName,
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 !*/ );
74
75public:
76 void copyValuesFrom( const css::uno::Reference< css::beans::XPropertySet > &set );
77
78public: // for initialization purposes only, not exported via an interface !
80 const OUString & name, const css::uno::Any & value );
81
82public: //XInterface
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;
87
88public: // OPropertySetHelper
89 virtual cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
90
91 virtual sal_Bool SAL_CALL convertFastPropertyValue(
92 css::uno::Any & rConvertedValue,
93 css::uno::Any & rOldValue,
94 sal_Int32 nHandle,
95 const css::uno::Any& rValue ) override;
96
97 virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
98 sal_Int32 nHandle,
99 const css::uno::Any& rValue ) override;
100
101 using ::cppu::OPropertySetHelper::getFastPropertyValue;
102
103 void SAL_CALL getFastPropertyValue(
104 css::uno::Any& rValue,
105 sal_Int32 nHandle ) const override;
106
107 // XPropertySet
108 css::uno::Reference < css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override;
109
110public: // 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;
114
115public: // 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;
118
119public: // XDataDescriptorFactory
120 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL
121 createDataDescriptor( ) override = 0;
122
123public: // XNamed
124 virtual OUString SAL_CALL getName( ) override;
125 virtual void SAL_CALL setName( const OUString& aName ) override;
126
127};
128
129}
130
131/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &reqType) override
Definition: pq_xbase.cxx:163
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: pq_xbase.cxx:171
void copyValuesFrom(const css::uno::Reference< css::beans::XPropertySet > &set)
Definition: pq_xbase.cxx:176
void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
Definition: pq_xbase.cxx:119
virtual OUString SAL_CALL getImplementationName() override
Definition: pq_xbase.cxx:136
css::uno::Reference< css::sdbc::XConnection > m_conn
Definition: pq_xbase.hxx:62
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: pq_xbase.cxx:131
virtual cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
Definition: pq_xbase.cxx:77
::rtl::Reference< comphelper::RefCountedMutex > m_xMutex
Definition: pq_xbase.hxx:61
virtual void SAL_CALL release() noexcept override
Definition: pq_xbase.hxx:84
virtual sal_Bool SAL_CALL convertFastPropertyValue(css::uno::Any &rConvertedValue, css::uno::Any &rOldValue, sal_Int32 nHandle, const css::uno::Any &rValue) override
Definition: pq_xbase.cxx:82
virtual void SAL_CALL setName(const OUString &aName) override
Definition: pq_xbase.cxx:205
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: pq_xbase.cxx:146
const css::uno::Sequence< OUString > m_supportedServices
Definition: pq_xbase.hxx:60
std::vector< css::uno::Any > m_values
Definition: pq_xbase.hxx:65
cppu::IPropertyArrayHelper & m_propsDesc
Definition: pq_xbase.hxx:64
ConnectionSettings * m_pSettings
Definition: pq_xbase.hxx:63
virtual OUString SAL_CALL getName() override
Definition: pq_xbase.cxx:193
virtual void SAL_CALL acquire() noexcept override
Definition: pq_xbase.hxx:83
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
Definition: pq_xbase.cxx:108
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: pq_xbase.cxx:152
ReflectionBase(OUString implName, const css::uno::Sequence< OUString > &supportedServices, const ::rtl::Reference< comphelper::RefCountedMutex > &refMutex, css::uno::Reference< css::sdbc::XConnection > conn, ConnectionSettings *pSettings, cppu::IPropertyArrayHelper &props)
Definition: pq_xbase.cxx:59
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL createDataDescriptor() override=0
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: pq_xbase.cxx:141
void setPropertyValue_NoBroadcast_public(const OUString &name, const css::uno::Any &value)
Definition: pq_xbase.cxx:95
::cppu::WeakComponentImplHelper< css::lang::XServiceInfo, css::sdbcx::XDataDescriptorFactory, css::container::XNamed > ReflectionBase_BASE
Definition: pq_xbase.hxx:52
OUString name
Definition: pq_statics.cxx:74
unsigned char sal_Bool