LibreOffice Module connectivity (master) 1
predicateinput.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#ifndef INCLUDED_CONNECTIVITY_PREDICATEINPUT_HXX
21#define INCLUDED_CONNECTIVITY_PREDICATEINPUT_HXX
22
25#include <com/sun/star/uno/Any.hxx>
26
27namespace com::sun::star::beans { class XPropertySet; }
28namespace com::sun::star::i18n { class XLocaleData4; }
29namespace com::sun::star::sdbc { class XConnection; }
30namespace com::sun::star::uno { class XComponentContext; }
31namespace com::sun::star::util { class XNumberFormatter; }
32
33
34
35namespace dbtools
36{
37
38
39 //= OPredicateInputController
40
45 {
46 private:
47 css::uno::Reference< css::sdbc::XConnection >
49 css::uno::Reference< css::util::XNumberFormatter >
51 css::uno::Reference< css::i18n::XLocaleData4 >
53
56
57 public:
59 const css::uno::Reference< css::uno::XComponentContext >& rxContext,
60 const css::uno::Reference< css::sdbc::XConnection >& _rxConnection,
61 const ::connectivity::IParseContext* _pParseContext = nullptr
62 );
63
73 bool normalizePredicateString(
74 OUString& _rPredicateValue,
75 const css::uno::Reference< css::beans::XPropertySet >& _rxField,
76 OUString* _pErrorMessage = nullptr
77 ) const;
78
87 const OUString& _rPredicateValue,
88 const css::uno::Reference< css::beans::XPropertySet > & _rxField
89 ) const;
90
91 OUString getPredicateValueStr(
92 const OUString& _sField
93 , const OUString& _rPredicateValue) const;
94
102 css::uno::Any getPredicateValue(
103 const OUString& _rPredicateValue,
104 const css::uno::Reference< css::beans::XPropertySet > & _rxField
105 ) const;
106
107 private:
108 std::unique_ptr<::connectivity::OSQLParseNode> implPredicateTree(
109 OUString& _rErrorMessage,
110 const OUString& _rStatement,
111 const css::uno::Reference< css::beans::XPropertySet > & _rxField
112 ) const;
113
114 bool getSeparatorChars(
115 const css::lang::Locale& _rLocale,
116 sal_Unicode& _rDecSep,
117 sal_Unicode& _rThdSep
118 ) const;
119
120 css::uno::Any implParseNode(std::unique_ptr<::connectivity::OSQLParseNode> pParseNode, bool _bForStatementUse) const;
121 };
122
123
124} // namespace dbtools
125
126
127#endif // INCLUDED_CONNECTIVITY_PREDICATEINPUT_HXX
128
129/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Parser for SQL92.
Definition: sqlparse.hxx:110
A class which allows input of an SQL predicate for a row set column into an edit field.
css::uno::Reference< css::sdbc::XConnection > m_xConnection
css::uno::Reference< css::i18n::XLocaleData4 > m_xLocaleData
::connectivity::OSQLParser m_aParser
OUString getPredicateValueStr(const OUString &_rPredicateValue, const css::uno::Reference< css::beans::XPropertySet > &_rxField) const
get the value of the predicate, as a string to be used in a WHERE clause
css::uno::Reference< css::util::XNumberFormatter > m_xFormatter
#define OOO_DLLPUBLIC_DBTOOLS
class SAL_NO_VTABLE XPropertySet
sal_uInt16 sal_Unicode