20#include <svx/svxids.hrc>
54 XATTR_GRADIENTSTEPCOUNT, XATTR_GRADIENTSTEPCOUNT,
55 SID_ATTR_FILL_STYLE, SID_ATTR_FILL_BITMAP>);
60void lclExtendSize(
Size& rSize,
const Size& rInputSize)
77 const SfxItemSet& rInAttrs,
bool bSlideBackground)
78 :
SfxTabPage(pPage, pController,
"cui/ui/areatabpage.ui",
"AreaTabPage", &rInAttrs)
82 , m_pnColorListState(&maFixed_ChangeType)
83 , m_pnBitmapListState(&maFixed_ChangeType)
84 , m_pnPatternListState(&maFixed_ChangeType)
85 , m_pnGradientListState(&maFixed_ChangeType)
86 , m_pnHatchingListState(&maFixed_ChangeType)
87 , m_aXFillAttr(rInAttrs.GetPool())
89 , m_xFillTab(m_xBuilder->weld_container(
"fillstylebox"))
90 , m_xBtnNone(m_xBuilder->weld_toggle_button(
"btnnone"))
91 , m_xBtnColor(m_xBuilder->weld_toggle_button(
"btncolor"))
92 , m_xBtnGradient(m_xBuilder->weld_toggle_button(
"btngradient"))
93 , m_xBtnHatch(m_xBuilder->weld_toggle_button(
"btnhatch"))
94 , m_xBtnBitmap(m_xBuilder->weld_toggle_button(
"btnbitmap"))
95 , m_xBtnPattern(m_xBuilder->weld_toggle_button(
"btnpattern"))
96 , m_xBtnUseBackground(m_xBuilder->weld_toggle_button(
"btnusebackground"))
112 if (bSlideBackground)
135 lclExtendSize(aSize, aGradientSize);
141 lclExtendSize(aSize, aBitmapSize);
147 lclExtendSize(aSize, aHatchSize);
153 lclExtendSize(aSize, aPatternSize);
169 drawing::FillStyle eXFS = drawing::FillStyle_NONE;
173 eXFS = aFillStyleItem.GetValue();
180 case drawing::FillStyle_NONE:
183 if (aBckItem.GetValue())
189 case drawing::FillStyle_SOLID:
195 case drawing::FillStyle_GRADIENT:
202 case drawing::FillStyle_HATCH:
210 case drawing::FillStyle_BITMAP:
224template<
typename TTabPage >
227 return static_cast<TTabPage&
>(*m_xFillTabPage).DeactivatePage(_pSet);
242 _pSet->
Put( aStyleItem );
246 _pSet->
Put( aFillBgItem );
252 return DeactivatePage_Impl<SvxColorTabPage>(_pSet);
254 return DeactivatePage_Impl<SvxGradientTabPage>(_pSet);
256 return DeactivatePage_Impl<SvxHatchTabPage>(_pSet);
258 return DeactivatePage_Impl<SvxBitmapTabPage&>(_pSet);
260 return DeactivatePage_Impl<SvxPatternTabPage>(_pSet);
261 case USE_BACKGROUND_FILL:
266 _pSet->
Put( aStyleItem );
268 _pSet->
Put( aFillBgItem );
275 return DeactivateRC::LeavePage;
278template<
typename TTabPage >
281 return static_cast<TTabPage&
>( *m_xFillTabPage ).FillItemSet( rAttrs );
297 return FillItemSet_Impl<SvxColorTabPage>( rAttrs );
301 return FillItemSet_Impl<SvxGradientTabPage>( rAttrs );
305 return FillItemSet_Impl<SvxHatchTabPage>( rAttrs );
309 return FillItemSet_Impl<SvxBitmapTabPage>( rAttrs );
313 return FillItemSet_Impl<SvxPatternTabPage>( rAttrs );
315 case USE_BACKGROUND_FILL:
326template<
typename TTabPage >
329 static_cast<TTabPage&
>( *m_xFillTabPage ).Reset( rAttrs );
340 Reset_Impl<SvxColorTabPage>( rAttrs );
345 Reset_Impl<SvxGradientTabPage>( rAttrs );
350 Reset_Impl<SvxHatchTabPage>( rAttrs );
355 Reset_Impl<SvxBitmapTabPage>( rAttrs );
360 Reset_Impl<SvxPatternTabPage>( rAttrs );
370 auto xRet = std::make_unique<SvxAreaTabPage>(pPage, pController, *rAttrs);
371 xRet->SetOptimalSize(pController);
378 auto xRet = std::make_unique<SvxAreaTabPage>(pPage, pController, *rAttrs,
true);
379 xRet->SetOptimalSize(pController);
390 case TRANSPARENT: fnCreate =
nullptr;
break;
396 case USE_BACKGROUND_FILL: fnCreate =
nullptr;
break;
398 return fnCreate ? (*fnCreate)( pPage, pController, &
rSet ) :
nullptr;
406 if(!rButton.get_active())
407 rButton.set_active(
true);
409 SelectFillType(rButton);
410 m_bBtnClicked =
true;
442 if (pGradientListItem)
444 if (pHatchingListItem)
448 if (pPatternListItem)
459 rColorTab.Construct();
462 rColorTab.set_visible(
true);
471 rGradientTab.Construct();
472 rGradientTab.ActivatePage(
m_rXFSet);
474 rGradientTab.set_visible(
true);
483 rHatchTab.Construct();
486 rHatchTab.set_visible(
true);
493 rBitmapTab.Construct();
496 rBitmapTab.set_visible(
true);
505 rPatternTab.Construct();
508 rPatternTab.set_visible(
true);
bool HasItem(sal_uInt16 nWhich, const SfxPoolItem **ppItem=nullptr) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
bool Set(const SfxItemSet &, bool bDeep=true)
SfxOkDialogController * GetDialogController() const
void SetExchangeSupport()
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
constexpr tools::Long Height() const
void extendBy(tools::Long x, tools::Long y)
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
XHatchListRef m_pHatchingList
std::unique_ptr< weld::Toggleable > m_xBtnPattern
void SetPatternList(XPatternListRef const &pPtrnLst)
std::unique_ptr< weld::Container > m_xFillTab
virtual bool FillItemSet(SfxItemSet *) override
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
void SetHatchingList(XHatchListRef const &pHtchLst)
ChangeType * m_pnGradientListState
std::unique_ptr< weld::Toggleable > m_xBtnBitmap
ChangeType * m_pnColorListState
XPatternListRef m_pPatternList
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
XGradientListRef m_pGradientList
static const WhichRangesContainer pAreaRanges
void Reset_Impl(const SfxItemSet *)
std::unique_ptr< weld::Toggleable > m_xBtnNone
virtual void ActivatePage(const SfxItemSet &rSet) override
std::unique_ptr< weld::Toggleable > m_xBtnHatch
std::unique_ptr< weld::Toggleable > m_xBtnColor
SvxAreaTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rInAttrs, bool bSlideBackground=false)
void CreatePage(sal_Int32 nId, SfxTabPage &rTab)
void SetBitmapList(XBitmapListRef const &pBmpLst)
static std::unique_ptr< SfxTabPage > CreateWithSlideBackground(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
std::unique_ptr< SfxTabPage > m_xFillTabPage
void SetColorList(XColorListRef const &pColorList)
virtual void Reset(const SfxItemSet *) override
XColorListRef m_pColorList
void SelectFillType(weld::Toggleable &rButton, const SfxItemSet *_pSet=nullptr)
DeactivateRC DeactivatePage_Impl(SfxItemSet *pSet)
void SetOptimalSize(weld::DialogController *pController)
ChangeType * m_pnHatchingListState
virtual ~SvxAreaTabPage() override
virtual void PageCreated(const SfxAllItemSet &aSet) override
ChangeType * m_pnBitmapListState
std::unique_ptr< weld::Toggleable > m_xBtnUseBackground
bool FillItemSet_Impl(SfxItemSet *)
ChangeType * m_pnPatternListState
void SetGradientList(XGradientListRef const &pGrdLst)
XBitmapListRef m_pBitmapList
std::unique_ptr< weld::Toggleable > m_xBtnGradient
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
void SetBitmapList(const XBitmapListRef &pBmpLst)
const XColorListRef & GetColorList() const
void SetColorList(const XColorListRef &pColList)
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
void SetColorList(XColorListRef const &pColorList)
void SetColorList(XColorListRef const &pColorList)
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
void SetColorList(XColorListRef const &pColorList)
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
#define LINK(Instance, Class, Member)
static constexpr auto Items
std::unique_ptr< SfxTabPage >(* CreateTabPage)(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
IMPL_LINK(SvxAreaTabPage, SelectFillTypeHdl_Impl, weld::Toggleable &, rButton, void)
constexpr OUStringLiteral PATTERN
constexpr TypedWhichId< XGradientStepCountItem > XATTR_GRADIENTSTEPCOUNT(XATTR_FILL_FIRST+6)
constexpr TypedWhichId< XFillUseSlideBackgroundItem > XATTR_FILLUSESLIDEBACKGROUND(XATTR_FILL_FIRST+20)
constexpr TypedWhichId< XFillColorItem > XATTR_FILLCOLOR(XATTR_FILL_FIRST+1)
constexpr TypedWhichId< XFillHatchItem > XATTR_FILLHATCH(XATTR_FILL_FIRST+3)
constexpr TypedWhichId< XFillBitmapItem > XATTR_FILLBITMAP(XATTR_FILL_FIRST+4)
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)
constexpr TypedWhichId< XFillGradientItem > XATTR_FILLGRADIENT(XATTR_FILL_FIRST+2)