summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-06-15 14:03:31 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-06-17 20:23:08 +0200
commit73b1aeca87d050634bae9194632601561dedec06 (patch)
tree4f3625bbcac39349e4acae2ea7cee7e8ac165f05 /include
parent09205edb4f33d7149d82f192d11f7d405be3d202 (diff)
weld SvxPageDescPage
Change-Id: I5e2457b51a294cbdacc5c78db4ec0a048567b93d Reviewed-on: https://gerrit.libreoffice.org/55952 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/SvxNumOptionsTabPageHelper.hxx4
-rw-r--r--include/svx/frmdirlbox.hxx6
-rw-r--r--include/svx/pagenumberlistbox.hxx17
-rw-r--r--include/svx/papersizelistbox.hxx20
-rw-r--r--include/vcl/weld.hxx32
5 files changed, 66 insertions, 13 deletions
diff --git a/include/svx/SvxNumOptionsTabPageHelper.hxx b/include/svx/SvxNumOptionsTabPageHelper.hxx
index 19e196059ee1..0b9d5040440b 100644
--- a/include/svx/SvxNumOptionsTabPageHelper.hxx
+++ b/include/svx/SvxNumOptionsTabPageHelper.hxx
@@ -23,6 +23,7 @@
#include <com/sun/star/text/DefaultNumberingProvider.hpp>
#include <com/sun/star/text/XNumberingTypeInfo.hpp>
#include <vcl/lstbox.hxx>
+#include <vcl/weld.hxx>
#include <svx/svxdllapi.h>
using namespace css::uno;
@@ -44,7 +45,8 @@ public:
Pass ::std::numeric_limits<sal_uInt16>::max() if there is no such
restriction.
*/
- static void GetI18nNumbering( ListBox& rFmtLB, sal_uInt16 nDoNotRemove );
+ static void GetI18nNumbering(ListBox& rFmtLB, sal_uInt16 nDoNotRemove);
+ static void GetI18nNumbering(weld::ComboBoxText& rFmtLB, sal_uInt16 nDoNotRemove);
};
#endif
diff --git a/include/svx/frmdirlbox.hxx b/include/svx/frmdirlbox.hxx
index ddb5bafc8997..148ae7010d71 100644
--- a/include/svx/frmdirlbox.hxx
+++ b/include/svx/frmdirlbox.hxx
@@ -66,10 +66,14 @@ public:
}
bool get_visible() const { return m_xControl->get_visible(); }
+ void save_value() { m_xControl->save_value(); }
bool get_value_changed_from_saved() const { return m_xControl->get_value_changed_from_saved(); }
SvxFrameDirection get_active_id() const { return static_cast<SvxFrameDirection>(m_xControl->get_active_id().toUInt32()); }
void set_active_id(SvxFrameDirection eDir) { m_xControl->set_active_id(OUString::number(static_cast<sal_uInt32>(eDir))); }
- void save_value() { m_xControl->save_value(); }
+ void remove_id(SvxFrameDirection eDir) { m_xControl->remove_id(OUString::number(static_cast<sal_uInt32>(eDir))); }
+ void hide() { m_xControl->hide(); }
+ void show() { m_xControl->show(); }
+ int get_count() const { return m_xControl->get_count(); }
/** Inserts a string with corresponding direction enum into the listbox. */
void append(SvxFrameDirection eDirection, const OUString& rString)
{
diff --git a/include/svx/pagenumberlistbox.hxx b/include/svx/pagenumberlistbox.hxx
index 0cc32c41ffcd..221ac9b57458 100644
--- a/include/svx/pagenumberlistbox.hxx
+++ b/include/svx/pagenumberlistbox.hxx
@@ -22,6 +22,7 @@
#include <svx/svxdllapi.h>
#include <vcl/lstbox.hxx>
+#include <vcl/weld.hxx>
class SVX_DLLPUBLIC PageNumberListBox : public ListBox
{
@@ -33,5 +34,21 @@ public:
Size GetOptimalSize() const override;
};
+class SVX_DLLPUBLIC SvxPageNumberListBox
+{
+private:
+ std::unique_ptr<weld::ComboBoxText> m_xControl;
+public:
+ SvxPageNumberListBox(weld::ComboBoxText* pControl);
+ void SetSelection( sal_uInt16 );
+ int get_count() const { return m_xControl->get_count(); }
+ OUString get_id(int pos) const { return m_xControl->get_id(pos); }
+ int get_active() const { return m_xControl->get_active(); }
+ void set_active(int pos) { m_xControl->set_active(pos); }
+ void save_value() { m_xControl->save_value(); }
+ bool get_value_changed_from_saved() const { return m_xControl->get_value_changed_from_saved(); }
+ weld::ComboBoxText& get_widget() const { return *m_xControl; }
+};
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/papersizelistbox.hxx b/include/svx/papersizelistbox.hxx
index b477e63eb304..d9ed3b42582d 100644
--- a/include/svx/papersizelistbox.hxx
+++ b/include/svx/papersizelistbox.hxx
@@ -23,6 +23,7 @@
#include <i18nutil/paper.hxx>
#include <svx/svxdllapi.h>
#include <vcl/lstbox.hxx>
+#include <vcl/weld.hxx>
enum class PaperSizeApp
{
@@ -42,5 +43,24 @@ public:
Size GetOptimalSize() const override;
};
+class SVX_DLLPUBLIC SvxPaperSizeListBox
+{
+private:
+ std::unique_ptr<weld::ComboBoxText> m_xControl;
+public:
+ SvxPaperSizeListBox(weld::ComboBoxText *pControl);
+
+ void FillPaperSizeEntries(PaperSizeApp eApp);
+ void SetSelection(Paper eSize);
+ Paper GetSelection() const;
+
+ void connect_changed(const Link<weld::ComboBoxText&, void>& rLink) { m_xControl->connect_changed(rLink); }
+ void clear() { m_xControl->clear(); }
+ void save_value() { return m_xControl->save_value(); }
+ bool get_value_changed_from_saved() const { return m_xControl->get_value_changed_from_saved(); }
+
+ weld::ComboBoxText& get_widget() const { return *m_xControl; }
+};
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 8092b426f925..6fe23154177d 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -255,6 +255,7 @@ public:
virtual void remove(int pos) = 0;
void remove_text(const OUString& rText) { remove(find_text(rText)); }
virtual int find_text(const OUString& rStr) const = 0;
+ void remove_id(const OUString& rId) { remove(find_id(rId)); }
virtual int find_id(const OUString& rId) const = 0;
virtual int get_count() const = 0;
virtual void make_sorted() = 0;
@@ -590,21 +591,30 @@ public:
update_width_chars();
}
+ int convert_value_to(int nValue, FieldUnit eValueUnit) const
+ {
+ return ConvertValue(nValue, m_eSrcUnit, eValueUnit);
+ }
+
+ int convert_value_from(int nValue, FieldUnit eValueUnit) const
+ {
+ return ConvertValue(nValue, eValueUnit, m_eSrcUnit);
+ }
+
void set_value(int nValue, FieldUnit eValueUnit)
{
- m_xSpinButton->set_value(ConvertValue(nValue, eValueUnit, m_eSrcUnit));
+ m_xSpinButton->set_value(convert_value_from(nValue, eValueUnit));
}
int get_value(FieldUnit eDestUnit) const
{
- int nValue = m_xSpinButton->get_value();
- return ConvertValue(nValue, m_eSrcUnit, eDestUnit);
+ return convert_value_to(m_xSpinButton->get_value(), eDestUnit);
}
void set_range(int min, int max, FieldUnit eValueUnit)
{
- min = ConvertValue(min, eValueUnit, m_eSrcUnit);
- max = ConvertValue(max, eValueUnit, m_eSrcUnit);
+ min = convert_value_from(min, eValueUnit);
+ max = convert_value_from(max, eValueUnit);
m_xSpinButton->set_range(min, max);
update_width_chars();
}
@@ -612,8 +622,8 @@ public:
void get_range(int& min, int& max, FieldUnit eDestUnit) const
{
m_xSpinButton->get_range(min, max);
- min = ConvertValue(min, m_eSrcUnit, eDestUnit);
- max = ConvertValue(max, m_eSrcUnit, eDestUnit);
+ min = convert_value_to(min, eDestUnit);
+ max = convert_value_to(max, eDestUnit);
}
void set_min(int min, FieldUnit eValueUnit)
@@ -646,16 +656,16 @@ public:
void set_increments(int step, int page, FieldUnit eValueUnit)
{
- step = ConvertValue(step, eValueUnit, m_eSrcUnit);
- page = ConvertValue(page, eValueUnit, m_eSrcUnit);
+ step = convert_value_from(step, eValueUnit);
+ page = convert_value_from(page, eValueUnit);
m_xSpinButton->set_increments(step, page);
}
void get_increments(int& step, int& page, FieldUnit eDestUnit) const
{
m_xSpinButton->get_increments(step, page);
- step = ConvertValue(step, m_eSrcUnit, eDestUnit);
- page = ConvertValue(page, m_eSrcUnit, eDestUnit);
+ step = convert_value_to(step, eDestUnit);
+ page = convert_value_to(page, eDestUnit);
}
void connect_value_changed(const Link<MetricSpinButton&, void>& rLink)