diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-03-06 12:25:35 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-03-07 21:18:42 +0100 |
commit | 82925b574209d3971c05b9bd98a317683dd583a5 (patch) | |
tree | 7fedf333686a3c25942debf82328978e97d7a437 /include | |
parent | 64117f700ba3bd8c4b42488f582fa5e5c53487e6 (diff) |
weld SfxNewFileDialog
Change-Id: I28b1aff90407bce7d04f10eed6a227c0970f9c0a
Reviewed-on: https://gerrit.libreoffice.org/50878
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')
-rw-r--r-- | include/sfx2/new.hxx | 52 | ||||
-rw-r--r-- | include/vcl/weld.hxx | 30 |
2 files changed, 67 insertions, 15 deletions
diff --git a/include/sfx2/new.hxx b/include/sfx2/new.hxx index 200a15e186bb..91539cb7a048 100644 --- a/include/sfx2/new.hxx +++ b/include/sfx2/new.hxx @@ -22,18 +22,17 @@ #include <memory> #include <sal/config.h> #include <sfx2/dllapi.h> +#include <sfx2/objsh.hxx> -#include <vcl/button.hxx> -#include <vcl/lstbox.hxx> -#include <vcl/edit.hxx> -#include <vcl/fixed.hxx> -#include <sfx2/basedlgs.hxx> +#include <vcl/idle.hxx> +#include <vcl/weld.hxx> +#include <sfx2/doctempl.hxx> #include <o3tl/typed_flags_set.hxx> class SfxObjectShellLock; class SfxObjectShell; - +class SfxPreviewWin_Impl; enum class SfxNewFileDialogMode { NONE, Preview, LoadTemplate @@ -55,19 +54,42 @@ namespace o3tl #define RET_TEMPLATE_LOAD 100 -class SfxNewFileDialog_Impl; -class SFX2_DLLPUBLIC SfxNewFileDialog : public SfxModalDialog +class SFX2_DLLPUBLIC SfxNewFileDialog { - friend class SfxNewFileDialog_Impl; - private: - std::unique_ptr< SfxNewFileDialog_Impl > pImpl; + std::unique_ptr<weld::Builder> m_xBuilder; + std::unique_ptr<weld::Dialog> m_xDialog; + std::unique_ptr<weld::TreeView> m_xRegionLb; + std::unique_ptr<weld::TreeView> m_xTemplateLb; + std::unique_ptr<weld::CheckButton> m_xTextStyleCB; + std::unique_ptr<weld::CheckButton> m_xFrameStyleCB; + std::unique_ptr<weld::CheckButton> m_xPageStyleCB; + std::unique_ptr<weld::CheckButton> m_xNumStyleCB; + std::unique_ptr<weld::CheckButton> m_xMergeStyleCB; + std::unique_ptr<weld::Button> m_xLoadFilePB; + std::unique_ptr<weld::Expander> m_xMoreBt; + std::unique_ptr<SfxPreviewWin_Impl> m_xPreviewWin; + std::unique_ptr<weld::Label> m_xAltTitleFt; + Idle m_aPrevIdle; + OUString m_sLoadTemplate; + + SfxNewFileDialogMode m_nFlags; + SfxDocumentTemplates m_aTemplates; + SfxObjectShellLock m_xDocShell; + + DECL_LINK( Update, Timer *, void ); + + DECL_LINK(RegionSelect, weld::TreeView&, void); + DECL_LINK(TemplateSelect, weld::TreeView&, void); + DECL_LINK(DoubleClick, weld::TreeView&, void); + DECL_LINK(Expand, weld::Expander&, void); + sal_uInt16 GetSelectedTemplatePos() const; public: - - SfxNewFileDialog(vcl::Window *pParent, SfxNewFileDialogMode nFlags); - virtual ~SfxNewFileDialog() override; - virtual void dispose() override; + SfxNewFileDialog(weld::Window *pParent, SfxNewFileDialogMode nFlags); + void set_title(const OUString& rTitle) { m_xDialog->set_title(rTitle); } + short run() { return m_xDialog->run(); } + ~SfxNewFileDialog(); // Returns false, when '- No -' is set as Template // Template names can only be obtained when IsTemplate() returns true. diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 9a46a191e7a0..b861b848e84c 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -99,10 +99,25 @@ protected: public: virtual void set_title(const OUString& rTitle) = 0; virtual OUString get_title() const = 0; + virtual void set_busy_cursor(bool bBusy) = 0; void connect_help(const Link<Widget&, bool>& rLink) { m_aHelpRequestHdl = rLink; } }; +class VCL_DLLPUBLIC WaitObject +{ +private: + weld::Window* m_pWindow; + +public: + WaitObject(weld::Window* pWindow) + : m_pWindow(pWindow) + { + m_pWindow->set_busy_cursor(true); + } + ~WaitObject() { m_pWindow->set_busy_cursor(false); } +}; + class VCL_DLLPUBLIC Dialog : virtual public Window { public: @@ -455,6 +470,20 @@ public: virtual void set_selection(const Selection&) = 0; }; +class VCL_DLLPUBLIC Expander : virtual public Container +{ +protected: + Link<Expander&, void> m_aExpandedHdl; + + void signal_expanded() { m_aExpandedHdl.Call(*this); } + +public: + virtual bool get_expanded() const = 0; + virtual void set_expanded(bool bExpand) = 0; + + void connect_expanded(const Link<Expander&, void>& rLink) { m_aExpandedHdl = rLink; } +}; + class VCL_DLLPUBLIC DrawingArea : virtual public Widget { protected: @@ -500,6 +529,7 @@ public: virtual TreeView* weld_tree_view(const OString& id, bool bTakeOwnership = false) = 0; virtual Label* weld_label(const OString& id, bool bTakeOwnership = false) = 0; virtual TextView* weld_text_view(const OString& id, bool bTakeOwnership = false) = 0; + virtual Expander* weld_expander(const OString& id, bool bTakeOwnership = false) = 0; virtual Entry* weld_entry(const OString& id, bool bTakeOwnership = false) = 0; virtual DrawingArea* weld_drawing_area(const OString& id, bool bTakeOwnership = false) = 0; virtual ~Builder() {} |