1 /*************************************************************************
3 * $RCSfile: pq_xbase.hxx,v $
7 * last change: $Author: jbu $ $Date: 2004/06/10 15:26:59 $
9 * The Contents of this file are made available subject to the terms of
10 * either of the following licenses
12 * - GNU Lesser General Public License Version 2.1
13 * - Sun Industry Standards Source License Version 1.1
15 * Sun Microsystems Inc., October, 2000
17 * GNU Lesser General Public License Version 2.1
18 * =============================================
19 * Copyright 2000 by Sun Microsystems, Inc.
20 * 901 San Antonio Road, Palo Alto, CA 94303, USA
22 * This library is free software; you can redistribute it and/or
23 * modify it under the terms of the GNU Lesser General Public
24 * License version 2.1, as published by the Free Software Foundation.
26 * This library is distributed in the hope that it will be useful,
27 * but WITHOUT ANY WARRANTY; without even the implied warranty of
28 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
29 * Lesser General Public License for more details.
31 * You should have received a copy of the GNU Lesser General Public
32 * License along with this library; if not, write to the Free Software
33 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
37 * Sun Industry Standards Source License Version 1.1
38 * =================================================
39 * The contents of this file are subject to the Sun Industry Standards
40 * Source License Version 1.1 (the "License"); You may not use this file
41 * except in compliance with the License. You may obtain a copy of the
42 * License at http://www.openoffice.org/license.html.
44 * Software provided under this License is provided on an "AS IS" basis,
45 * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
46 * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
47 * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
48 * See the License for the specific provisions governing your rights and
49 * obligations concerning the Software.
51 * The Initial Developer of the Original Code is: Joerg Budischewski
53 * Copyright: 2000 by Sun Microsystems, Inc.
55 * All Rights Reserved.
57 * Contributor(s): Joerg Budischewski
60 ************************************************************************/
62 #ifndef _PQ_REFL_BASE_HXX_
63 #define _PQ_REFL_BASE_HXX_
64 #include <cppuhelper/propshlp.hxx>
65 #include <cppuhelper/component.hxx>
67 #include <com/sun/star/lang/XServiceInfo.hpp>
68 #include <com/sun/star/container/XNamed.hpp>
70 #include "pq_xcontainer.hxx"
72 namespace pq_sdbc_driver
75 class ReflectionBase
:
76 public cppu::OComponentHelper
,
77 public cppu::OPropertySetHelper
,
78 public com::sun::star::lang::XServiceInfo
,
79 public com::sun::star::sdbcx::XDataDescriptorFactory
,
80 public com::sun::star::container::XNamed
83 const rtl::OUString m_implName
;
84 const ::com::sun::star::uno::Sequence
< rtl::OUString
> m_supportedServices
;
85 ::rtl::Reference
< RefCountedMutex
> m_refMutex
;
86 ::com::sun::star::uno::Reference
< com::sun::star::sdbc::XConnection
> m_conn
;
87 ConnectionSettings
*m_pSettings
;
88 cppu::IPropertyArrayHelper
& m_propsDesc
;
89 com::sun::star::uno::Sequence
< com::sun::star::uno::Any
> m_values
;
92 const ::rtl::OUString
&implName
,
93 const ::com::sun::star::uno::Sequence
< rtl::OUString
> &supportedServices
,
94 const ::rtl::Reference
< RefCountedMutex
> refMutex
,
95 const ::com::sun::star::uno::Reference
< com::sun::star::sdbc::XConnection
> &conn
,
96 ConnectionSettings
*pSettings
,
97 cppu::IPropertyArrayHelper
& props
/* must survive this object !*/ );
100 void copyValuesFrom( const com::sun::star::uno::Reference
< com::sun::star::beans::XPropertySet
> &set
);
102 public: // for initialization purposes only, not exported via an interface !
103 void setPropertyValue_NoBroadcast_public(
104 const rtl::OUString
& name
, const com::sun::star::uno::Any
& value
);
107 virtual void SAL_CALL
acquire() throw() { OComponentHelper::acquire(); }
108 virtual void SAL_CALL
release() throw() { OComponentHelper::release(); }
109 virtual com::sun::star::uno::Any SAL_CALL
queryInterface(
110 const com::sun::star::uno::Type
& reqType
)
111 throw (com::sun::star::uno::RuntimeException
);
113 public: // OPropertySetHelper
114 virtual cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper();
116 virtual sal_Bool SAL_CALL
convertFastPropertyValue(
117 ::com::sun::star::uno::Any
& rConvertedValue
,
118 ::com::sun::star::uno::Any
& rOldValue
,
120 const ::com::sun::star::uno::Any
& rValue
)
121 throw (::com::sun::star::lang::IllegalArgumentException
);
123 virtual void SAL_CALL
setFastPropertyValue_NoBroadcast(
125 const ::com::sun::star::uno::Any
& rValue
)
126 throw (::com::sun::star::uno::Exception
);
128 virtual void SAL_CALL
getFastPropertyValue(
129 ::com::sun::star::uno::Any
& rValue
,
130 sal_Int32 nHandle
) const;
133 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo()
134 throw(com::sun::star::uno::RuntimeException
);
136 public: // XServiceInfo
137 virtual rtl::OUString SAL_CALL
getImplementationName()
138 throw(::com::sun::star::uno::RuntimeException
);
139 virtual sal_Bool SAL_CALL
supportsService(const rtl::OUString
& ServiceName
)
140 throw(::com::sun::star::uno::RuntimeException
);
141 virtual com::sun::star::uno::Sequence
< rtl::OUString
> SAL_CALL
getSupportedServiceNames(void)
142 throw(::com::sun::star::uno::RuntimeException
);
144 public: // XTypeProvider, first implemented by OPropertySetHelper
145 virtual com::sun::star::uno::Sequence
< com::sun::star::uno::Type
> SAL_CALL
getTypes()
146 throw( com::sun::star::uno::RuntimeException
);
147 virtual com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId()
148 throw( com::sun::star::uno::RuntimeException
);
150 public: // XDataDescriptorFactory
151 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> SAL_CALL
152 createDataDescriptor( ) throw (::com::sun::star::uno::RuntimeException
) = 0;
155 virtual ::rtl::OUString SAL_CALL
getName( ) throw (::com::sun::star::uno::RuntimeException
);
156 virtual void SAL_CALL
setName( const ::rtl::OUString
& aName
) throw (::com::sun::star::uno::RuntimeException
);