summaryrefslogtreecommitdiff
path: root/include/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-06-15 12:34:40 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-06-16 20:16:41 +0200
commit0af04819bc0352f58b45a945fbb1451e3f8ba605 (patch)
treedda777128b8ffe318a18a62100cdf7216efdc0dc /include/svx
parent5d680efbcce0ba73487314a910337ac5b0e8060b (diff)
weld SvxHFPage
Change-Id: I9e39e276c64da4fca01ff79ebbb42d6f342f0379 Reviewed-on: https://gerrit.libreoffice.org/55863 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include/svx')
-rw-r--r--include/svx/hdft.hxx49
-rw-r--r--include/svx/pagectrl.hxx123
2 files changed, 147 insertions, 25 deletions
diff --git a/include/svx/hdft.hxx b/include/svx/hdft.hxx
index 2e6d14dc7cce..d7d910c772ba 100644
--- a/include/svx/hdft.hxx
+++ b/include/svx/hdft.hxx
@@ -21,6 +21,7 @@
#include <sfx2/tabdlg.hxx>
+#include <vcl/customweld.hxx>
#include <vcl/fixed.hxx>
#include <vcl/field.hxx>
#include <vcl/group.hxx>
@@ -47,7 +48,6 @@ public:
virtual void Reset( const SfxItemSet* rSet ) override;
virtual ~SvxHFPage() override;
- virtual void dispose() override;
void DisableDeleteQueryBox() { mbDisableQueryBox = true; }
@@ -61,37 +61,36 @@ protected:
virtual void ActivatePage( const SfxItemSet& rSet ) override;
virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
- SvxHFPage( vcl::Window* pParent, const SfxItemSet& rSet, sal_uInt16 nSetId );
-
- VclPtr<FixedText> m_pPageLbl;
- VclPtr<CheckBox> m_pTurnOnBox;
- VclPtr<CheckBox> m_pCntSharedBox;
- VclPtr<CheckBox> m_pCntSharedFirstBox;
- VclPtr<FixedText> m_pLMLbl;
- VclPtr<MetricField> m_pLMEdit;
- VclPtr<FixedText> m_pRMLbl;
- VclPtr<MetricField> m_pRMEdit;
- VclPtr<FixedText> m_pDistFT;
- VclPtr<MetricField> m_pDistEdit;
- VclPtr<CheckBox> m_pDynSpacingCB;
- VclPtr<FixedText> m_pHeightFT;
- VclPtr<MetricField> m_pHeightEdit;
- VclPtr<CheckBox> m_pHeightDynBtn;
- VclPtr<SvxPageWindow> m_pBspWin;
- VclPtr<PushButton> m_pBackgroundBtn;
+ SvxHFPage(TabPageParent pParent, const SfxItemSet& rSet, sal_uInt16 nSetId);
sal_uInt16 nId;
std::unique_ptr<SfxItemSet> pBBSet;
bool mbDisableQueryBox : 1;
bool mbEnableDrawingLayerFillStyles : 1;
+ PageWindow m_aBspWin;
+ std::unique_ptr<weld::Label> m_xPageLbl;
+ std::unique_ptr<weld::CheckButton> m_xTurnOnBox;
+ std::unique_ptr<weld::CheckButton> m_xCntSharedBox;
+ std::unique_ptr<weld::CheckButton> m_xCntSharedFirstBox;
+ std::unique_ptr<weld::Label> m_xLMLbl;
+ std::unique_ptr<weld::MetricSpinButton>m_xLMEdit;
+ std::unique_ptr<weld::Label> m_xRMLbl;
+ std::unique_ptr<weld::MetricSpinButton> m_xRMEdit;
+ std::unique_ptr<weld::Label> m_xDistFT;
+ std::unique_ptr<weld::MetricSpinButton> m_xDistEdit;
+ std::unique_ptr<weld::CheckButton> m_xDynSpacingCB;
+ std::unique_ptr<weld::Label> m_xHeightFT;
+ std::unique_ptr<weld::MetricSpinButton> m_xHeightEdit;
+ std::unique_ptr<weld::CheckButton> m_xHeightDynBtn;
+ std::unique_ptr<weld::Button> m_xBackgroundBtn;
+ std::unique_ptr<weld::CustomWeld> m_xBspWin;
+
void InitHandler();
- DECL_LINK(TurnOnHdl, Button*, void);
- DECL_LINK(DistModify, Edit&, void);
- DECL_LINK(HeightModify, Edit&, void);
- DECL_LINK(BorderModify, Edit&, void);
- DECL_LINK(BackgroundHdl, Button*, void);
- DECL_LINK(RangeFocusHdl, Control&, void);
+ void TurnOn(weld::ToggleButton* pButton);
+ DECL_LINK(TurnOnHdl, weld::ToggleButton&, void);
+ DECL_LINK(BackgroundHdl, weld::Button&, void);
+ DECL_LINK(ValueChangeHdl, weld::MetricSpinButton&, void);
void RangeHdl();
void UpdateExample();
diff --git a/include/svx/pagectrl.hxx b/include/svx/pagectrl.hxx
index cf2065cc4f38..8f1dc24192e8 100644
--- a/include/svx/pagectrl.hxx
+++ b/include/svx/pagectrl.hxx
@@ -19,6 +19,7 @@
#ifndef INCLUDED_SVX_PAGECTRL_HXX
#define INCLUDED_SVX_PAGECTRL_HXX
+#include <vcl/customweld.hxx>
#include <vcl/window.hxx>
#include <svx/svxdllapi.h>
#include <svx/sdr/attribute/sdrallfillattributeshelper.hxx>
@@ -152,6 +153,128 @@ public:
virtual Size GetOptimalSize() const override;
};
+class SVX_DLLPUBLIC PageWindow : public weld::CustomWidgetController
+{
+private:
+ Size aWinSize;
+ Size aSize;
+
+ long nTop;
+ long nBottom;
+ long nLeft;
+ long nRight;
+
+ bool bResetBackground;
+ bool bFrameDirection;
+ SvxFrameDirection nFrameDirection;
+
+ long nHdLeft;
+ long nHdRight;
+ long nHdDist;
+ long nHdHeight;
+
+ long nFtLeft;
+ long nFtRight;
+ long nFtDist;
+ long nFtHeight;
+
+ drawinglayer::attribute::SdrAllFillAttributesHelperPtr maHeaderFillAttributes;
+ drawinglayer::attribute::SdrAllFillAttributesHelperPtr maFooterFillAttributes;
+ drawinglayer::attribute::SdrAllFillAttributesHelperPtr maPageFillAttributes;
+
+ bool bFooter : 1;
+ bool bHeader : 1;
+ bool bTable : 1;
+ bool bHorz : 1;
+ bool bVert : 1;
+
+ SvxPageUsage eUsage;
+
+protected:
+ virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
+
+ virtual void DrawPage(vcl::RenderContext& rRenderContext, const Point& rPoint,
+ const bool bSecond, const bool bEnabled);
+
+ void drawFillAttributes(vcl::RenderContext& rRenderContext,
+ const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes,
+ const tools::Rectangle& rPaintRange, const tools::Rectangle& rDefineRange);
+
+public:
+ PageWindow();
+ virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
+ virtual ~PageWindow() override;
+
+ void setHeaderFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes)
+ {
+ maHeaderFillAttributes = rFillAttributes;
+ }
+ void setFooterFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes)
+ {
+ maFooterFillAttributes = rFillAttributes;
+ }
+ void setPageFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes)
+ {
+ maPageFillAttributes = rFillAttributes;
+ }
+ const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& getPageFillAttributes() const
+ {
+ return maPageFillAttributes;
+ }
+ void SetSize(const Size& rSize)
+ {
+ aSize = rSize;
+ }
+ const Size& GetSize() const
+ {
+ return aSize;
+ }
+
+ void SetTop(long nNew) { nTop = nNew; }
+ void SetBottom(long nNew) { nBottom = nNew; }
+ void SetLeft(long nNew) { nLeft = nNew; }
+ void SetRight(long nNew) { nRight = nNew; }
+
+ long GetTop() const { return nTop; }
+ long GetBottom() const { return nBottom; }
+ long GetLeft() const { return nLeft; }
+ long GetRight() const { return nRight; }
+
+ void SetHdLeft(long nNew) { nHdLeft = nNew; }
+ void SetHdRight(long nNew) { nHdRight = nNew; }
+ void SetHdDist(long nNew) { nHdDist = nNew; }
+ void SetHdHeight(long nNew) { nHdHeight = nNew; }
+
+ long GetHdLeft() const { return nHdLeft; }
+ long GetHdRight() const { return nHdRight; }
+ long GetHdDist() const { return nHdDist; }
+ long GetHdHeight() const { return nHdHeight; }
+
+ void SetFtLeft(long nNew) { nFtLeft = nNew; }
+ void SetFtRight(long nNew) { nFtRight = nNew; }
+ void SetFtDist(long nNew) { nFtDist = nNew; }
+ void SetFtHeight(long nNew) { nFtHeight = nNew; }
+
+ long GetFtLeft() const { return nFtLeft; }
+ long GetFtRight() const { return nFtRight; }
+ long GetFtDist() const { return nFtDist; }
+ long GetFtHeight() const { return nFtHeight; }
+
+ void SetUsage(SvxPageUsage eU) { eUsage = eU; }
+ SvxPageUsage GetUsage() const { return eUsage; }
+
+ void SetHeader( bool bNew ) { bHeader = bNew; }
+ void SetFooter( bool bNew ) { bFooter = bNew; }
+ void SetTable( bool bNew ) { bTable = bNew; }
+ void SetHorz( bool bNew ) { bHorz = bNew; }
+ void SetVert( bool bNew ) { bVert = bNew; }
+
+ void EnableFrameDirection(bool bEnable);
+ void SetFrameDirection(SvxFrameDirection nDirection);
+
+ void ResetBackground();
+};
+
#endif // INCLUDED_SVX_PAGECTRL_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */