Branch data 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 _CONNECTIVITY_SDBCX_KEY_HXX_
21 : : #define _CONNECTIVITY_SDBCX_KEY_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< ::rtl::OUString> m_aKeyColumnNames;
44 : : ::rtl::OUString m_ReferencedTable;
45 : : sal_Int32 m_Type;
46 : : sal_Int32 m_UpdateRule;
47 : : sal_Int32 m_DeleteRule;
48 : 0 : KeyProperties(const ::rtl::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;
78 : : // OPropertySetHelper
79 : : virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
80 : : public:
81 : : OKey(sal_Bool _bCase);
82 : : OKey(const ::rtl::OUString& _Name,const TKeyProperties& _rProps,sal_Bool _bCase);
83 : : /*OKey( const ::rtl::OUString& _Name,
84 : : const ::rtl::OUString& _ReferencedTable,
85 : : sal_Int32 _Type,
86 : : sal_Int32 _UpdateRule,
87 : : sal_Int32 _DeleteRule,
88 : : sal_Bool _bCase);*/
89 : :
90 : : virtual ~OKey( );
91 : :
92 : : DECLARE_SERVICE_INFO();
93 : : //XInterface
94 : : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
95 : : virtual void SAL_CALL acquire() throw();
96 : : virtual void SAL_CALL release() throw();
97 : : //XTypeProvider
98 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
99 : : // ODescriptor
100 : : virtual void construct();
101 : :
102 : : // ::cppu::OComponentHelper
103 : : virtual void SAL_CALL disposing();
104 : : // XPropertySet
105 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
106 : : // XColumnsSupplier
107 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getColumns( ) throw(::com::sun::star::uno::RuntimeException);
108 : :
109 : : // XNamed
110 : : virtual ::rtl::OUString SAL_CALL getName( ) throw(::com::sun::star::uno::RuntimeException);
111 : : virtual void SAL_CALL setName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
112 : : // XDataDescriptorFactory
113 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL createDataDescriptor( ) throw(::com::sun::star::uno::RuntimeException);
114 : : };
115 : : }
116 : : }
117 : :
118 : : #endif // _CONNECTIVITY_SDBCX_KEY_HXX_
119 : :
120 : :
121 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|