summaryrefslogtreecommitdiff
path: root/sw/source/uibase/inc
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/uibase/inc')
-rw-r--r--sw/source/uibase/inc/swuicnttab.hxx32
-rw-r--r--sw/source/uibase/inc/unotools.hxx46
2 files changed, 61 insertions, 17 deletions
diff --git a/sw/source/uibase/inc/swuicnttab.hxx b/sw/source/uibase/inc/swuicnttab.hxx
index d93d4032a802..753ac348c00a 100644
--- a/sw/source/uibase/inc/swuicnttab.hxx
+++ b/sw/source/uibase/inc/swuicnttab.hxx
@@ -43,7 +43,7 @@ class SwTOXWidget;
class SwTOXEdit;
class SwTOXButton;
class SwTOXEntryTabPage;
-class SwOneExampleFrame;
+class OneExampleFrame;
class SwWrtShell;
namespace com{namespace sun{namespace star{
@@ -59,20 +59,11 @@ struct SwIndexSections_Impl
css::uno::Reference< css::text::XDocumentIndex > xDocumentIndex;
};
-class SwMultiTOXTabDialog : public SfxTabDialog
+class SwMultiTOXTabDialog : public SfxTabDialogController
{
- VclPtr<vcl::Window> m_pExampleContainerWIN;
- VclPtr<CheckBox> m_pShowExampleCB;
std::unique_ptr<SwTOXMgr> m_pMgr;
SwWrtShell& m_rWrtShell;
- sal_uInt16 m_nSelectId;
- sal_uInt16 m_nColumnId;
- sal_uInt16 m_nBackGroundId;
- sal_uInt16 m_nEntriesId;
-
- std::unique_ptr<SwOneExampleFrame> m_pExampleFrame;
-
struct TypeData
{
std::unique_ptr<SwForm> m_pForm;
@@ -92,21 +83,24 @@ class SwMultiTOXTabDialog : public SfxTabDialog
bool m_bExampleCreated;
bool const m_bGlobalFlag;
+ std::unique_ptr<OneExampleFrame> m_xExampleFrame;
+ std::unique_ptr<weld::CheckButton> m_xShowExampleCB;
+ std::unique_ptr<weld::CustomWeld> m_xExampleFrameWin;
+
virtual short Ok() override;
std::unique_ptr<SwTOXDescription> CreateTOXDescFromTOXBase(const SwTOXBase*pCurTOX);
- DECL_LINK(CreateExample_Hdl, SwOneExampleFrame&, void);
- DECL_LINK(ShowPreviewHdl, Button*, void);
+ DECL_LINK(CreateExample_Hdl, OneExampleFrame&, void);
+ DECL_LINK(ShowPreviewHdl, weld::ToggleButton&, void);
public:
- SwMultiTOXTabDialog(vcl::Window* pParent, const SfxItemSet& rSet,
+ SwMultiTOXTabDialog(weld::Window* pParent, const SfxItemSet& rSet,
SwWrtShell &rShell,
SwTOXBase* pCurTOX, sal_uInt16 nToxType,
bool bGlobal);
virtual ~SwMultiTOXTabDialog() override;
- virtual void dispose() override;
- virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) override;
+ virtual void PageCreated(const OString& rId, SfxTabPage &rPage) override;
SwForm* GetForm(CurTOXType eType);
@@ -254,7 +248,10 @@ class SwTokenWindow
OUString m_sAdditionalAccnameString2;
OUString m_sAdditionalAccnameString3;
+ Idle m_aAdjustPositionsIdle;
+
VclPtr<SwTOXEntryTabPage> m_pParent;
+ std::unique_ptr<weld::Container> m_xParentWidget;
std::unique_ptr<weld::Builder> m_xBuilder;
std::unique_ptr<weld::Container> m_xContainer;
std::unique_ptr<weld::Button> m_xLeftScrollWin;
@@ -270,6 +267,7 @@ class SwTokenWindow
DECL_LINK(TbxFocusBtnHdl, SwTOXWidget&, void);
DECL_LINK(ScrollBtnHdl, weld::Button&, void);
DECL_LINK(ScrollHdl, weld::ScrolledWindow&, void);
+ DECL_LINK(AdjustPositionsHdl, const Size&, void);
void SetActiveControl(SwTOXWidget* pSet);
@@ -436,7 +434,7 @@ class SwTOXStylesTabPage : public SfxTabPage
SwForm& GetForm()
{
- SwMultiTOXTabDialog* pDlg = static_cast<SwMultiTOXTabDialog*>(GetTabDialog());
+ SwMultiTOXTabDialog* pDlg = static_cast<SwMultiTOXTabDialog*>(GetDialogController());
return *pDlg->GetForm(pDlg->GetCurrentTOXType());
}
diff --git a/sw/source/uibase/inc/unotools.hxx b/sw/source/uibase/inc/unotools.hxx
index 9ea3edb99490..7f860fbb8f58 100644
--- a/sw/source/uibase/inc/unotools.hxx
+++ b/sw/source/uibase/inc/unotools.hxx
@@ -24,6 +24,8 @@
#include <vcl/fixed.hxx>
#include <vcl/layout.hxx>
#include <vcl/idle.hxx>
+#include <vcl/weld.hxx>
+#include <vcl/customweld.hxx>
#include "actctrl.hxx"
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/text/XTextCursor.hpp>
@@ -101,6 +103,50 @@ public:
static void CreateErrorMessage();
};
+class SW_DLLPUBLIC OneExampleFrame : public weld::CustomWidgetController
+{
+ ScopedVclPtr<VirtualDevice> m_xVirDev;
+ css::uno::Reference< css::frame::XModel > m_xModel;
+ css::uno::Reference< css::frame::XController > m_xController;
+ css::uno::Reference< css::text::XTextCursor > m_xCursor;
+
+ Idle m_aLoadedIdle;
+ Link<OneExampleFrame&,void> m_aInitializedLink;
+
+ OUString m_sArgumentURL;
+
+ SwView* const m_pModuleView;
+
+ sal_uInt32 const m_nStyleFlags;
+
+ bool m_bIsInitialized;
+
+ DECL_DLLPRIVATE_LINK( TimeoutHdl, Timer*, void );
+ void PopupHdl(const OString& rId);
+
+ SAL_DLLPRIVATE void CreateControl();
+ SAL_DLLPRIVATE void DisposeControl();
+
+public:
+ OneExampleFrame(sal_uInt32 nStyleFlags,
+ const Link<OneExampleFrame&,void>* pInitalizedLink,
+ const OUString* pURL = nullptr);
+ virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
+ virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
+ virtual bool ContextMenu(const CommandEvent& rCEvt) override;
+ virtual ~OneExampleFrame() override;
+
+ css::uno::Reference< css::frame::XModel > & GetModel() {return m_xModel;}
+ css::uno::Reference< css::frame::XController > & GetController() {return m_xController;}
+ css::uno::Reference< css::text::XTextCursor > & GetTextCursor() {return m_xCursor;}
+
+ void ClearDocument();
+
+ bool IsInitialized() const {return m_bIsInitialized;}
+
+ bool CreatePopup(const Point& rPt);
+};
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */