Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef INCLUDED_CONNECTIVITY_SDBCX_VKEY_HXX
21 : #define INCLUDED_CONNECTIVITY_SDBCX_VKEY_HXX
22 :
23 :
24 : #include <comphelper/IdPropArrayHelper.hxx>
25 : #include <connectivity/CommonTools.hxx>
26 : #include <comphelper/broadcasthelper.hxx>
27 : #include <connectivity/sdbcx/VTypeDef.hxx>
28 : #include <com/sun/star/container/XNamed.hpp>
29 : #include <connectivity/sdbcx/IRefreshable.hxx>
30 : #include <connectivity/sdbcx/VDescriptor.hxx>
31 : #include <connectivity/dbtoolsdllapi.hxx>
32 : #include <cppuhelper/implbase1.hxx>
33 : #include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
34 : #include <boost/shared_ptr.hpp>
35 :
36 : namespace connectivity
37 : {
38 : namespace sdbcx
39 : {
40 :
41 0 : struct OOO_DLLPUBLIC_DBTOOLS KeyProperties
42 : {
43 : ::std::vector< OUString> m_aKeyColumnNames;
44 : OUString m_ReferencedTable;
45 : sal_Int32 m_Type;
46 : sal_Int32 m_UpdateRule;
47 : sal_Int32 m_DeleteRule;
48 0 : KeyProperties(const OUString& _ReferencedTable,
49 : sal_Int32 _Type,
50 : sal_Int32 _UpdateRule,
51 : sal_Int32 _DeleteRule)
52 : :m_ReferencedTable(_ReferencedTable),
53 : m_Type(_Type),
54 : m_UpdateRule(_UpdateRule),
55 0 : m_DeleteRule(_DeleteRule)
56 0 : {}
57 0 : KeyProperties():m_Type(0),m_UpdateRule(0),m_DeleteRule(0){}
58 : };
59 : typedef ::boost::shared_ptr< KeyProperties > TKeyProperties;
60 : typedef ::cppu::ImplHelper1< ::com::sun::star::sdbcx::XDataDescriptorFactory > OKey_BASE;
61 : class OCollection;
62 :
63 : class OOO_DLLPUBLIC_DBTOOLS OKey :
64 : public comphelper::OBaseMutex,
65 : public ODescriptor_BASE,
66 : public IRefreshableColumns,
67 : public ::comphelper::OIdPropertyArrayUsageHelper<OKey>,
68 : public ODescriptor,
69 : public OKey_BASE
70 : {
71 : protected:
72 : TKeyProperties m_aProps;
73 : OCollection* m_pColumns;
74 :
75 : using ODescriptor_BASE::rBHelper;
76 : // OPropertyArrayUsageHelper
77 : virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const SAL_OVERRIDE;
78 : // OPropertySetHelper
79 : virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() SAL_OVERRIDE;
80 : public:
81 : OKey(bool _bCase);
82 : OKey(const OUString& _Name,const TKeyProperties& _rProps,bool _bCase);
83 :
84 : virtual ~OKey( );
85 :
86 : DECLARE_SERVICE_INFO();
87 : //XInterface
88 : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
89 : virtual void SAL_CALL acquire() throw() SAL_OVERRIDE;
90 : virtual void SAL_CALL release() throw() SAL_OVERRIDE;
91 : //XTypeProvider
92 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
93 : // ODescriptor
94 : virtual void construct() SAL_OVERRIDE;
95 :
96 : // ::cppu::OComponentHelper
97 : virtual void SAL_CALL disposing() SAL_OVERRIDE;
98 : // XPropertySet
99 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
100 : // XColumnsSupplier
101 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getColumns( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
102 :
103 : // XNamed
104 : virtual OUString SAL_CALL getName( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
105 : virtual void SAL_CALL setName( const OUString& aName ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
106 : // XDataDescriptorFactory
107 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL createDataDescriptor( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
108 : };
109 : }
110 : }
111 :
112 : #endif // INCLUDED_CONNECTIVITY_SDBCX_VKEY_HXX
113 :
114 :
115 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|