LibreOffice Module dbaccess (master) 1
QueryDesignView.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#pragma once
20
21#include "JoinDesignView.hxx"
22#include <vcl/split.hxx>
23#include <com/sun/star/beans/XPropertySet.hpp>
24#include "querycontroller.hxx"
25
26namespace connectivity
27{
28 class OSQLParseNode;
29}
30namespace weld
31{
32 class ComboBox;
33}
34namespace dbaui
35{
37 {
49 eOk
50 };
51
52 class OSelectionBrowseBox;
53 class OQueryContainerWindow;
54 class OQueryController;
55
57 {
59 {
62 NONE
63 };
64
66
67 css::lang::Locale m_aLocale;
68 OUString m_sDecimalSep;
69
70 VclPtr<OSelectionBrowseBox> m_pSelectionBox; // presents the lower window
73
74 public:
75 OQueryDesignView(OQueryContainerWindow* pParent, OQueryController& _rController, const css::uno::Reference< css::uno::XComponentContext >& );
76 virtual ~OQueryDesignView() override;
77 virtual void dispose() override;
78
79 bool isCutAllowed() const;
80 bool isPasteAllowed() const;
81 bool isCopyAllowed() const;
82 void copy();
83 void cut();
84 void paste();
85 // clears the whole query
86 void clear();
87 // set the view readonly or not
88 virtual void setReadOnly(bool _bReadOnly) override;
89 // check if the statement is correct when not returning false
90 bool checkStatement();
91 // returns the current sql statement
92 OUString getStatement();
94 virtual void Construct() override;
95 virtual void initialize() override;
96 // Window overrides
97 virtual bool PreNotify( NotifyEvent& rNEvt ) override;
98 virtual void GetFocus() override;
99
100 bool isSlotEnabled(sal_Int32 _nSlotId);
101 void setSlotEnabled(sal_Int32 _nSlotId, bool _bEnable);
102 void setNoneVisibleRow(sal_Int32 _nRows);
103
104 const css::lang::Locale& getLocale() const { return m_aLocale;}
105 const OUString& getDecimalSeparator() const { return m_sDecimalSep;}
106
107 SqlParseError InsertField( const OTableFieldDescRef& rInfo, bool bActivate = true);
108 bool HasFieldByAliasName(std::u16string_view rFieldName, OTableFieldDescRef const & rInfo) const;
109 // called when a table from tabview was deleted
110 void TableDeleted(const OUString& rAliasName);
111
112 sal_Int32 getColWidth( sal_uInt16 _nColPos) const;
113 void fillValidFields(std::u16string_view strTableName, weld::ComboBox& rFieldList);
114
115 void SaveUIConfig();
116 void stopTimer();
117 void startTimer();
118 void reset();
119
131
133 const css::uno::Sequence< css::beans::PropertyValue >& i_rFieldDescriptions
134 );
135
136 std::unique_ptr<::connectivity::OSQLParseNode> getPredicateTreeFromEntry( const OTableFieldDescRef& pEntry,
137 const OUString& _sCriteria,
138 OUString& _rsErrorMessage,
139 css::uno::Reference< css::beans::XPropertySet>& _rxColumn) const;
140
141 void fillFunctionInfo( const ::connectivity::OSQLParseNode* pNode
142 ,const OUString& sFunctionTerm
143 ,OTableFieldDescRef& aInfo);
144 protected:
145 // return the Rectangle where I can paint myself
146 virtual void resizeDocumentView(tools::Rectangle& rRect) override;
147 DECL_LINK( SplitHdl, Splitter*, void );
148
149 private:
151 };
152}
153
154/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SaveTabWinUIConfig(OTableWindow const *pWin)
sal_Int32 getColWidth(sal_uInt16 _nColPos) const
virtual void setReadOnly(bool _bReadOnly) override
VclPtr< Splitter > m_aSplitter
virtual void GetFocus() override
void fillFunctionInfo(const ::connectivity::OSQLParseNode *pNode, const OUString &sFunctionTerm, OTableFieldDescRef &aInfo)
void setSlotEnabled(sal_Int32 _nSlotId, bool _bEnable)
VclPtr< OSelectionBrowseBox > m_pSelectionBox
virtual ~OQueryDesignView() override
void initByFieldDescriptions(const css::uno::Sequence< css::beans::PropertyValue > &i_rFieldDescriptions)
virtual void resizeDocumentView(tools::Rectangle &rRect) override
DECL_LINK(SplitHdl, Splitter *, void)
const OUString & getDecimalSeparator() const
bool isSlotEnabled(sal_Int32 _nSlotId)
std::unique_ptr<::connectivity::OSQLParseNode > getPredicateTreeFromEntry(const OTableFieldDescRef &pEntry, const OUString &_sCriteria, OUString &_rsErrorMessage, css::uno::Reference< css::beans::XPropertySet > &_rxColumn) const
css::lang::Locale m_aLocale
bool HasFieldByAliasName(std::u16string_view rFieldName, OTableFieldDescRef const &rInfo) const
virtual void Construct() override
late construction
virtual void dispose() override
const css::lang::Locale & getLocale() const
virtual void initialize() override
SqlParseError InsertField(const OTableFieldDescRef &rInfo, bool bActivate=true)
void setNoneVisibleRow(sal_Int32 _nRows)
void TableDeleted(const OUString &rAliasName)
virtual bool PreNotify(NotifyEvent &rNEvt) override
OQueryDesignView(OQueryContainerWindow *pParent, OQueryController &_rController, const css::uno::Reference< css::uno::XComponentContext > &)
ChildFocusState m_eChildFocus
void fillValidFields(std::u16string_view strTableName, weld::ComboBox &rFieldList)
bool initByParseIterator(::dbtools::SQLExceptionInfo *_pErrorInfo)
initializes the view from the current parser / parse iterator of the controller
@ eNoSelectStatement
@ eIllegalJoinCondition
@ eStatementTooComplex
@ eStatementTooLong