diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-04-24 14:14:34 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-04-27 09:54:08 +0200 |
commit | 28fc0962b10519ab84654d189d2ad0cca8f84f95 (patch) | |
tree | ff2b008cb13f69724abfff62157c6a4e133135a2 /include/sfx2/tabdlg.hxx | |
parent | 3d97c9d292d80cb82391bdb416a9c6217a8e16e4 (diff) |
weld SwLabDlg
Change-Id: I55c543776c03b1d1da0331552b98e6e281e35937
Reviewed-on: https://gerrit.libreoffice.org/53488
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include/sfx2/tabdlg.hxx')
-rw-r--r-- | include/sfx2/tabdlg.hxx | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx index b426440fdf33..4f99e12e5b71 100644 --- a/include/sfx2/tabdlg.hxx +++ b/include/sfx2/tabdlg.hxx @@ -225,6 +225,72 @@ public: virtual bool selectPageByUIXMLDescription(const OString& rUIXMLDescription) override; }; +class SFX2_DLLPUBLIC SfxTabDialogController : public weld::GenericDialogController +{ +protected: + std::unique_ptr<weld::Notebook> m_xTabCtrl; +private: + std::unique_ptr<weld::Button> m_xOKBtn; + std::unique_ptr<weld::Button> m_xApplyBtn; + std::unique_ptr<weld::Button> m_xCancelBtn; + std::unique_ptr<weld::Button> m_xResetBtn; + + SfxItemSet* m_pSet; + std::unique_ptr<SfxItemSet> m_pOutSet; + std::unique_ptr< TabDlg_Impl > m_pImpl; + sal_uInt16* m_pRanges; + bool m_bStandardPushed; + + DECL_DLLPRIVATE_LINK(ActivatePageHdl, const OString&, void); + DECL_DLLPRIVATE_LINK(DeactivatePageHdl, const OString&, bool); + DECL_DLLPRIVATE_LINK(OkHdl, weld::Button&, void); + DECL_DLLPRIVATE_LINK(ResetHdl, weld::Button&, void); + DECL_DLLPRIVATE_LINK(CancelHdl, weld::Button&, void); + SAL_DLLPRIVATE void Init_Impl(bool bFmtFlag); + +protected: + virtual short Ok(); + virtual void RefreshInputSet(); + virtual void PageCreated(const OString &rName, SfxTabPage &rPage); + + SfxItemSet* m_pExampleSet; + SfxItemSet* GetInputSetImpl(); + + /** prepare to leave the current page. Calls the DeactivatePage method of the current page, (if necessary), + handles the item sets to copy. + @return sal_True if it is allowed to leave the current page, sal_False otherwise + */ + bool PrepareLeaveCurrentPage(); + + /** save the position of the TabDialog and which tab page is the currently active one + */ + void SavePosAndId(); + +public: + SfxTabDialogController(weld::Window* pParent, const OUString& rUIXMLDescription, const OString& rID, + const SfxItemSet * = nullptr, bool bEditFmt = false); + virtual ~SfxTabDialogController() override; + + void AddTabPage( const OString& rName, // Name of the label for the page in the notebook .ui + CreateTabPage pCreateFunc, // != 0 + GetTabPageRanges pRangesFunc); // can be 0 + void RemoveTabPage( const OString& rName ); // Name of the label for the page in the notebook .ui + + void SetCurPageId(const OString& rName); + + // may provide local slots converted by Map + const sal_uInt16* GetInputRanges( const SfxItemPool& ); + void SetInputSet( const SfxItemSet* pInSet ); + const SfxItemSet* GetOutputItemSet() const { return m_pOutSet.get(); } + + short execute(); + + const SfxItemSet* GetExampleSet() const { return m_pExampleSet; } + SfxItemSet* GetExampleSet() { return m_pExampleSet; } + + SAL_DLLPRIVATE void Start_Impl(); +}; + namespace sfx { class ItemConnectionBase; } enum class DeactivateRC { @@ -242,6 +308,7 @@ namespace o3tl { class SFX2_DLLPUBLIC SfxTabPage: public TabPage { friend class SfxTabDialog; +friend class SfxTabDialogController; private: const SfxItemSet* pSet; @@ -264,9 +331,13 @@ protected: { return static_cast<const T*>(GetOldItem(rSet, sal_uInt16(nSlot), bDeep)); } + SfxTabDialog* GetTabDialog() const; void SetTabDialog(SfxTabDialog* pDialog); + SfxTabDialogController* GetDialogController() const; + void SetDialogController(SfxTabDialogController* pDialog); + void AddItemConnection( sfx::ItemConnectionBase* pConnection ); public: |