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 HEADER_PQ_KEY_HXX_
38 : #define HEADER_PQ_KEY_HXX_
39 :
40 : #include <cppuhelper/component.hxx>
41 : #include <cppuhelper/propshlp.hxx>
42 :
43 : #include <com/sun/star/lang/XServiceInfo.hpp>
44 : #include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
45 : #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
46 :
47 : #include "pq_connection.hxx"
48 : #include "pq_xbase.hxx"
49 :
50 : namespace pq_sdbc_driver
51 : {
52 :
53 0 : class Key : public ReflectionBase,
54 : public com::sun::star::sdbcx::XColumnsSupplier
55 : {
56 : ::com::sun::star::uno::Reference< com::sun::star::sdbc::XDatabaseMetaData > m_meta;
57 : ::com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > m_keyColumns;
58 :
59 : OUString m_schemaName;
60 : OUString m_tableName;
61 :
62 : public:
63 : Key( const ::rtl::Reference< RefCountedMutex > & refMutex,
64 : const ::com::sun::star::uno::Reference< com::sun::star::sdbc::XConnection > & connection,
65 : ConnectionSettings *pSettings,
66 : const OUString &schemaName,
67 : const OUString &tableName);
68 :
69 : public: // XInterface
70 0 : virtual void SAL_CALL acquire() throw() SAL_OVERRIDE { OComponentHelper::acquire(); }
71 0 : virtual void SAL_CALL release() throw() SAL_OVERRIDE { OComponentHelper::release(); }
72 : virtual com::sun::star::uno::Any SAL_CALL queryInterface(
73 : const com::sun::star::uno::Type & reqType )
74 : throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
75 :
76 : public: // XColumnsSupplier
77 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL
78 : getColumns( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
79 :
80 : public: // XTypeProvider, first implemented by OPropertySetHelper
81 : virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes()
82 : throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
83 : virtual com::sun::star::uno::Sequence< sal_Int8> SAL_CALL getImplementationId()
84 : throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
85 :
86 : public: // XDataDescriptorFactory
87 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL
88 : createDataDescriptor( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
89 :
90 : };
91 :
92 :
93 0 : class KeyDescriptor : public ReflectionBase, public com::sun::star::sdbcx::XColumnsSupplier
94 : {
95 : ::com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > m_keyColumns;
96 :
97 : public:
98 : KeyDescriptor( const ::rtl::Reference< RefCountedMutex > & refMutex,
99 : const ::com::sun::star::uno::Reference< com::sun::star::sdbc::XConnection > & connection,
100 : ConnectionSettings *pSettings );
101 :
102 : public: // XInterface
103 0 : virtual void SAL_CALL acquire() throw() SAL_OVERRIDE { OComponentHelper::acquire(); }
104 0 : virtual void SAL_CALL release() throw() SAL_OVERRIDE { OComponentHelper::release(); }
105 : virtual com::sun::star::uno::Any SAL_CALL queryInterface(
106 : const com::sun::star::uno::Type & reqType )
107 : throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
108 :
109 : public: // XColumnsSupplier
110 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL
111 : getColumns( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
112 :
113 : public: // XTypeProvider, first implemented by OPropertySetHelper
114 : virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes()
115 : throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
116 : virtual com::sun::star::uno::Sequence< sal_Int8> SAL_CALL getImplementationId()
117 : throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
118 :
119 : public: // XDataDescriptorFactory
120 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL
121 : createDataDescriptor( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
122 : };
123 :
124 : }
125 :
126 :
127 : #endif
128 :
129 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|