Update ooo320-m1
[ooovba.git] / dbaccess / source / core / inc / objectnameapproval.hxx
blobdcbf66a9485d63af48ec04fe125b5f3de941ea1b
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: objectnameapproval.hxx,v $
10 * $Revision: 1.3 $
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 ************************************************************************/
31 #ifndef DBACCESS_OBJECTNAMEAPPROVAL_HXX
32 #define DBACCESS_OBJECTNAMEAPPROVAL_HXX
34 #ifndef DBACCESS_CONTAINERAPPROVE_HXX
35 #include "containerapprove.hxx"
36 #endif
38 /** === begin UNO includes === **/
39 #ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_
40 #include <com/sun/star/sdbc/XConnection.hpp>
41 #endif
42 /** === end UNO includes === **/
44 //........................................................................
45 namespace dbaccess
47 //........................................................................
49 //====================================================================
50 //= ObjectNameApproval
51 //====================================================================
52 struct ObjectNameApproval_Impl;
53 /** implementation of the IContainerApprove interface which approves
54 elements for insertion into a query or tables container.
56 The only check done by this instance is whether the query name is
57 not already used, taking into account that in some databases, queries
58 and tables share the same namespace.
60 The class is not thread-safe.
62 class ObjectNameApproval : public IContainerApprove
64 ::std::auto_ptr< ObjectNameApproval_Impl > m_pImpl;
66 public:
67 enum ObjectType
69 TypeQuery,
70 TypeTable
73 public:
74 /** constructs the instance
76 @param _rxConnection
77 the connection relative to which the names should be checked. This connection
78 will be held weak. In case it is closed, subsequent calls to this instance's
79 methods throw a DisposedException.
80 @param _eType
81 specifies which type of objects is to be approved with this instance
83 ObjectNameApproval(
84 const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
85 ObjectType _eType
86 );
87 virtual ~ObjectNameApproval();
89 // IContainerApprove
90 virtual void SAL_CALL approveElement( const ::rtl::OUString& _rName, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxElement );
94 //........................................................................
95 } // namespace dbaccess
96 //........................................................................
98 #endif // DBACCESS_OBJECTNAMEAPPROVAL_HXX