22#include <com/sun/star/beans/PropertyValue.hpp>
30#include <bitmaps.hlst>
52 mpImpl->maImageSingleColumn =
Image(StockImage::Yes, RID_BMP_VIEWLAYOUT_SINGLECOLUMN);
53 mpImpl->maImageSingleColumn_Active =
Image(StockImage::Yes, RID_BMP_VIEWLAYOUT_SINGLECOLUMN_ACTIVE);
54 mpImpl->maImageAutomatic =
Image(StockImage::Yes, RID_BMP_VIEWLAYOUT_AUTOMATIC);
55 mpImpl->maImageAutomatic_Active =
Image(StockImage::Yes, RID_BMP_VIEWLAYOUT_AUTOMATIC_ACTIVE);
56 mpImpl->maImageBookMode =
Image(StockImage::Yes, RID_BMP_VIEWLAYOUT_BOOKMODE);
57 mpImpl->maImageBookMode_Active =
Image(StockImage::Yes, RID_BMP_VIEWLAYOUT_BOOKMODE_ACTIVE);
66 if ( SfxItemState::DEFAULT != eState || pState->
IsVoidItem() )
73 assert(
dynamic_cast< const SvxViewLayoutItem *
>( pState ) &&
"invalid item type" );
75 const bool bBookMode =
static_cast<const SvxViewLayoutItem*
>( pState )->IsBookMode();
81 else if ( 0 == nColumns )
84 else if ( bBookMode && 2 == nColumns )
102 const bool bSingleColumn = 0 ==
mpImpl->mnState;
103 const bool bAutomatic = 1 ==
mpImpl->mnState;
104 const bool bBookMode = 2 ==
mpImpl->mnState;
105 const int nDistance = 6;
107 const tools::Long nImageWidthSum =
mpImpl->maImageSingleColumn.GetSizePixel().Width() +
108 mpImpl->maImageAutomatic.GetSizePixel().Width() +
109 mpImpl->maImageBookMode.GetSizePixel().Width();
121 aRect.
AdjustLeft(
mpImpl->maImageSingleColumn.GetSizePixel().Width() + nDistance);
125 aRect.
AdjustLeft(
mpImpl->maImageAutomatic.GetSizePixel().Width() + nDistance);
142 sal_uInt16 nColumns = 1;
143 bool bBookMode =
false;
145 const tools::Long nImageWidthSingle =
mpImpl->maImageSingleColumn.GetSizePixel().Width();
146 const tools::Long nImageWidthAuto =
mpImpl->maImageAutomatic.GetSizePixel().Width();
147 const tools::Long nImageWidthBook =
mpImpl->maImageBookMode.GetSizePixel().Width();
148 const tools::Long nImageWidthSum = nImageWidthSingle + nImageWidthAuto + nImageWidthBook;
152 if ( nXDiff < nXOffset + nImageWidthSingle )
157 else if ( nXDiff < nXOffset + nImageWidthSingle + nImageWidthAuto )
190 const tools::Long nImageWidthSingle =
mpImpl->maImageSingleColumn.GetSizePixel().Width();
191 const tools::Long nImageWidthAuto =
mpImpl->maImageAutomatic.GetSizePixel().Width();
192 const tools::Long nImageWidthBook =
mpImpl->maImageBookMode.GetSizePixel().Width();
193 const tools::Long nImageWidthSum = nImageWidthSingle + nImageWidthAuto + nImageWidthBook;
197 if ( nXDiff < nXOffset + nImageWidthSingle )
201 else if ( nXDiff < nXOffset + nImageWidthSingle + nImageWidthAuto )
const Point & GetPosPixel() const
void DrawRect(const tools::Rectangle &rRect)
void DrawImage(const Point &rPos, const Image &rImage, DrawImageFlags nStyle=DrawImageFlags::NONE)
constexpr tools::Long X() const
virtual bool IsVoidItem() const
StatusBar & GetStatusBar() const
void SetItemText(sal_uInt16 nItemId, const OUString &rText, int nCharsWidth=-1)
void SetQuickHelpText(sal_uInt16 nItemId, const OUString &rText)
void SetItemData(sal_uInt16 nItemId, void *pNewData)
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
SwViewLayoutControl(sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar &rStb)
virtual bool MouseButtonDown(const MouseEvent &) override
virtual bool MouseMove(const MouseEvent &) override
virtual void Paint(const UserDrawEvent &rEvt) override
virtual void StateChangedAtStatusBarControl(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem *pState) override
virtual ~SwViewLayoutControl() override
std::unique_ptr< SwViewLayoutControl_Impl > mpImpl
vcl::RenderContext * GetRenderContext() const
const tools::Rectangle & GetRect() const
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
Image maImageBookMode_Active
Image maImageSingleColumn_Active
Image maImageSingleColumn
Image maImageAutomatic_Active
OUString SwResId(TranslateId aId)
SFX_IMPL_STATUSBAR_CONTROL(SwViewLayoutControl, SvxViewLayoutItem)