summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-04-18 21:06:08 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-04-19 09:53:55 +0200
commitcc7cb945846e5b476de917bb90976a4fca175ad1 (patch)
treed50e5a6bb05f1f4dfa0c4b85360ea21e13cd8452 /include
parent8c9c1b852ce0ebc6bd19437e9e583ef4226cf685 (diff)
weld CompressGraphicsDialog
Change-Id: I593e6f0fe2e002c75ecd367a38dda96e7e6552f9 Reviewed-on: https://gerrit.libreoffice.org/53125 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/svx/compressgraphicdialog.hxx84
-rw-r--r--include/vcl/weld.hxx15
2 files changed, 50 insertions, 49 deletions
diff --git a/include/svx/compressgraphicdialog.hxx b/include/svx/compressgraphicdialog.hxx
index 03128ee74fba..ca907aefcede 100644
--- a/include/svx/compressgraphicdialog.hxx
+++ b/include/svx/compressgraphicdialog.hxx
@@ -24,49 +24,36 @@
#include <tools/gen.hxx>
#include <tools/link.hxx>
#include <vcl/bitmap.hxx>
-#include <vcl/dialog.hxx>
+#include <vcl/weld.hxx>
#include <vcl/graph.hxx>
-#include <vcl/vclptr.hxx>
-
-namespace vcl { class Window; }
-
-class Button;
-class CheckBox;
-class ComboBox;
-class Edit;
-class FixedText;
-class ListBox;
-class NumericField;
-class PushButton;
-class RadioButton;
+
class SdrGrafObj;
class SfxBindings;
-class Slider;
class SvStream;
-class SAL_WARN_UNUSED SVX_DLLPUBLIC CompressGraphicsDialog : public ModalDialog
+class SAL_WARN_UNUSED SVX_DLLPUBLIC CompressGraphicsDialog : public weld::GenericDialogController
{
private:
- VclPtr<FixedText> m_pLabelGraphicType;
- VclPtr<FixedText> m_pFixedText2;
- VclPtr<FixedText> m_pFixedText3;
- VclPtr<FixedText> m_pFixedText5;
- VclPtr<FixedText> m_pFixedText6;
-
- VclPtr<CheckBox> m_pReduceResolutionCB;
- VclPtr<NumericField> m_pMFNewWidth;
- VclPtr<NumericField> m_pMFNewHeight;
- VclPtr<ComboBox> m_pResolutionLB;
- VclPtr<RadioButton> m_pLosslessRB;
- VclPtr<RadioButton> m_pJpegCompRB;
- VclPtr<NumericField> m_pCompressionMF;
- VclPtr<Slider> m_pCompressionSlider;
- VclPtr<NumericField> m_pQualityMF;
- VclPtr<Slider> m_pQualitySlider;
- VclPtr<PushButton> m_pBtnCalculate;
- VclPtr<ListBox> m_pInterpolationCombo;
-
- SdrGrafObj* m_pGraphicObj;
+ std::unique_ptr<weld::Label> m_xLabelGraphicType;
+ std::unique_ptr<weld::Label> m_xFixedText2;
+ std::unique_ptr<weld::Label> m_xFixedText3;
+ std::unique_ptr<weld::Label> m_xFixedText5;
+ std::unique_ptr<weld::Label> m_xFixedText6;
+
+ std::unique_ptr<weld::CheckButton> m_xReduceResolutionCB;
+ std::unique_ptr<weld::SpinButton> m_xMFNewWidth;
+ std::unique_ptr<weld::SpinButton> m_xMFNewHeight;
+ std::unique_ptr<weld::ComboBoxText> m_xResolutionLB;
+ std::unique_ptr<weld::RadioButton> m_xLosslessRB;
+ std::unique_ptr<weld::RadioButton> m_xJpegCompRB;
+ std::unique_ptr<weld::SpinButton> m_xCompressionMF;
+ std::unique_ptr<weld::Scale> m_xCompressionSlider;
+ std::unique_ptr<weld::SpinButton> m_xQualityMF;
+ std::unique_ptr<weld::Scale> m_xQualitySlider;
+ std::unique_ptr<weld::Button> m_xBtnCalculate;
+ std::unique_ptr<weld::ComboBoxText> m_xInterpolationCombo;
+
+ SdrGrafObj* m_xGraphicObj;
Graphic m_aGraphic;
Size m_aViewSize100mm;
tools::Rectangle m_aCropRectangle;
@@ -76,17 +63,17 @@ private:
void Initialize();
- DECL_LINK( EndSlideHdl, Slider*, void );
- DECL_LINK( NewInterpolationModifiedHdl, ListBox&, void );
- DECL_LINK( NewQualityModifiedHdl, Edit&, void );
- DECL_LINK( NewCompressionModifiedHdl, Edit&, void );
- DECL_LINK( NewWidthModifiedHdl, Edit&, void );
- DECL_LINK( NewHeightModifiedHdl, Edit&, void );
- DECL_LINK( ResolutionModifiedHdl, Edit&, void );
- DECL_LINK( ToggleCompressionRB, RadioButton&, void );
- DECL_LINK( ToggleReduceResolutionRB, CheckBox&, void );
+ DECL_LINK( SlideHdl, weld::Scale&, void );
+ DECL_LINK( NewInterpolationModifiedHdl, weld::ComboBoxText&, void );
+ DECL_LINK( NewQualityModifiedHdl, weld::Entry&, void );
+ DECL_LINK( NewCompressionModifiedHdl, weld::Entry&, void );
+ DECL_LINK( NewWidthModifiedHdl, weld::Entry&, void );
+ DECL_LINK( NewHeightModifiedHdl, weld::Entry&, void );
+ DECL_LINK( ResolutionModifiedHdl, weld::ComboBoxText&, void );
+ DECL_LINK( ToggleCompressionRB, weld::ToggleButton&, void );
+ DECL_LINK( ToggleReduceResolutionRB, weld::ToggleButton&, void );
- DECL_LINK( CalculateClickHdl, Button*, void );
+ DECL_LINK( CalculateClickHdl, weld::Button&, void );
void Update();
void UpdateNewWidthMF();
@@ -101,10 +88,9 @@ private:
BmpScaleFlag GetSelectedInterpolationType();
public:
- CompressGraphicsDialog( vcl::Window* pParent, SdrGrafObj* pGraphicObj, SfxBindings& rBindings );
- CompressGraphicsDialog( vcl::Window* pParent, Graphic const & rGraphic, Size rViewSize100mm, tools::Rectangle const & rCropRectangle, SfxBindings& rBindings );
+ CompressGraphicsDialog( weld::Window* pParent, SdrGrafObj* pGraphicObj, SfxBindings& rBindings );
+ CompressGraphicsDialog( weld::Window* pParent, Graphic const & rGraphic, Size rViewSize100mm, tools::Rectangle const & rCropRectangle, SfxBindings& rBindings );
virtual ~CompressGraphicsDialog() override;
- virtual void dispose() override;
SdrGrafObj* GetCompressedSdrGrafObj();
Graphic GetCompressedGraphic();
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 4e0d91ac9b0f..116e7c182f07 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -389,6 +389,20 @@ class VCL_DLLPUBLIC RadioButton : virtual public ToggleButton
{
};
+class VCL_DLLPUBLIC Scale : virtual public Widget
+{
+protected:
+ Link<Scale&, void> m_aValueChangedHdl;
+ Link<Scale&, void> m_aOutputHdl;
+
+ void signal_value_changed() { m_aValueChangedHdl.Call(*this); }
+
+public:
+ virtual void set_value(int value) = 0;
+ virtual int get_value() const = 0;
+ void connect_value_changed(const Link<Scale&, void>& rLink) { m_aValueChangedHdl = rLink; }
+};
+
class VCL_DLLPUBLIC Entry : virtual public Widget
{
private:
@@ -724,6 +738,7 @@ public:
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 Scale* weld_scale(const OString& id, bool bTakeOwnership = false) = 0;
virtual DrawingArea* weld_drawing_area(const OString& id, const a11yref& rA11yImpl = nullptr,
FactoryFunction pUITestFactoryFunction = nullptr,
void* pUserData = nullptr, bool bTakeOwnership = false)