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 : : #ifndef DBA_HELPERCOLLECTIONS_HXX
20 : : #define DBA_HELPERCOLLECTIONS_HXX
21 : :
22 : : #include "connectivity/sdbcx/VCollection.hxx"
23 : : #include <connectivity/dbtools.hxx>
24 : : #include <connectivity/dbconversion.hxx>
25 : : #include <connectivity/PColumn.hxx>
26 : : #include <rtl/ref.hxx>
27 : :
28 : : namespace dbaccess
29 : : {
30 : : using namespace dbtools;
31 : : using namespace comphelper;
32 : : using namespace connectivity;
33 : : using namespace ::com::sun::star::uno;
34 : : using namespace ::com::sun::star::beans;
35 : : using namespace ::com::sun::star::sdbc;
36 : : using namespace ::com::sun::star::sdb;
37 : : using namespace ::com::sun::star::sdbcx;
38 : : using namespace ::com::sun::star::container;
39 : : using namespace ::com::sun::star::lang;
40 : : using namespace ::com::sun::star::script;
41 : : using namespace ::cppu;
42 : : using namespace ::osl;
43 : :
44 : : typedef connectivity::sdbcx::OCollection OPrivateColumns_Base;
45 [ + - ][ - + ]: 300 : class OPrivateColumns : public OPrivateColumns_Base
46 : : {
47 : : ::rtl::Reference< ::connectivity::OSQLColumns> m_aColumns;
48 : : protected:
49 : : virtual connectivity::sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
50 : 0 : virtual void impl_refresh() throw(RuntimeException) {}
51 : 0 : virtual Reference< XPropertySet > createDescriptor()
52 : : {
53 : 0 : return NULL;
54 : : }
55 : : public:
56 : : OPrivateColumns(const ::rtl::Reference< ::connectivity::OSQLColumns>& _rColumns,
57 : : sal_Bool _bCase,
58 : : ::cppu::OWeakObject& _rParent,
59 : : ::osl::Mutex& _rMutex,
60 : : const ::std::vector< ::rtl::OUString> &_rVector,
61 : : sal_Bool _bUseAsIndex = sal_False
62 : : );
63 : :
64 : : /** creates a columns instance as above, but taking the names from the columns itself
65 : : */
66 : : static OPrivateColumns* createWithIntrinsicNames(
67 : : const ::rtl::Reference< ::connectivity::OSQLColumns >& _rColumns,
68 : : sal_Bool _bCase,
69 : : ::cppu::OWeakObject& _rParent,
70 : : ::osl::Mutex& _rMutex
71 : : );
72 : :
73 : : virtual void SAL_CALL disposing(void);
74 : : };
75 : : typedef connectivity::sdbcx::OCollection OPrivateTables_BASE;
76 : :
77 : : //==========================================================================
78 : : //= OPrivateTables
79 : : //==========================================================================
80 [ - + ]: 164 : class OPrivateTables : public OPrivateTables_BASE
81 : : {
82 : : OSQLTables m_aTables;
83 : : protected:
84 : : virtual connectivity::sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
85 : 0 : virtual void impl_refresh() throw(RuntimeException) {}
86 : 0 : virtual Reference< XPropertySet > createDescriptor()
87 : : {
88 : 0 : return NULL;
89 : : }
90 : : public:
91 : 82 : OPrivateTables( const OSQLTables& _rTables,
92 : : sal_Bool _bCase,
93 : : ::cppu::OWeakObject& _rParent,
94 : : ::osl::Mutex& _rMutex,
95 : : const ::std::vector< ::rtl::OUString> &_rVector
96 : : ) : sdbcx::OCollection(_rParent,_bCase,_rMutex,_rVector)
97 [ + - ]: 82 : ,m_aTables(_rTables)
98 : : {
99 : 82 : }
100 : 82 : virtual void SAL_CALL disposing(void)
101 : : {
102 : 82 : clear_NoDispose();
103 : : // we're not owner of the objects we're holding, instead the object we got in our ctor is
104 : : // So we're not allowed to dispose our elements.
105 : 82 : m_aTables.clear();
106 : 82 : OPrivateTables_BASE::disposing();
107 : 82 : }
108 : : };
109 : : }
110 : : #endif // DBA_HELPERCOLLECTIONS_HXX
111 : :
112 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|