diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-05-16 15:17:38 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-05-17 12:43:13 +0200 |
commit | 8a35ae3e6c5c45aa1426cfd81472b309d02a1b48 (patch) | |
tree | b634b7d9ef93599b5139528a2fcd4a99c3372a0d /include | |
parent | 4c2034b808fed4f9dfd715d8a4813e788a7e97a4 (diff) |
weld SvxIMapDlg
Change-Id: I5418176a015e61ef8eee4c2acd8e84b008f76f82
Reviewed-on: https://gerrit.libreoffice.org/72249
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/svtools/inettbc.hxx | 44 | ||||
-rw-r--r-- | include/svx/fmview.hxx | 2 | ||||
-rw-r--r-- | include/svx/graphctl.hxx | 128 | ||||
-rw-r--r-- | include/svx/imapdlg.hxx | 81 | ||||
-rw-r--r-- | include/svx/svdcrtv.hxx | 2 | ||||
-rw-r--r-- | include/svx/svdedxv.hxx | 6 | ||||
-rw-r--r-- | include/svx/svdmrkv.hxx | 2 | ||||
-rw-r--r-- | include/svx/svdpntv.hxx | 10 | ||||
-rw-r--r-- | include/svx/svdview.hxx | 6 | ||||
-rw-r--r-- | include/svx/svxdlg.hxx | 6 | ||||
-rw-r--r-- | include/vcl/customweld.hxx | 1 | ||||
-rw-r--r-- | include/vcl/weld.hxx | 24 |
12 files changed, 214 insertions, 98 deletions
diff --git a/include/svtools/inettbc.hxx b/include/svtools/inettbc.hxx index 76858c3b9b1a..0c19a983b2e0 100644 --- a/include/svtools/inettbc.hxx +++ b/include/svtools/inettbc.hxx @@ -104,6 +104,7 @@ class SVT_DLLPUBLIC URLBox bool bHistoryDisabled : 1; Link<weld::ComboBox&, void> aChangeHdl; + Link<weld::Widget&, void> aFocusOutHdl; std::unique_ptr<weld::ComboBox> m_xWidget; @@ -118,26 +119,29 @@ public: URLBox(std::unique_ptr<weld::ComboBox> pWidget); ~URLBox(); - void set_entry_text(const OUString& rStr) { m_xWidget->set_entry_text(rStr); } - void Clear() { m_xWidget->clear(); } - void connect_entry_activate(const Link<weld::ComboBox&, bool>& rLink) { m_xWidget->connect_entry_activate(rLink); } - void connect_changed(const Link<weld::ComboBox&, void>& rLink) { aChangeHdl = rLink; } - void append_text(const OUString& rStr) { m_xWidget->append_text(rStr); } - OUString get_active_text() const { return m_xWidget->get_active_text(); } - void grab_focus() { m_xWidget->grab_focus(); } - void EnableAutocomplete() { m_xWidget->set_entry_completion(true); } - - void SetBaseURL( const OUString& rURL ); - void SetSmartProtocol( INetProtocol eProt ); - INetProtocol GetSmartProtocol() const { return eSmartProtocol; } - OUString GetURL(); - void DisableHistory(); - - weld::Widget* getWidget() { return m_xWidget.get(); } - - static OUString ParseSmart( const OUString& aText, const OUString& aBaseURL ); - - void SetFilter(const OUString& _sFilter); + void set_entry_text(const OUString& rStr) { m_xWidget->set_entry_text(rStr); } + void Clear() { m_xWidget->clear(); } + void connect_entry_activate(const Link<weld::ComboBox&, bool>& rLink) { m_xWidget->connect_entry_activate(rLink); } + void connect_changed(const Link<weld::ComboBox&, void>& rLink) { aChangeHdl = rLink; } + void connect_focus_out(const Link<weld::Widget&, void>& rLink) { aFocusOutHdl = rLink; } + void append_text(const OUString& rStr) { m_xWidget->append_text(rStr); } + int find_text(const OUString& rStr) const { return m_xWidget->find_text(rStr); } + OUString get_active_text() const { return m_xWidget->get_active_text(); } + void grab_focus() { m_xWidget->grab_focus(); } + void set_sensitive(bool bSensitive) { m_xWidget->set_sensitive(bSensitive); } + void EnableAutocomplete() { m_xWidget->set_entry_completion(true); } + + void SetBaseURL( const OUString& rURL ); + void SetSmartProtocol( INetProtocol eProt ); + INetProtocol GetSmartProtocol() const { return eSmartProtocol; } + OUString GetURL(); + void DisableHistory(); + + weld::Widget* getWidget() { return m_xWidget.get(); } + + static OUString ParseSmart( const OUString& aText, const OUString& aBaseURL ); + + void SetFilter(const OUString& _sFilter); }; #endif diff --git a/include/svx/fmview.hxx b/include/svx/fmview.hxx index e23d3a6efbe2..2808ba031fa4 100644 --- a/include/svx/fmview.hxx +++ b/include/svx/fmview.hxx @@ -106,7 +106,7 @@ public: virtual SdrPageView* ShowSdrPage(SdrPage* pPage) override; virtual void HideSdrPage() override; - virtual bool MouseButtonDown( const MouseEvent& _rMEvt, vcl::Window* _pWin ) override; + virtual bool MouseButtonDown( const MouseEvent& _rMEvt, OutputDevice* _pWin ) override; /** grab the focus to the first form control on the view */ diff --git a/include/svx/graphctl.hxx b/include/svx/graphctl.hxx index 7a2a7fd16da0..b4044d2b072b 100644 --- a/include/svx/graphctl.hxx +++ b/include/svx/graphctl.hxx @@ -42,6 +42,21 @@ public: virtual void Changed(const SdrObject& rObj, SdrUserCallType eType, const tools::Rectangle& rOldBoundRect) override; }; +class SvxGraphCtrl; + +class SvxGraphCtrlUserCall : public SdrObjUserCall +{ + SvxGraphCtrl& rWin; + +public: + + SvxGraphCtrlUserCall(SvxGraphCtrl& rGraphWin) + : rWin(rGraphWin) + {} + + virtual void Changed(const SdrObject& rObj, SdrUserCallType eType, const tools::Rectangle& rOldBoundRect) override; +}; + class SvxGraphCtrlAccessibleContext; class SVX_DLLPUBLIC GraphCtrl : public Control @@ -120,23 +135,91 @@ public: void QueueIdleUpdate(); void SetSdrMode(bool b); - - virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override; }; class SVX_DLLPUBLIC SvxGraphCtrl : public weld::CustomWidgetController { - MapMode const aMap100; + friend class SvxGraphCtrlView; + friend class SvxGraphCtrlUserCall; + Graphic aGraphic; + ScopedVclPtrInstance<VirtualDevice> xVD; + Idle aUpdateIdle; + Link<SvxGraphCtrl*,void> aMousePosLink; + Link<SvxGraphCtrl*,void> aGraphSizeLink; + Link<SvxGraphCtrl*,void> aUpdateLink; + MapMode const aMap100; Size aGraphSize; + Point aMousePos; + std::unique_ptr<SvxGraphCtrlUserCall> pUserCall; + SdrObjKind eObjKind; + sal_uInt16 nPolyEdit; + bool bEditMode; + bool mbSdrMode; + bool mbInIdleUpdate; + weld::Dialog* mpDialog; + + DECL_LINK( UpdateHdl, Timer*, void ); - virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override; + rtl::Reference<SvxGraphCtrlAccessibleContext> mpAccContext; + +protected: + + std::unique_ptr<SdrModel> pModel; + std::unique_ptr<SdrView> pView; + + virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override; + virtual void Resize() override; + virtual bool KeyInput(const KeyEvent& rKEvt) override; + virtual bool MouseButtonDown(const MouseEvent& rMEvt) override; + virtual bool MouseButtonUp(const MouseEvent& rMEvt) override; + virtual bool MouseMove(const MouseEvent& rMEvt) override; + + virtual void InitSdrModel(); + + virtual void SdrObjCreated( const SdrObject& rObj ); + virtual void SdrObjChanged( const SdrObject& rObj ); + virtual void MarkListHasChanged(); + + void GraphicToVD(); + + SdrObjUserCall* GetSdrUserCall() { return pUserCall.get(); } public: - SvxGraphCtrl(); + SvxGraphCtrl(weld::Dialog* pDialog); + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; virtual ~SvxGraphCtrl() override; - void SetGraphic( const Graphic& rGraphic ); + + void SetGraphic( const Graphic& rGraphic, bool bNewModel = true ); + const Graphic& GetGraphic() const { return aGraphic; } + const Size& GetGraphicSize() const { return aGraphSize; } + + const Point& GetMousePos() const { return aMousePos; } + + void SetEditMode( const bool bEditMode ); + + void SetPolyEditMode( const sal_uInt16 nPolyEdit ); + sal_uInt16 GetPolyEditMode() const { return nPolyEdit; } + + void SetObjKind( const SdrObjKind eObjKind ); + + SdrModel* GetSdrModel() const { return pModel.get(); } + SdrView* GetSdrView() const { return pView.get(); } + SdrObject* GetSelectedSdrObject() const; + bool IsChanged() const { return mbSdrMode && pModel->IsChanged(); } + + void SetMousePosLink( const Link<SvxGraphCtrl*,void>& rLink ) { aMousePosLink = rLink; } + + void SetGraphSizeLink( const Link<SvxGraphCtrl*,void>& rLink ) { aGraphSizeLink = rLink; } + + void SetUpdateLink( const Link<SvxGraphCtrl*,void>& rLink ) { aUpdateLink = rLink; } + void QueueIdleUpdate(); + + void SetSdrMode(bool b); + + Point GetPositionInDialog() const; + virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override; }; class GraphCtrlView : public SdrView @@ -152,15 +235,38 @@ protected: } public: - GraphCtrlView( - SdrModel& rSdrModel, - GraphCtrl* pWindow) - : SdrView(rSdrModel, pWindow) - ,rGraphCtrl(*pWindow) + GraphCtrlView(SdrModel& rSdrModel, GraphCtrl* pWindow) + : SdrView(rSdrModel, pWindow) + , rGraphCtrl(*pWindow) { } }; +class SvxGraphCtrlView : public SdrView +{ + SvxGraphCtrl& rGraphCtrl; + +protected: + + virtual void MarkListHasChanged() override + { + SdrView::MarkListHasChanged(); + rGraphCtrl.MarkListHasChanged(); + } + +public: + SvxGraphCtrlView(SdrModel& rSdrModel, SvxGraphCtrl* pWindow) + : SdrView(rSdrModel, &pWindow->GetDrawingArea()->get_ref_device()) + , rGraphCtrl(*pWindow) + { + } + + // override these so we can get the occasions SdrPaintView would call Window::Invalidate on its vcl::Window + // if it had one, and route to WidgetController::Invalidate instead + virtual rtl::Reference<sdr::overlay::OverlayManager> CreateOverlayManager(OutputDevice& rDevice) const override; + virtual void InvalidateWindow(const tools::Rectangle& rArea, OutputDevice& rDevice) const override; +}; + #endif // INCLUDED_SVX_GRAPHCTL_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/imapdlg.hxx b/include/svx/imapdlg.hxx index 86b5a9ae03be..d2b1cf620bf4 100644 --- a/include/svx/imapdlg.hxx +++ b/include/svx/imapdlg.hxx @@ -24,11 +24,10 @@ #include <sfx2/childwin.hxx> #include <sfx2/ctrlitem.hxx> #include <sfx2/basedlgs.hxx> -#include <vcl/fixed.hxx> -#include <vcl/combobox.hxx> -#include <vcl/edit.hxx> +#include <vcl/customweld.hxx> #include <vcl/toolbox.hxx> #include <vcl/status.hxx> +#include <vcl/weld.hxx> #include <svx/svxdllapi.h> #include <memory> #include <vector> @@ -77,69 +76,53 @@ public: class IMapOwnData; class IMapWindow; -class GraphCtrl; +class SvxGraphCtrl; -class SVX_DLLPUBLIC SvxIMapDlg : public SfxModelessDialog // SfxFloatingWindow +class SVX_DLLPUBLIC SvxIMapDlg : public SfxModelessDialogController { friend class IMapOwnData; friend class IMapWindow; - VclPtr<ToolBox> m_pTbxIMapDlg1; - VclPtr<FixedText> m_pFtURL; - VclPtr<SvtURLBox> m_pURLBox; - VclPtr<FixedText> m_pFtText; - VclPtr<Edit> m_pEdtText; - VclPtr<FixedText> m_pFtTarget; - VclPtr<ComboBox> m_pCbbTarget; - VclPtr<StatusBar> m_pStbStatus; - - sal_uInt16 mnApplyId; - sal_uInt16 mnOpenId; - sal_uInt16 mnSaveAsId; - sal_uInt16 mnSelectId; - sal_uInt16 mnRectId; - sal_uInt16 mnCircleId; - sal_uInt16 mnPolyId; - sal_uInt16 mnFreePolyId; - sal_uInt16 mnPolyEditId; - sal_uInt16 mnPolyMoveId; - sal_uInt16 mnPolyInsertId; - sal_uInt16 mnPolyDeleteId; - sal_uInt16 mnUndoId; - sal_uInt16 mnRedoId; - sal_uInt16 mnActiveId; - sal_uInt16 mnMacroId; - sal_uInt16 mnPropertyId; - sal_uInt16 mnCloseId; - - VclPtr<IMapWindow> pIMapWnd; std::unique_ptr<IMapOwnData> pOwnData; void* pCheckObj; SvxIMapDlgItem aIMapItem; - virtual bool Close() override; - - DECL_LINK( TbxClickHdl, ToolBox*, void ); + std::unique_ptr<IMapWindow> m_xIMapWnd; + std::unique_ptr<weld::Toolbar> m_xTbxIMapDlg1; + std::unique_ptr<weld::Label> m_xFtURL; + std::unique_ptr<URLBox> m_xURLBox; + std::unique_ptr<weld::Label> m_xFtText; + std::unique_ptr<weld::Entry> m_xEdtText; + std::unique_ptr<weld::Label> m_xFtTarget; + std::unique_ptr<weld::ComboBox> m_xCbbTarget; + std::unique_ptr<weld::Button> m_xCancelBtn; + std::unique_ptr<weld::Label> m_xStbStatus1; + std::unique_ptr<weld::Label> m_xStbStatus2; + std::unique_ptr<weld::Label> m_xStbStatus3; + std::unique_ptr<weld::CustomWeld> m_xIMapWndWeld; + + DECL_LINK( TbxClickHdl, const OString&, void ); DECL_LINK( InfoHdl, IMapWindow&, void ); - DECL_LINK( MousePosHdl, GraphCtrl*, void ); - DECL_LINK( GraphSizeHdl, GraphCtrl*, void ); - DECL_LINK( URLModifyHdl, Edit&, void ); - DECL_LINK( URLModifyComboBoxHdl, ComboBox&, void ); - DECL_LINK( URLLoseFocusHdl, Control&, void ); + DECL_LINK( MousePosHdl, SvxGraphCtrl*, void ); + DECL_LINK( GraphSizeHdl, SvxGraphCtrl*, void ); + DECL_LINK( URLModifyHdl, weld::ComboBox&, void ); + DECL_LINK( EntryModifyHdl, weld::Entry&, void ); + DECL_LINK( URLModifyComboBoxHdl, weld::ComboBox&, void ); + DECL_LINK( URLLoseFocusHdl, weld::Widget&, void ); DECL_LINK( UpdateHdl, Timer *, void ); - DECL_LINK( StateHdl, GraphCtrl*, void ); - DECL_LINK( MiscHdl, LinkParamNone*, void ); + DECL_LINK( StateHdl, SvxGraphCtrl*, void ); + DECL_LINK( CancelHdl, weld::Button&, void ); + void URLModify(); void DoOpen(); bool DoSave(); - void SetActiveTool( sal_uInt16 nId ); + void SetActiveTool(const OString& rId); public: - SvxIMapDlg( SfxBindings *pBindings, SfxChildWindow *pCW, - vcl::Window* pParent ); - virtual ~SvxIMapDlg() override; - virtual void dispose() override; + SvxIMapDlg(SfxBindings *pBindings, SfxChildWindow *pCW, + weld::Window* pParent); + virtual ~SvxIMapDlg() override; void SetExecState( bool bEnable ); diff --git a/include/svx/svdcrtv.hxx b/include/svx/svdcrtv.hxx index d66ba7c35f4a..95c7cad02e33 100644 --- a/include/svx/svdcrtv.hxx +++ b/include/svx/svdcrtv.hxx @@ -84,7 +84,7 @@ public: virtual void BrkAction() override; virtual void TakeActionRect(tools::Rectangle& rRect) const override; - virtual bool MouseMove(const MouseEvent& rMEvt, vcl::Window* pWin) override; + virtual bool MouseMove(const MouseEvent& rMEvt, OutputDevice* pWin) override; void SetMeasureLayer(const OUString& rName) { maMeasureLayer=rName; } diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx index 596e830f8bd3..aab4e216feb9 100644 --- a/include/svx/svdedxv.hxx +++ b/include/svx/svdedxv.hxx @@ -236,9 +236,9 @@ public: OutlinerView* GetTextEditOutlinerView() { return pTextEditOutlinerView; } virtual bool KeyInput(const KeyEvent& rKEvt, vcl::Window* pWin) override; - virtual bool MouseButtonDown(const MouseEvent& rMEvt, vcl::Window* pWin) override; - virtual bool MouseButtonUp(const MouseEvent& rMEvt, vcl::Window* pWin) override; - virtual bool MouseMove(const MouseEvent& rMEvt, vcl::Window* pWin) override; + virtual bool MouseButtonDown(const MouseEvent& rMEvt, OutputDevice* pWin) override; + virtual bool MouseButtonUp(const MouseEvent& rMEvt, OutputDevice* pWin) override; + virtual bool MouseMove(const MouseEvent& rMEvt, OutputDevice* pWin) override; virtual bool Command(const CommandEvent& rCEvt, vcl::Window* pWin) override; // #97766# make virtual to change implementation e.g. for SdOutlineView diff --git a/include/svx/svdmrkv.hxx b/include/svx/svdmrkv.hxx index d974cd8779d5..05d7458f5b42 100644 --- a/include/svx/svdmrkv.hxx +++ b/include/svx/svdmrkv.hxx @@ -148,7 +148,7 @@ protected: void SetMarkRects(); // Rects at the PageViews void CheckMarked(); // Scan MarkList after Del and Lock Layer ... void AddDragModeHdl(SdrDragMode eMode); - virtual bool MouseMove(const MouseEvent& rMEvt, vcl::Window* pWin) override; + virtual bool MouseMove(const MouseEvent& rMEvt, OutputDevice* pWin) override; virtual bool RequestHelp(const HelpEvent& rHEvt) override; // add custom handles (used by other apps, e.g. AnchorPos) diff --git a/include/svx/svdpntv.hxx b/include/svx/svdpntv.hxx index bdfa2c705484..7fe1a838b8d3 100644 --- a/include/svx/svdpntv.hxx +++ b/include/svx/svdpntv.hxx @@ -221,7 +221,7 @@ public: bool IsPagePaintingAllowed() const { return mbPagePaintingAllowed;} void SetPagePaintingAllowed(bool bNew); - rtl::Reference<sdr::overlay::OverlayManager> CreateOverlayManager(OutputDevice& rDevice) const; + virtual rtl::Reference<sdr::overlay::OverlayManager> CreateOverlayManager(OutputDevice& rDevice) const; protected: svtools::ColorConfig maColorConfig; @@ -238,7 +238,7 @@ public: SdrPaintWindow* GetPaintWindow(sal_uInt32 nIndex) const; // Replacement for GetWin(0), may return 0L (!) OutputDevice* GetFirstOutputDevice() const; - static void InvalidateWindow(const tools::Rectangle& rArea, OutputDevice& rDevice); + virtual void InvalidateWindow(const tools::Rectangle& rArea, OutputDevice& rDevice) const; private: SVX_DLLPRIVATE void ImpClearVars(); @@ -465,9 +465,9 @@ public: void SetSwapAsynchron(bool bJa=true) { mbSwapAsynchron=bJa; } virtual bool KeyInput(const KeyEvent& rKEvt, vcl::Window* pWin); - virtual bool MouseButtonDown(const MouseEvent& /*rMEvt*/, vcl::Window* /*pWin*/) { return false; } - virtual bool MouseButtonUp(const MouseEvent& /*rMEvt*/, vcl::Window* /*pWin*/) { return false; } - virtual bool MouseMove(const MouseEvent& /*rMEvt*/, vcl::Window* /*pWin*/) { return false; } + virtual bool MouseButtonDown(const MouseEvent& /*rMEvt*/, OutputDevice* /*pWin*/) { return false; } + virtual bool MouseButtonUp(const MouseEvent& /*rMEvt*/, OutputDevice* /*pWin*/) { return false; } + virtual bool MouseMove(const MouseEvent& /*rMEvt*/, OutputDevice* /*pWin*/) { return false; } virtual bool RequestHelp(const HelpEvent& /*rHEvt*/) { return false; } virtual bool Command(const CommandEvent& /*rCEvt*/, vcl::Window* /*pWin*/) { return false; } diff --git a/include/svx/svdview.hxx b/include/svx/svdview.hxx index 176d6e6146b5..4b145931896c 100644 --- a/include/svx/svdview.hxx +++ b/include/svx/svdview.hxx @@ -183,9 +183,9 @@ public: bool IsMasterPagePaintCaching() const { return mbMasterPagePaintCaching; } bool KeyInput(const KeyEvent& rKEvt, vcl::Window* pWin) override; - virtual bool MouseButtonDown(const MouseEvent& rMEvt, vcl::Window* pWin) override; - virtual bool MouseButtonUp(const MouseEvent& rMEvt, vcl::Window* pWin) override; - virtual bool MouseMove(const MouseEvent& rMEvt, vcl::Window* pWin) override; + virtual bool MouseButtonDown(const MouseEvent& rMEvt, OutputDevice* pWin) override; + virtual bool MouseButtonUp(const MouseEvent& rMEvt, OutputDevice* pWin) override; + virtual bool MouseMove(const MouseEvent& rMEvt, OutputDevice* pWin) override; using SdrCreateView::RequestHelp; virtual bool Command(const CommandEvent& rCEvt, vcl::Window* pWin) override; diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx index 9708710b02f2..266eb4ccffc6 100644 --- a/include/svx/svxdlg.hxx +++ b/include/svx/svxdlg.hxx @@ -351,7 +351,7 @@ public: virtual VclPtr<VclAbstractDialog> CreateGalleryThemePropertiesDialog(weld::Window* pParent, ExchangeData* pData, SfxItemSet* pItemSet ) = 0; - virtual VclPtr<AbstractURLDlg> CreateURLDialog(weld::Window* pParent, + virtual VclPtr<AbstractURLDlg> CreateURLDialog(weld::Widget* pParent, const OUString& rURL, const OUString& rAltText, const OUString& rDescription, const OUString& rTarget, const OUString& rName, TargetList& rTargetList ) = 0; @@ -427,8 +427,8 @@ public: sal_uInt32 nResId )=0; virtual VclPtr<SfxAbstractDialog> CreateCharMapDialog(weld::Window* pParent, const SfxItemSet& rAttr, const css::uno::Reference<css::frame::XFrame>& rFrame) = 0; - virtual VclPtr<SfxAbstractDialog> CreateEventConfigDialog(weld::Window* pParent, const SfxItemSet& rAttr, - const css::uno::Reference< css::frame::XFrame >& _rxFrame) = 0; + virtual VclPtr<SfxAbstractDialog> CreateEventConfigDialog(weld::Widget* pParent, const SfxItemSet& rAttr, + const css::uno::Reference< css::frame::XFrame >& rFrame) = 0; virtual VclPtr<AbstractSvxPostItDialog> CreateSvxPostItDialog(weld::Widget* pParent, const SfxItemSet& rCoreSet, bool bPrevNext = false) = 0; virtual VclPtr<VclAbstractDialog> CreateSvxScriptOrgDialog(weld::Window* pParent, const OUString& rLanguage) override = 0; diff --git a/include/vcl/customweld.hxx b/include/vcl/customweld.hxx index a003d6b4bace..07b09b21bf04 100644 --- a/include/vcl/customweld.hxx +++ b/include/vcl/customweld.hxx @@ -68,6 +68,7 @@ public: void EnableRTL(bool bEnable) { m_pDrawingArea->set_direction(bEnable); } bool IsRTLEnabled() const { return m_pDrawingArea->get_direction(); } void ReleaseMouse() { m_pDrawingArea->grab_remove(); } + void SetPointer(PointerStyle ePointerStyle) { m_pDrawingArea->set_cursor(ePointerStyle); } void SetHelpId(const OString& rHelpId) { m_pDrawingArea->set_help_id(rHelpId); } void SetAccessibleName(const OUString& rName) { m_pDrawingArea->set_accessible_name(rName); } void set_size_request(int nWidth, int nHeight) diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index e6a28cef778b..6f01abf567c2 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -56,6 +56,7 @@ class XGraphic; typedef css::uno::Reference<css::accessibility::XAccessible> a11yref; typedef css::uno::Reference<css::accessibility::XAccessibleRelationSet> a11yrelationset; +enum class PointerStyle; class SvNumberFormatter; class KeyEvent; class MouseEvent; @@ -1615,7 +1616,7 @@ public: virtual void queue_draw_area(int x, int y, int width, int height) = 0; virtual void queue_resize() = 0; - virtual void set_text_cursor() = 0; + virtual void set_cursor(PointerStyle ePointerStyle) = 0; // use return here just to generate matching VirtualDevices virtual OutputDevice& get_ref_device() = 0; @@ -1663,6 +1664,25 @@ public: virtual ~Menu() {} }; +class VCL_DLLPUBLIC Toolbar : virtual public Widget +{ +protected: + Link<const OString&, void> m_aClickHdl; + + void signal_clicked(const OString& rIdent) { m_aClickHdl.Call(rIdent); } + +public: + virtual void set_item_sensitive(const OString& rIdent, bool bSensitive) = 0; + virtual bool get_item_sensitive(const OString& rIdent) const = 0; + virtual void set_item_active(const OString& rIdent, bool bActive) = 0; + virtual bool get_item_active(const OString& rIdent) const = 0; + + virtual void insert_separator(int pos, const OUString& rId) = 0; + void append_separator(const OUString& rId) { insert_separator(-1, rId); } + + void connect_clicked(const Link<const OString&, void>& rLink) { m_aClickHdl = rLink; } +}; + class VCL_DLLPUBLIC SizeGroup { public: @@ -1755,6 +1775,8 @@ public: const OString& treeviewid, bool bTakeOwnership = false) = 0; virtual std::unique_ptr<Menu> weld_menu(const OString& id, bool bTakeOwnership = true) = 0; + virtual std::unique_ptr<Toolbar> weld_toolbar(const OString& id, bool bTakeOwnership = true) + = 0; virtual std::unique_ptr<SizeGroup> create_size_group() = 0; virtual ~Builder() {} }; |