diff options
Diffstat (limited to 'dbaccess/source/ui/inc/sqledit.hxx')
-rw-r--r-- | dbaccess/source/ui/inc/sqledit.hxx | 75 |
1 files changed, 34 insertions, 41 deletions
diff --git a/dbaccess/source/ui/inc/sqledit.hxx b/dbaccess/source/ui/inc/sqledit.hxx index 478a248bf78b..9270bf77670a 100644 --- a/dbaccess/source/ui/inc/sqledit.hxx +++ b/dbaccess/source/ui/inc/sqledit.hxx @@ -24,72 +24,65 @@ #include <comphelper/syntaxhighlight.hxx> #include <rtl/ref.hxx> #include <svtools/colorcfg.hxx> -#include <vcl/vclmedit.hxx> +#include <svx/weldeditview.hxx> +#include <vcl/timer.hxx> namespace com::sun::star::beans { class XMultiPropertySet; } namespace dbaui { - class OQueryTextView; - class OSqlEdit final : public VclMultiLineEdit, public utl::ConfigurationListener + class SQLEditView final : public WeldEditView, public utl::ConfigurationListener { private: class ChangesListener; friend class ChangesListener; - SyntaxHighlighter aHighlighter; - svtools::ColorConfig m_aColorConfig; + Link<LinkParamNone*,void> m_aModifyLink; + const svtools::ColorConfig m_aColorConfig; + Timer m_aUpdateDataTimer; + const SyntaxHighlighter m_aHighlighter; + svtools::ColorConfig m_ColorConfig; + SfxItemPool* m_pItemPool; - Timer m_timerInvalidate; - Timer m_timerUndoActionCreation; - OUString m_strOrigText; // is restored on undo - VclPtr<OQueryTextView> m_pView; - bool m_bAccelAction; // is set on cut, copy, paste - bool m_bStopTimer; - svtools::ColorConfig m_ColorConfig; + rtl::Reference<ChangesListener> m_listener; + osl::Mutex m_mutex; + css::uno::Reference<css::beans::XMultiPropertySet> m_notifier; - rtl::Reference< ChangesListener > m_listener; - osl::Mutex m_mutex; - css::uno::Reference< css::beans::XMultiPropertySet > m_notifier; + bool m_bInUpdate; + bool m_bDisableInternalUndo; - DECL_LINK(OnUndoActionTimer, Timer*, void); - DECL_LINK(OnInvalidateTimer, Timer*, void); + DECL_LINK(ModifyHdl, LinkParamNone*, void); + DECL_LINK(ImplUpdateDataHdl, Timer*, void); + + Color GetColorValue(TokenType aToken); void ImplSetFont(); - void DoBracketHilight(sal_uInt16 aKey); - virtual bool PreNotify( NotifyEvent& rNEvt ) override; - virtual void KeyInput( const KeyEvent& rKEvt ) override; - virtual void GetFocus() override; + void DoBracketHilight(sal_uInt16 nKey); - DECL_LINK(ModifyHdl, Edit&, void); + static void SetItemPoolFont(SfxItemPool* pItemPool); + void UpdateData(); public: - OSqlEdit( OQueryTextView* pParent); - virtual ~OSqlEdit() override; - virtual void dispose() override; - - // Edit overridables - virtual void SetText(const OUString& rNewText) override; - virtual void SetText( const OUString& rStr, const Selection& rNewSelection ) override - { SetText( rStr ); SetSelection( rNewSelection ); } + SQLEditView(); + virtual void makeEditEngine() override; + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + virtual ~SQLEditView() override; - virtual void UpdateData() override; + virtual bool KeyInput(const KeyEvent& rKEvt) override; - static Color GetSyntaxHighlightColor(const svtools::ColorConfig& rColorConfig, HighlighterLanguage eLanguage, TokenType aToken); + void SetTextAndUpdate(const OUString& rNewText); - Color GetColorValue(TokenType aToken); + void SetModifyHdl(const Link<LinkParamNone*,void>& rLink) + { + m_aModifyLink = rLink; + } - // own functionality - // Cut, Copy, Paste by Accel. runs the action in the Edit but also the - // corresponding slot in the View. Therefore, the action occurs twice. - // To prevent this, SlotExec in View can call this function. - bool IsInAccelAct() const { return m_bAccelAction; } + void DisableInternalUndo(); - void stopTimer(); - void startTimer(); + static Color GetSyntaxHighlightColor(const svtools::ColorConfig& rColorConfig, HighlighterLanguage eLanguage, TokenType aToken); - virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, ConfigurationHints ) override; + virtual void ConfigurationChanged(utl::ConfigurationBroadcaster*, ConfigurationHints) override; }; } |