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 INCLUDED_DBACCESS_SOURCE_CORE_INC_OBJECTNAMEAPPROVAL_HXX
21 #define INCLUDED_DBACCESS_SOURCE_CORE_INC_OBJECTNAMEAPPROVAL_HXX
23 #include "containerapprove.hxx"
25 #include <com/sun/star/sdbc/XConnection.hpp>
31 struct ObjectNameApproval_Impl
;
32 /** implementation of the IContainerApprove interface which approves
33 elements for insertion into a query or tables container.
35 The only check done by this instance is whether the query name is
36 not already used, taking into account that in some databases, queries
37 and tables share the same namespace.
39 The class is not thread-safe.
41 class ObjectNameApproval
: public IContainerApprove
43 ::std::unique_ptr
< ObjectNameApproval_Impl
> m_pImpl
;
53 /** constructs the instance
56 the connection relative to which the names should be checked. This connection
57 will be held weak. In case it is closed, subsequent calls to this instance's
58 methods throw a DisposedException.
60 specifies which type of objects is to be approved with this instance
63 const ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XConnection
>& _rxConnection
,
66 virtual ~ObjectNameApproval();
69 virtual void SAL_CALL
approveElement( const OUString
& _rName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& _rxElement
) SAL_OVERRIDE
;
73 } // namespace dbaccess
75 #endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_OBJECTNAMEAPPROVAL_HXX
77 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */