1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: HelperCollections.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef DBA_HELPERCOLLECTIONS_HXX
31 #define DBA_HELPERCOLLECTIONS_HXX
33 #ifndef _CONNECTIVITY_SDBCX_COLLECTION_HXX_
34 #include "connectivity/sdbcx/VCollection.hxx"
36 #ifndef _CONNECTIVITY_DBTOOLS_HXX_
37 #include <connectivity/dbtools.hxx>
39 #ifndef _DBHELPER_DBCONVERSION_HXX_
40 #include <connectivity/dbconversion.hxx>
42 #ifndef _CONNECTIVITY_SDBCX_COLUMN_HXX_
43 #include <connectivity/PColumn.hxx>
46 #include <vos/ref.hxx>
51 using namespace dbtools
;
52 using namespace comphelper
;
53 using namespace connectivity
;
54 using namespace ::com::sun::star::uno
;
55 using namespace ::com::sun::star::beans
;
56 using namespace ::com::sun::star::sdbc
;
57 using namespace ::com::sun::star::sdb
;
58 using namespace ::com::sun::star::sdbcx
;
59 using namespace ::com::sun::star::container
;
60 using namespace ::com::sun::star::lang
;
61 using namespace ::com::sun::star::script
;
62 using namespace ::cppu
;
63 using namespace ::osl
;
64 // -----------------------------------------------------------------------------
65 typedef connectivity::sdbcx::OCollection OPrivateColumns_Base
;
66 class OPrivateColumns
: public OPrivateColumns_Base
68 ::vos::ORef
< ::connectivity::OSQLColumns
> m_aColumns
;
70 virtual connectivity::sdbcx::ObjectType
createObject(const ::rtl::OUString
& _rName
);
71 virtual void impl_refresh() throw(RuntimeException
) {}
72 virtual Reference
< XPropertySet
> createDescriptor()
77 OPrivateColumns(const ::vos::ORef
< ::connectivity::OSQLColumns
>& _rColumns
,
79 ::cppu::OWeakObject
& _rParent
,
80 ::osl::Mutex
& _rMutex
,
81 const ::std::vector
< ::rtl::OUString
> &_rVector
,
82 sal_Bool _bUseAsIndex
= sal_False
85 /** creates a columns instance as above, but taking the names from the columns itself
87 static OPrivateColumns
* createWithIntrinsicNames(
88 const ::vos::ORef
< ::connectivity::OSQLColumns
>& _rColumns
,
90 ::cppu::OWeakObject
& _rParent
,
94 virtual void SAL_CALL
disposing(void);
96 typedef connectivity::sdbcx::OCollection OPrivateTables_BASE
;
98 //==========================================================================
100 //==========================================================================
101 class OPrivateTables
: public OPrivateTables_BASE
103 OSQLTables m_aTables
;
105 virtual connectivity::sdbcx::ObjectType
createObject(const ::rtl::OUString
& _rName
);
106 virtual void impl_refresh() throw(RuntimeException
) {}
107 virtual Reference
< XPropertySet
> createDescriptor()
112 OPrivateTables( const OSQLTables
& _rTables
,
114 ::cppu::OWeakObject
& _rParent
,
115 ::osl::Mutex
& _rMutex
,
116 const ::std::vector
< ::rtl::OUString
> &_rVector
117 ) : sdbcx::OCollection(_rParent
,_bCase
,_rMutex
,_rVector
)
121 virtual void SAL_CALL
disposing(void)
124 // we're not owner of the objects we're holding, instead the object we got in our ctor is
125 // So we're not allowed to dispose our elements.
127 OPrivateTables_BASE::disposing();
131 #endif // DBA_HELPERCOLLECTIONS_HXX