diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-06-14 13:05:26 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-06-14 22:08:10 +0200 |
commit | 8b0dae14a5af0ad2892bac0e606467af6148c8d1 (patch) | |
tree | 0b26bbcf1b9451f50030428871f284c51d35c8f8 /include | |
parent | 5ff02146cd832f86cf66e4f5a7b3ca826f5ef839 (diff) |
weld SvxStdParagraphTabPage
Change-Id: I02b0f2e4f049b407a3ac0c7f304cbcd0cc652749
Reviewed-on: https://gerrit.libreoffice.org/55818
Tested-by: Jenkins
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/paraprev.hxx | 29 | ||||
-rw-r--r-- | include/svx/relfld.hxx | 42 | ||||
-rw-r--r-- | include/vcl/weld.hxx | 4 |
3 files changed, 73 insertions, 2 deletions
diff --git a/include/svx/paraprev.hxx b/include/svx/paraprev.hxx index abc424e24155..07545fc00202 100644 --- a/include/svx/paraprev.hxx +++ b/include/svx/paraprev.hxx @@ -102,6 +102,10 @@ public: { aText = rStr; } + void SetSize( Size aNew ) + { + aSize = aNew; + } OUString GetText() const override { return aText; @@ -120,6 +124,7 @@ class SVX_DLLPUBLIC ParaPrevWindow final : public weld::CustomWidgetController // last line in justification SvxAdjust eLastLine; + OUString aText; tools::Rectangle Lines[9]; virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override; @@ -129,6 +134,10 @@ class SVX_DLLPUBLIC ParaPrevWindow final : public weld::CustomWidgetController public: ParaPrevWindow(); + void SetFirstLineOfst( short nNew ) + { + nFirstLineOfst = nNew; + } void SetLeftMargin( long nNew ) { nLeftMargin = nNew; @@ -137,6 +146,14 @@ public: { nRightMargin = nNew; } + void SetUpper( sal_uInt16 nNew ) + { + nUpper = nNew; + } + void SetLower( sal_uInt16 nNew ) + { + nLower = nNew; + } void SetAdjust( SvxAdjust eNew ) { eAdjust = eNew; @@ -145,10 +162,22 @@ public: { eLastLine = eNew; } + void SetLineSpace( SvxPrevLineSpace eNew ) + { + eLine = eNew; + } + void SetText( const OUString& rStr ) + { + aText = rStr; + } void SetSize( Size aNew ) { aSize = aNew; } + OUString GetText() const + { + return aText; + } }; diff --git a/include/svx/relfld.hxx b/include/svx/relfld.hxx index 867c975e7005..f5206a534c74 100644 --- a/include/svx/relfld.hxx +++ b/include/svx/relfld.hxx @@ -20,7 +20,9 @@ #define INCLUDED_SVX_RELFLD_HXX #include <tools/fldunit.hxx> +#include <svtools/unitconv.hxx> #include <vcl/field.hxx> +#include <vcl/weld.hxx> #include <svx/svxdllapi.h> class SVX_DLLPUBLIC SvxRelativeField : public MetricField @@ -44,6 +46,46 @@ public: void EnableNegativeMode() {bNegativeEnabled = true;} }; +class SVX_DLLPUBLIC RelativeField +{ +private: + std::unique_ptr<weld::MetricSpinButton> m_xSpinButton; + + sal_uInt16 nRelMin; + sal_uInt16 nRelMax; + bool bRelativeMode; + bool bRelative; + bool bNegativeEnabled; + + DECL_LINK(ModifyHdl, weld::Entry&, void); + +public: + RelativeField(weld::MetricSpinButton* pControl); + + void EnableRelativeMode( sal_uInt16 nMin, sal_uInt16 nMax ); + void SetRelative( bool bRelative ); + bool IsRelative() const { return bRelative; } + void EnableNegativeMode() {bNegativeEnabled = true;} + + void set_sensitive(bool sensitive) { m_xSpinButton->set_sensitive(sensitive); } + void set_value(int nValue, FieldUnit eValueUnit) { m_xSpinButton->set_value(nValue, eValueUnit); } + int get_value(FieldUnit eDestUnit) const { return m_xSpinButton->get_value(eDestUnit); } + int get_min(FieldUnit eValueUnit) const { return m_xSpinButton->get_min(eValueUnit); } + void set_min(int min, FieldUnit eValueUnit) { m_xSpinButton->set_min(min, eValueUnit); } + void set_max(int max, FieldUnit eValueUnit) { m_xSpinButton->set_max(max, eValueUnit); } + int normalize(int nValue) const { return m_xSpinButton->normalize(nValue); } + int denormalize(int nValue) const { return m_xSpinButton->denormalize(nValue); } + void connect_value_changed(const Link<weld::MetricSpinButton&, void>& rLink) { m_xSpinButton->connect_value_changed(rLink); } + OUString get_text() const { return m_xSpinButton->get_text(); } + void set_text(const OUString& rText) { m_xSpinButton->set_text(rText); } + void save_value() { m_xSpinButton->save_value(); } + bool get_value_changed_from_saved() const { return m_xSpinButton->get_value_changed_from_saved(); } + + int GetCoreValue(MapUnit eUnit) const { return ::GetCoreValue(*m_xSpinButton, eUnit); } + void SetFieldUnit(FieldUnit eUnit, bool bAll = false) { ::SetFieldUnit(*m_xSpinButton, eUnit, bAll); } + void SetMetricValue(int lCoreValue, MapUnit eUnit) { ::SetMetricValue(*m_xSpinButton, lCoreValue, eUnit); } +}; + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index d0c5c220f375..8092b426f925 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -630,14 +630,14 @@ public: set_range(min, max, eValueUnit); } - int get_min(FieldUnit eValueUnit) + int get_min(FieldUnit eValueUnit) const { int min, dummy; get_range(min, dummy, eValueUnit); return min; } - int get_max(FieldUnit eValueUnit) + int get_max(FieldUnit eValueUnit) const { int dummy, max; get_range(dummy, max, eValueUnit); |