diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-04-20 13:05:24 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-04-23 12:33:44 +0200 |
commit | c0af8057188c0e95831f9e6d1ef96a424da6f9b2 (patch) | |
tree | 6509c67d0cfcc42e3b107004167f2efcccda43cd /include | |
parent | 27e26fc4286f66ab1bf4c807d86b8f3254c5c68b (diff) |
weld SfxPrintOptionsDialog
and SwMMResultPrintDialog
Change-Id: Icded6a26a3a151293bea0c9173334cf634283e89
Reviewed-on: https://gerrit.libreoffice.org/53299
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/prnmon.hxx | 19 | ||||
-rw-r--r-- | include/sfx2/tabdlg.hxx | 4 | ||||
-rw-r--r-- | include/sfx2/viewsh.hxx | 2 | ||||
-rw-r--r-- | include/svtools/prnsetup.hxx | 50 | ||||
-rw-r--r-- | include/vcl/print.hxx | 7 | ||||
-rw-r--r-- | include/vcl/weld.hxx | 6 |
6 files changed, 43 insertions, 45 deletions
diff --git a/include/sfx2/prnmon.hxx b/include/sfx2/prnmon.hxx index 4f1bacd93e80..66dec0442723 100644 --- a/include/sfx2/prnmon.hxx +++ b/include/sfx2/prnmon.hxx @@ -22,33 +22,32 @@ #include <memory> #include <sal/config.h> #include <sfx2/dllapi.h> - -#include <vcl/button.hxx> -#include <vcl/dialog.hxx> #include <sfx2/printer.hxx> +#include <vcl/weld.hxx> class SfxViewShell; struct SfxPrintOptDlg_Impl; -class SfxPrintOptionsDialog : public ModalDialog +class SfxPrintOptionsDialog : public weld::GenericDialogController { private: std::unique_ptr<SfxPrintOptDlg_Impl> pDlgImpl; SfxViewShell* pViewSh; std::unique_ptr<SfxItemSet> pOptions; VclPtr<SfxTabPage> pPage; + std::unique_ptr<weld::Widget> m_xHelpBtn; + std::unique_ptr<weld::Container> m_xContainer; + DECL_LINK(HelpRequestHdl, weld::Widget&, bool); public: - SfxPrintOptionsDialog( vcl::Window *pParent, - SfxViewShell *pViewShell, - const SfxItemSet *rOptions ); + SfxPrintOptionsDialog(weld::Window *pParent, + SfxViewShell *pViewShell, + const SfxItemSet *rOptions); virtual ~SfxPrintOptionsDialog() override; - virtual void dispose() override; - virtual short Execute() override; - virtual bool EventNotify( NotifyEvent& rNEvt ) override; + short execute(); const SfxItemSet& GetOptions() const { return *pOptions; } void DisableHelp(); diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx index 72ba2378fcfe..f171de346dce 100644 --- a/include/sfx2/tabdlg.hxx +++ b/include/sfx2/tabdlg.hxx @@ -47,13 +47,13 @@ struct TabPageParent , pPage(nullptr) { } - TabPageParent(weld::Window* _pPage) + TabPageParent(weld::Container* _pPage) : pParent(nullptr) , pPage(_pPage) { } VclPtr<vcl::Window> pParent; - weld::Widget* pPage; + weld::Container* pPage; }; typedef VclPtr<SfxTabPage> (*CreateTabPage)(TabPageParent pParent, const SfxItemSet *rAttrSet); diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx index f29f94c87591..8f72837bbdaa 100644 --- a/include/sfx2/viewsh.hxx +++ b/include/sfx2/viewsh.hxx @@ -244,7 +244,7 @@ public: virtual SfxPrinter* GetPrinter( bool bCreate = false ); virtual sal_uInt16 SetPrinter( SfxPrinter *pNewPrinter, SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL ); virtual bool HasPrintOptionsPage() const; - virtual VclPtr<SfxTabPage> CreatePrintOptionsPage( TabPageParent pParent, const SfxItemSet &rOptions ); + virtual VclPtr<SfxTabPage> CreatePrintOptionsPage(weld::Container* pPage, const SfxItemSet &rOptions); Printer* GetActivePrinter() const; // Working set diff --git a/include/svtools/prnsetup.hxx b/include/svtools/prnsetup.hxx index 64c2ed5d4d7e..f1f5b6c73832 100644 --- a/include/svtools/prnsetup.hxx +++ b/include/svtools/prnsetup.hxx @@ -21,64 +21,58 @@ #define INCLUDED_SVTOOLS_PRNSETUP_HXX #include <svtools/svtdllapi.h> - -#include <vcl/dialog.hxx> -#include <vcl/fixed.hxx> -#include <vcl/button.hxx> -#include <vcl/group.hxx> -#include <vcl/lstbox.hxx> +#include <vcl/weld.hxx> #include <vcl/timer.hxx> class Printer; class QueueInfo; - -class SVT_DLLPUBLIC PrinterSetupDialog : public ModalDialog +class SVT_DLLPUBLIC PrinterSetupDialog : public weld::GenericDialogController { private: - VclPtr<ListBox> m_pLbName; - VclPtr<PushButton> m_pBtnProperties; - VclPtr<PushButton> m_pBtnOptions; - VclPtr<FixedText> m_pFiStatus; - VclPtr<FixedText> m_pFiType; - VclPtr<FixedText> m_pFiLocation; - VclPtr<FixedText> m_pFiComment; + std::unique_ptr<weld::ComboBoxText> m_xLbName; + std::unique_ptr<weld::Button> m_xBtnProperties; + std::unique_ptr<weld::Button> m_xBtnOptions; + std::unique_ptr<weld::Label> m_xFiStatus; + std::unique_ptr<weld::Label> m_xFiType; + std::unique_ptr<weld::Label> m_xFiLocation; + std::unique_ptr<weld::Label> m_xFiComment; AutoTimer maStatusTimer; VclPtr<Printer> mpPrinter; VclPtr<Printer> mpTempPrinter; SVT_DLLPRIVATE void ImplSetInfo(); - DECL_DLLPRIVATE_LINK( ImplPropertiesHdl, Button*, void ); - DECL_DLLPRIVATE_LINK( ImplChangePrinterHdl, ListBox&, void ); - DECL_DLLPRIVATE_LINK( ImplStatusHdl, Timer*, void ); + DECL_DLLPRIVATE_LINK( ImplPropertiesHdl, weld::Button&, void ); + DECL_DLLPRIVATE_LINK( ImplChangePrinterHdl, weld::ComboBoxText&, void ); + DECL_DLLPRIVATE_LINK( ImplGetFocusHdl, weld::Widget&, void ); + DECL_DLLPRIVATE_LINK( ImplStatusHdl, Timer*, void ); + DECL_DLLPRIVATE_LINK( ImplDataChangedHdl, VclSimpleEvent&, void); public: - PrinterSetupDialog( vcl::Window* pWindow ); + PrinterSetupDialog(weld::Window* pWindow); virtual ~PrinterSetupDialog() override; - virtual void dispose() override; void SetPrinter( Printer* pNewPrinter ) { mpPrinter = pNewPrinter; } Printer* GetPrinter() const { return mpPrinter; } - virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; - virtual bool EventNotify( NotifyEvent& rNEvt ) override; + short execute(); - virtual short Execute() override; + weld::Window* GetFrameWeld() const { return m_xDialog.get(); } - void SetOptionsHdl( const Link<Button*,void>& rLink ); + void SetOptionsHdl( const Link<weld::Button&,void>& rLink ); }; #define IMPL_PRINTDLG_STATUS_UPDATE 15000 void ImplFillPrnDlgListBox( const Printer* pPrinter, - ListBox* pBox, PushButton* pPropBtn ); -void ImplFreePrnDlgListBox( ListBox* pBox, bool bClear = true ); -Printer* ImplPrnDlgListBoxSelect( ListBox const * pBox, PushButton* pPropBtn, + weld::ComboBoxText* pBox, weld::Button* pPropBtn ); +void ImplFreePrnDlgListBox( weld::ComboBoxText* pBox, bool bClear = true ); +Printer* ImplPrnDlgListBoxSelect( weld::ComboBoxText const * pBox, weld::Button* pPropBtn, Printer const * pPrinter, Printer* pTempPrinter ); Printer* ImplPrnDlgUpdatePrinter( Printer const * pPrinter, Printer* pTempPrinter ); -void ImplPrnDlgUpdateQueueInfo( ListBox const * pBox, QueueInfo& rInfo ); +void ImplPrnDlgUpdateQueueInfo( weld::ComboBoxText const * pBox, QueueInfo& rInfo ); OUString ImplPrnDlgGetStatusText( const QueueInfo& rInfo ); #endif // INCLUDED_SVTOOLS_PRNSETUP_HXX diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx index ae40d76ce96f..0c14fb3f2955 100644 --- a/include/vcl/print.hxx +++ b/include/vcl/print.hxx @@ -51,6 +51,7 @@ namespace vcl { class PrintDialog; } +namespace weld { class Window; } enum class PrinterSupport { @@ -291,8 +292,8 @@ public: bool SetJobSetup( const JobSetup& rSetup ); const JobSetup& GetJobSetup() const { return maJobSetup; } - bool Setup( vcl::Window* pWindow, - PrinterSetupMode eMode = PrinterSetupMode::DocumentGlobal ); + bool Setup(weld::Window* pWindow, + PrinterSetupMode eMode = PrinterSetupMode::DocumentGlobal); bool SetPrinterProps( const Printer* pPrinter ); /** SetPrinterOptions is used internally only now @@ -559,7 +560,7 @@ public: SAL_DLLPRIVATE void pushPropertiesToPrinter(); SAL_DLLPRIVATE void resetPaperToLastConfigured(); VCL_PLUGIN_PUBLIC void setJobState( css::view::PrintableState ); - SAL_DLLPRIVATE void setupPrinter( vcl::Window* i_pDlgParent ); + SAL_DLLPRIVATE void setupPrinter( weld::Window* i_pDlgParent ); SAL_DLLPRIVATE int getPageCountProtected() const; SAL_DLLPRIVATE css::uno::Sequence< css::beans::PropertyValue > diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index ae9931eb2b0c..93c5b55ed644 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -37,7 +37,8 @@ public: virtual void set_sensitive(bool sensitive) = 0; virtual bool get_sensitive() const = 0; virtual void set_visible(bool visible) = 0; - virtual bool get_visible() const = 0; + virtual bool get_visible() const = 0; //if this widget visibility is true + virtual bool is_visible() const = 0; //if this widget visibility and all parents is true virtual void grab_focus() = 0; virtual bool has_focus() const = 0; virtual void show() = 0; @@ -155,6 +156,8 @@ public: void connect_help(const Link<Widget&, bool>& rLink) { m_aHelpRequestHdl = rLink; } + virtual SystemEnvData get_system_data() const = 0; + virtual void resize_to_request() = 0; }; @@ -189,6 +192,7 @@ public: = 0; virtual void set_default_response(int response) = 0; virtual Button* get_widget_for_response(int response) = 0; + virtual Container* weld_content_area() = 0; }; class VCL_DLLPUBLIC MessageDialog : virtual public Dialog |