20 #include <svx/svxids.hrc>
61 void lclExtendSize(
Size& rSize,
const Size& rInputSize)
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"))
126 lclExtendSize(aSize, aGradientSize);
132 lclExtendSize(aSize, aBitmapSize);
138 lclExtendSize(aSize, aHatchSize);
144 lclExtendSize(aSize, aPatternSize);
148 aSize.extendBy(10, 10);
150 m_xFillTab->set_size_request(aSize.Width(), aSize.Height());
160 drawing::FillStyle eXFS = drawing::FillStyle_NONE;
164 eXFS = aFillStyleItem.GetValue();
171 case drawing::FillStyle_NONE:
176 case drawing::FillStyle_SOLID:
182 case drawing::FillStyle_GRADIENT:
188 case drawing::FillStyle_HATCH:
196 case drawing::FillStyle_BITMAP:
211 template<
typename TTabPage >
214 return static_cast<TTabPage&
>(*m_xFillTabPage).DeactivatePage(_pSet);
229 _pSet->
Put( aStyleItem );
234 return DeactivatePage_Impl<SvxColorTabPage>(_pSet);
236 return DeactivatePage_Impl<SvxGradientTabPage>(_pSet);
238 return DeactivatePage_Impl<SvxHatchTabPage>(_pSet);
240 return DeactivatePage_Impl<SvxBitmapTabPage&>(_pSet);
242 return DeactivatePage_Impl<SvxPatternTabPage>(_pSet);
246 return DeactivateRC::LeavePage;
249 template<
typename TTabPage >
252 return static_cast<TTabPage&
>( *m_xFillTabPage ).FillItemSet( rAttrs );
267 return FillItemSet_Impl<SvxColorTabPage>( rAttrs );
271 return FillItemSet_Impl<SvxGradientTabPage>( rAttrs );
275 return FillItemSet_Impl<SvxHatchTabPage>( rAttrs );
279 return FillItemSet_Impl<SvxBitmapTabPage>( rAttrs );
283 return FillItemSet_Impl<SvxPatternTabPage>( rAttrs );
290 template<
typename TTabPage >
293 static_cast<TTabPage&
>( *m_xFillTabPage ).Reset( rAttrs );
304 Reset_Impl<SvxColorTabPage>( rAttrs );
309 Reset_Impl<SvxGradientTabPage>( rAttrs );
314 Reset_Impl<SvxHatchTabPage>( rAttrs );
319 Reset_Impl<SvxBitmapTabPage>( rAttrs );
324 Reset_Impl<SvxPatternTabPage>( rAttrs );
334 auto xRet = std::make_unique<SvxAreaTabPage>(pPage, pController, *rAttrs);
335 xRet->SetOptimalSize(pController);
346 case TRANSPARENT: fnCreate =
nullptr;
break;
353 return fnCreate ? (*fnCreate)( pPage, pController, &rSet ) :
nullptr;
361 if(!rButton.get_active())
362 rButton.set_active(
true);
364 SelectFillType(rButton);
365 m_bBtnClicked =
true;
395 if (pGradientListItem)
397 if (pHatchingListItem)
401 if (pPatternListItem)
412 pColorTab->Construct();
415 pColorTab->set_visible(
true);
424 pGradientTab->Construct();
425 pGradientTab->ActivatePage(
m_rXFSet);
427 pGradientTab->set_visible(
true);
429 else if(nId ==
HATCH)
436 pHatchTab->Construct();
439 pHatchTab->set_visible(
true);
446 pBitmapTab->Construct();
449 pBitmapTab->set_visible(
true);
458 pPatternTab->Construct();
459 pPatternTab->ActivatePage(
m_rXFSet);
461 pPatternTab->set_visible(
true);
DeactivateRC DeactivatePage_Impl(SfxItemSet *pSet)
void SetBitmapList(const XBitmapListRef &pBmpLst)
#define LINK(Instance, Class, Member)
virtual bool FillItemSet(SfxItemSet *) override
static const sal_uInt16 pAreaRanges[]
void Reset_Impl(const SfxItemSet *)
void setWidth(tools::Long nWidth)
void SetGradientList(XGradientListRef const &pGrdLst)
bool Set(const SfxItemSet &, bool bDeep=true)
std::unique_ptr< SfxTabPage > m_xFillTabPage
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)
std::unique_ptr< weld::ToggleButton > m_xBtnHatch
virtual void ActivatePage(const SfxItemSet &rSet) override
virtual void Reset(const SfxItemSet *) override
XGradientListRef m_pGradientList
constexpr TypedWhichId< XFillHatchItem > XATTR_FILLHATCH(XATTR_FILL_FIRST+3)
void SetColorList(XColorListRef const &pColorList)
constexpr TypedWhichId< XFillBackgroundItem > XATTR_FILLBACKGROUND(XATTR_FILL_FIRST+19)
XBitmapListRef m_pBitmapList
void SetExchangeSupport()
IMPL_LINK(SvxAreaTabPage, SelectFillTypeHdl_Impl, weld::ToggleButton &, rButton, void)
std::unique_ptr< weld::Container > m_xFillTab
virtual void PageCreated(const SfxAllItemSet &aSet) override
std::unique_ptr< weld::ToggleButton > m_xBtnColor
void SetPatternList(XPatternListRef const &pPtrnLst)
std::unique_ptr< weld::ToggleButton > m_xBtnGradient
ChangeType * m_pnGradientListState
void SetColorList(const XColorListRef &pColList)
constexpr TypedWhichId< XFillGradientItem > XATTR_FILLGRADIENT(XATTR_FILL_FIRST+2)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
void SetHatchingList(XHatchListRef const &pHtchLst)
constexpr OUStringLiteral PATTERN
constexpr TypedWhichId< XFillBitmapItem > XATTR_FILLBITMAP(XATTR_FILL_FIRST+4)
ChangeType * m_pnBitmapListState
void SelectFillType(weld::ToggleButton &rButton, const SfxItemSet *_pSet=nullptr)
tools::Long Width() const
virtual ~SvxAreaTabPage() override
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
XHatchListRef m_pHatchingList
std::unique_ptr< weld::ToggleButton > m_xBtnNone
const XColorListRef & GetColorList() const
std::unique_ptr< weld::ToggleButton > m_xBtnBitmap
void CreatePage(sal_Int32 nId, SfxTabPage *pTab)
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 *)
constexpr TypedWhichId< XFillColorItem > XATTR_FILLCOLOR(XATTR_FILL_FIRST+1)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
constexpr TypedWhichId< XGradientStepCountItem > XATTR_GRADIENTSTEPCOUNT(XATTR_FILL_FIRST+6)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
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 *)
ChangeType * m_pnPatternListState
std::unique_ptr< SfxTabPage >(* CreateTabPage)(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
tools::Long Height() const
void SetColorList(XColorListRef const &pColorList)
SfxOkDialogController * GetDialogController() const
ChangeType * m_pnHatchingListState
void setHeight(tools::Long nHeight)
SvxAreaTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rInAttrs)
std::unique_ptr< weld::ToggleButton > m_xBtnPattern
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
bool FillItemSet_Impl(SfxItemSet *)
void SetBitmapList(XBitmapListRef const &pBmpLst)
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
XPatternListRef m_pPatternList
XColorListRef m_pColorList
void SetColorList(XColorListRef const &pColorList)
void SetOptimalSize(weld::DialogController *pController)
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
void SetColorList(XColorListRef const &pColorList)
ChangeType * m_pnColorListState
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)