Line data Source code
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 : #ifndef INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_POSTGRESQL_PQ_XBASE_HXX
38 : #define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_POSTGRESQL_PQ_XBASE_HXX
39 : #include <cppuhelper/propshlp.hxx>
40 : #include <cppuhelper/component.hxx>
41 :
42 : #include <com/sun/star/lang/XServiceInfo.hpp>
43 : #include <com/sun/star/container/XNamed.hpp>
44 :
45 : #include "pq_xcontainer.hxx"
46 :
47 : namespace pq_sdbc_driver
48 : {
49 :
50 0 : class ReflectionBase :
51 : public cppu::OComponentHelper,
52 : public cppu::OPropertySetHelper,
53 : public com::sun::star::lang::XServiceInfo,
54 : public com::sun::star::sdbcx::XDataDescriptorFactory,
55 : public com::sun::star::container::XNamed
56 : {
57 : protected:
58 : const OUString m_implName;
59 : const ::com::sun::star::uno::Sequence< OUString > m_supportedServices;
60 : ::rtl::Reference< RefCountedMutex > m_refMutex;
61 : ::com::sun::star::uno::Reference< com::sun::star::sdbc::XConnection > m_conn;
62 : ConnectionSettings *m_pSettings;
63 : cppu::IPropertyArrayHelper & m_propsDesc;
64 : com::sun::star::uno::Sequence< com::sun::star::uno::Any > m_values;
65 : public:
66 : ReflectionBase(
67 : const OUString &implName,
68 : const ::com::sun::star::uno::Sequence< OUString > &supportedServices,
69 : const ::rtl::Reference< RefCountedMutex > refMutex,
70 : const ::com::sun::star::uno::Reference< com::sun::star::sdbc::XConnection > &conn,
71 : ConnectionSettings *pSettings,
72 : cppu::IPropertyArrayHelper & props /* must survive this object !*/ );
73 :
74 : public:
75 : void copyValuesFrom( const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > &set );
76 :
77 : public: // for initialization purposes only, not exported via an interface !
78 : void setPropertyValue_NoBroadcast_public(
79 : const OUString & name, const com::sun::star::uno::Any & value );
80 :
81 : public: //XInterface
82 0 : virtual void SAL_CALL acquire() throw() SAL_OVERRIDE { OComponentHelper::acquire(); }
83 0 : virtual void SAL_CALL release() throw() SAL_OVERRIDE { OComponentHelper::release(); }
84 : virtual com::sun::star::uno::Any SAL_CALL queryInterface(
85 : const com::sun::star::uno::Type & reqType )
86 : throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
87 :
88 : public: // OPropertySetHelper
89 : virtual cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() SAL_OVERRIDE;
90 :
91 : virtual sal_Bool SAL_CALL convertFastPropertyValue(
92 : ::com::sun::star::uno::Any & rConvertedValue,
93 : ::com::sun::star::uno::Any & rOldValue,
94 : sal_Int32 nHandle,
95 : const ::com::sun::star::uno::Any& rValue )
96 : throw (::com::sun::star::lang::IllegalArgumentException) SAL_OVERRIDE;
97 :
98 : virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
99 : sal_Int32 nHandle,
100 : const ::com::sun::star::uno::Any& rValue )
101 : throw (::com::sun::star::uno::Exception, std::exception) SAL_OVERRIDE;
102 :
103 : using ::cppu::OPropertySetHelper::getFastPropertyValue;
104 :
105 : void SAL_CALL getFastPropertyValue(
106 : ::com::sun::star::uno::Any& rValue,
107 : sal_Int32 nHandle ) const SAL_OVERRIDE;
108 :
109 : // XPropertySet
110 : ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo()
111 : throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
112 :
113 : public: // XServiceInfo
114 : virtual OUString SAL_CALL getImplementationName()
115 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
116 : virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName)
117 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
118 : virtual com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames(void)
119 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
120 :
121 : public: // XTypeProvider, first implemented by OPropertySetHelper
122 : virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes()
123 : throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
124 : virtual com::sun::star::uno::Sequence< sal_Int8> SAL_CALL getImplementationId()
125 : throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
126 :
127 : public: // XDataDescriptorFactory
128 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL
129 : createDataDescriptor( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE = 0;
130 :
131 : public: // XNamed
132 : virtual OUString SAL_CALL getName( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
133 : virtual void SAL_CALL setName( const OUString& aName ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
134 :
135 : };
136 :
137 : }
138 : #endif
139 :
140 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|