LibreOffice Module dbaccess (master) 1
defaultobjectnamecheck.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include "objectnamecheck.hxx"
23
24#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
25#include <com/sun/star/sdbc/XConnection.hpp>
26#include <com/sun/star/sdb/tools/XConnectionTools.hpp>
27
28#include <memory>
29
30namespace dbaui
31{
32
33 // HierarchicalNameCheck
38 {
39 private:
40 css::uno::Reference< css::container::XHierarchicalNameAccess > mxHierarchicalNames;
42
43 public:
54 const css::uno::Reference< css::container::XHierarchicalNameAccess >& _rxNames,
55 const OUString& _rRelativeRoot
56 );
57
58 virtual ~HierarchicalNameCheck() override;
59
62
63 // IObjectNameCheck overridables
64 virtual bool isNameValid(
65 const OUString& _rObjectName,
66 ::dbtools::SQLExceptionInfo& _out_rErrorToDisplay
67 ) const override;
68 };
69
70 // DynamicTableOrQueryNameCheck
85 {
86 private:
87 sal_Int32 mnCommandType;
88 css::uno::Reference< css::sdb::tools::XObjectNames > mxObjectNames;
89
90 public:
103 const css::uno::Reference< css::sdbc::XConnection >& _rxSdbLevelConnection,
104 sal_Int32 _nCommandType
105 );
106
107 virtual ~DynamicTableOrQueryNameCheck() override;
108
111
112 // IObjectNameCheck overridables
113 virtual bool isNameValid(
114 const OUString& _rObjectName,
115 ::dbtools::SQLExceptionInfo& _out_rErrorToDisplay
116 ) const override;
117 };
118
119} // namespace dbaui
120
121/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
class implementing the IObjectNameCheck interface, and checking a given name for being valid as eithe...
virtual bool isNameValid(const OUString &_rObjectName, ::dbtools::SQLExceptionInfo &_out_rErrorToDisplay) const override
determines whether a given object name is valid
const DynamicTableOrQueryNameCheck & operator=(const DynamicTableOrQueryNameCheck &)=delete
css::uno::Reference< css::sdb::tools::XObjectNames > mxObjectNames
DynamicTableOrQueryNameCheck(const css::uno::Reference< css::sdbc::XConnection > &_rxSdbLevelConnection, sal_Int32 _nCommandType)
constructs a DynamicTableOrQueryNameCheck instance
DynamicTableOrQueryNameCheck(const DynamicTableOrQueryNameCheck &)=delete
class implementing the IObjectNameCheck interface, and checking given object names against a hierarch...
const HierarchicalNameCheck & operator=(const HierarchicalNameCheck &)=delete
HierarchicalNameCheck(const HierarchicalNameCheck &)=delete
virtual bool isNameValid(const OUString &_rObjectName, ::dbtools::SQLExceptionInfo &_out_rErrorToDisplay) const override
determines whether a given object name is valid
css::uno::Reference< css::container::XHierarchicalNameAccess > mxHierarchicalNames
HierarchicalNameCheck(const css::uno::Reference< css::container::XHierarchicalNameAccess > &_rxNames, const OUString &_rRelativeRoot)
constructs a HierarchicalNameCheck instance
interface encapsulating the check for the validity of an object name