From 573562e72a5fd85b75006fbc8869c73903a6e504 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 15 Sep 2019 20:18:38 +0100 Subject: weld DirectSQLDialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I8f97068bb38a1fb888d60251f8f25506044c8451 Reviewed-on: https://gerrit.libreoffice.org/78970 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- dbaccess/source/ui/inc/directsql.hxx | 53 +++++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 16 deletions(-) (limited to 'dbaccess/source/ui/inc/directsql.hxx') diff --git a/dbaccess/source/ui/inc/directsql.hxx b/dbaccess/source/ui/inc/directsql.hxx index 03e31bb7e2ec..545d23dd79ad 100644 --- a/dbaccess/source/ui/inc/directsql.hxx +++ b/dbaccess/source/ui/inc/directsql.hxx @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -34,41 +35,56 @@ #include #include -#include +#include namespace dbaui { + class SQLEditView : public WeldEditView + { + private: + void DoBracketHilight(sal_uInt16 nKey); + public: + SQLEditView(); + virtual bool KeyInput(const KeyEvent& rKEvt) override; + }; // DirectSQLDialog class DirectSQLDialog final - :public ModalDialog - ,public ::utl::OEventListenerAdapter + : public weld::GenericDialogController + , public ::utl::OEventListenerAdapter { ::osl::Mutex m_aMutex; - VclPtr m_pSQL; - VclPtr m_pExecute; - VclPtr m_pSQLHistory; - VclPtr m_pStatus; - VclPtr m_pShowOutput; - VclPtr m_pOutput; - VclPtr m_pClose; + std::unique_ptr m_xExecute; + std::unique_ptr m_xSQLHistory; + std::unique_ptr m_xStatus; + std::unique_ptr m_xShowOutput; + std::unique_ptr m_xOutput; + std::unique_ptr m_xClose; + std::unique_ptr m_xSQL; + std::unique_ptr m_xSQLEd; + + Timer m_aUpdateDataTimer; + const SyntaxHighlighter m_aHighlighter; + const svtools::ColorConfig m_aColorConfig; typedef std::deque< OUString > StringQueue; StringQueue m_aStatementHistory; // previous statements StringQueue m_aNormalizedHistory; // previous statements, normalized to be used in the list box sal_Int32 m_nStatusCount; + bool m_bInUpdate; css::uno::Reference< css::sdbc::XConnection > m_xConnection; + ImplSVEvent* m_pClosingEvent; + public: DirectSQLDialog( - vcl::Window* _pParent, + weld::Window* _pParent, const css::uno::Reference< css::sdbc::XConnection >& _rxConn); virtual ~DirectSQLDialog() override; - virtual void dispose() override; /// number of history entries sal_Int32 getHistorySize() const; @@ -77,14 +93,19 @@ namespace dbaui void executeCurrent(); void switchToHistory(sal_Int32 _nHistoryPos); + Color GetColorValue(TokenType aToken); + + void UpdateData(); + // OEventListenerAdapter virtual void _disposing( const css::lang::EventObject& _rSource ) override; - DECL_LINK( OnExecute, Button*, void ); + DECL_LINK( OnExecute, weld::Button&, void ); DECL_LINK( OnClose, void*, void ); - DECL_LINK( OnCloseClick, Button*, void ); - DECL_LINK( OnListEntrySelected, ListBox&, void ); - DECL_LINK( OnStatementModified, Edit&, void ); + DECL_LINK( OnCloseClick, weld::Button&, void ); + DECL_LINK( OnListEntrySelected, weld::ComboBox&, void ); + DECL_LINK( OnStatementModified, LinkParamNone*, void ); + DECL_LINK( ImplUpdateDataHdl, Timer*, void ); /// adds a statement to the statement history void implAddToStatementHistory(const OUString& _rStatement); -- cgit