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 .
21 #include "JoinDesignView.hxx"
22 #include <vcl/split.hxx>
23 #include <com/sun/star/beans/XPropertySet.hpp>
24 #include "querycontroller.hxx"
26 namespace connectivity
48 eIllegalJoinCondition
,
52 class OSelectionBrowseBox
;
53 class OQueryContainerWindow
;
54 class OQueryController
;
56 class OQueryDesignView
: public OJoinDesignView
65 VclPtr
<Splitter
> m_aSplitter
;
67 css::lang::Locale m_aLocale
;
68 OUString m_sDecimalSep
;
70 VclPtr
<OSelectionBrowseBox
> m_pSelectionBox
; // presents the lower window
71 ChildFocusState m_eChildFocus
;
72 bool m_bInSplitHandler
;
75 OQueryDesignView(OQueryContainerWindow
* pParent
, OQueryController
& _rController
, const css::uno::Reference
< css::uno::XComponentContext
>& );
76 virtual ~OQueryDesignView() override
;
77 virtual void dispose() override
;
79 bool isCutAllowed() const;
80 bool isPasteAllowed() const;
81 bool isCopyAllowed() const;
85 // clears the whole query
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
;
97 virtual bool PreNotify( NotifyEvent
& rNEvt
) override
;
98 virtual void GetFocus() override
;
100 bool isSlotEnabled(sal_Int32 _nSlotId
);
101 void setSlotEnabled(sal_Int32 _nSlotId
, bool _bEnable
);
102 void setNoneVisibleRow(sal_Int32 _nRows
);
104 const css::lang::Locale
& getLocale() const { return m_aLocale
;}
105 const OUString
& getDecimalSeparator() const { return m_sDecimalSep
;}
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
);
112 sal_Int32
getColWidth( sal_uInt16 _nColPos
) const;
113 void fillValidFields(std::u16string_view strTableName
, weld::ComboBox
& rFieldList
);
120 /** initializes the view from the current parser / parse iterator of the controller
123 When not <NULL/>, the instance pointed to by this parameter takes the error
124 which happened during the initialization.
125 If it is not <NULL/>, then any such error will be displayed, using the controller's
128 @return <TRUE/> if and only if the initialization was successful
130 bool initByParseIterator( ::dbtools::SQLExceptionInfo
* _pErrorInfo
);
132 void initByFieldDescriptions(
133 const css::uno::Sequence
< css::beans::PropertyValue
>& i_rFieldDescriptions
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;
141 void fillFunctionInfo( const ::connectivity::OSQLParseNode
* pNode
142 ,const OUString
& sFunctionTerm
143 ,OTableFieldDescRef
& aInfo
);
145 // return the Rectangle where I can paint myself
146 virtual void resizeDocumentView(tools::Rectangle
& rRect
) override
;
147 DECL_LINK( SplitHdl
, Splitter
*, void );
150 using OJoinDesignView::SaveTabWinUIConfig
;
154 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */