1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
20 #ifndef DBACCESS_OBJECTNAMEAPPROVAL_HXX
21 #define DBACCESS_OBJECTNAMEAPPROVAL_HXX
23 #include "containerapprove.hxx"
25 #include <com/sun/star/sdbc/XConnection.hpp>
30 //====================================================================
31 //= ObjectNameApproval
32 //====================================================================
33 struct ObjectNameApproval_Impl
;
34 /** implementation of the IContainerApprove interface which approves
35 elements for insertion into a query or tables container.
37 The only check done by this instance is whether the query name is
38 not already used, taking into account that in some databases, queries
39 and tables share the same namespace.
41 The class is not thread-safe.
43 class ObjectNameApproval
: public IContainerApprove
45 ::std::auto_ptr
< ObjectNameApproval_Impl
> m_pImpl
;
55 /** constructs the instance
58 the connection relative to which the names should be checked. This connection
59 will be held weak. In case it is closed, subsequent calls to this instance's
60 methods throw a DisposedException.
62 specifies which type of objects is to be approved with this instance
65 const ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XConnection
>& _rxConnection
,
68 virtual ~ObjectNameApproval();
71 virtual void SAL_CALL
approveElement( const ::rtl::OUString
& _rName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& _rxElement
);
75 } // namespace dbaccess
77 #endif // DBACCESS_OBJECTNAMEAPPROVAL_HXX
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */