Bump version to 5.0-14
[LibreOffice.git] / dbaccess / source / core / api / HelperCollections.hxx
blob13bed62eadc11a95df3840b7245714f341a70cd0
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_DBACCESS_SOURCE_CORE_API_HELPERCOLLECTIONS_HXX
20 #define INCLUDED_DBACCESS_SOURCE_CORE_API_HELPERCOLLECTIONS_HXX
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>
28 namespace dbaccess
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;
44 typedef connectivity::sdbcx::OCollection OPrivateColumns_Base;
45 class OPrivateColumns : public OPrivateColumns_Base
47 ::rtl::Reference< ::connectivity::OSQLColumns> m_aColumns;
48 protected:
49 virtual connectivity::sdbcx::ObjectType createObject(const OUString& _rName) SAL_OVERRIDE;
50 virtual void impl_refresh() throw(RuntimeException) SAL_OVERRIDE {}
51 virtual Reference< XPropertySet > createDescriptor() SAL_OVERRIDE
53 return NULL;
55 public:
56 OPrivateColumns(const ::rtl::Reference< ::connectivity::OSQLColumns>& _rColumns,
57 bool _bCase,
58 ::cppu::OWeakObject& _rParent,
59 ::osl::Mutex& _rMutex,
60 const ::std::vector< OUString> &_rVector,
61 bool _bUseAsIndex = false
64 /** creates a columns instance as above, but taking the names from the columns itself
66 static OPrivateColumns* createWithIntrinsicNames(
67 const ::rtl::Reference< ::connectivity::OSQLColumns >& _rColumns,
68 bool _bCase,
69 ::cppu::OWeakObject& _rParent,
70 ::osl::Mutex& _rMutex
73 virtual void SAL_CALL disposing() SAL_OVERRIDE;
75 typedef connectivity::sdbcx::OCollection OPrivateTables_BASE;
77 // OPrivateTables
78 class OPrivateTables : public OPrivateTables_BASE
80 OSQLTables m_aTables;
81 protected:
82 virtual connectivity::sdbcx::ObjectType createObject(const OUString& _rName) SAL_OVERRIDE;
83 virtual void impl_refresh() throw(RuntimeException) SAL_OVERRIDE {}
84 virtual Reference< XPropertySet > createDescriptor() SAL_OVERRIDE
86 return NULL;
88 public:
89 OPrivateTables( const OSQLTables& _rTables,
90 bool _bCase,
91 ::cppu::OWeakObject& _rParent,
92 ::osl::Mutex& _rMutex,
93 const ::std::vector< OUString> &_rVector
94 ) : sdbcx::OCollection(_rParent,_bCase,_rMutex,_rVector)
95 ,m_aTables(_rTables)
98 virtual void SAL_CALL disposing() SAL_OVERRIDE
100 clear_NoDispose();
101 // we're not owner of the objects we're holding, instead the object we got in our ctor is
102 // So we're not allowed to dispose our elements.
103 m_aTables.clear();
104 OPrivateTables_BASE::disposing();
108 #endif // INCLUDED_DBACCESS_SOURCE_CORE_API_HELPERCOLLECTIONS_HXX
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */