21#include <svx/strings.hrc>
22#include <svx/svxids.hrc>
27#include <com/sun/star/lang/IllegalArgumentException.hpp>
30using namespace css::uno;
41:
PanelLayout(pParent,
"GraphicPropertyPanel",
"svx/ui/sidebargraphic.ui"),
42 maBrightControl(SID_ATTR_GRAF_LUMINANCE, *pBindings, *this),
43 maContrastControl(SID_ATTR_GRAF_CONTRAST, *pBindings, *this),
44 maTransparenceControl(SID_ATTR_GRAF_TRANSPARENCE, *pBindings, *this),
45 maRedControl(SID_ATTR_GRAF_RED, *pBindings, *this),
46 maGreenControl(SID_ATTR_GRAF_GREEN, *pBindings, *this),
47 maBlueControl(SID_ATTR_GRAF_BLUE, *pBindings, *this),
48 maGammaControl(SID_ATTR_GRAF_GAMMA, *pBindings, *this),
49 maModeControl(SID_ATTR_GRAF_MODE, *pBindings, *this),
50 mpBindings(pBindings),
51 mxMtrBrightness(m_xBuilder->weld_metric_spin_button(
"setbrightness",
FieldUnit::
PERCENT)),
52 mxMtrContrast(m_xBuilder->weld_metric_spin_button(
"setcontrast",
FieldUnit::
PERCENT)),
53 mxLBColorMode(m_xBuilder->weld_combo_box(
"setcolormode")),
54 mxMtrTrans(m_xBuilder->weld_metric_spin_button(
"setgraphtransparency",
FieldUnit::
PERCENT))
92 const sal_Int16 nBright = mxMtrBrightness->get_value(FieldUnit::PERCENT);
93 const SfxInt16Item aBrightItem( SID_ATTR_GRAF_LUMINANCE, nBright );
95 SfxCallMode::RECORD, { &aBrightItem });
101 const sal_Int16 nContrast = mxMtrContrast->get_value(FieldUnit::PERCENT);
102 const SfxInt16Item aContrastItem( SID_ATTR_GRAF_CONTRAST, nContrast );
104 SfxCallMode::RECORD, { &aContrastItem });
110 const sal_Int16 nTrans = mxMtrTrans->get_value(FieldUnit::PERCENT);
111 const SfxUInt16Item aTransItem( SID_ATTR_GRAF_TRANSPARENCE, nTrans );
113 SfxCallMode::RECORD, { &aTransItem });
119 const sal_Int16 nTrans = mxLBColorMode->get_active();
120 const SfxUInt16Item aTransItem( SID_ATTR_GRAF_MODE, nTrans );
122 SfxCallMode::RECORD, { &aTransItem });
129 if (pParent ==
nullptr)
130 throw lang::IllegalArgumentException(
"no parent Window given to GraphicPropertyPanel::Create",
nullptr, 0);
131 if (pBindings ==
nullptr)
132 throw lang::IllegalArgumentException(
"no SfxBindings given to GraphicPropertyPanel::Create",
nullptr, 2);
134 return std::make_unique<GraphicPropertyPanel>(pParent, pBindings);
144 case SID_ATTR_GRAF_LUMINANCE:
146 if(eState >= SfxItemState::DEFAULT)
153 const sal_Int64 nBright = pItem->
GetValue();
157 else if(SfxItemState::DISABLED == eState)
168 case SID_ATTR_GRAF_CONTRAST:
170 if(eState >= SfxItemState::DEFAULT)
177 const sal_Int64 nContrast = pItem->
GetValue();
181 else if(SfxItemState::DISABLED == eState)
192 case SID_ATTR_GRAF_TRANSPARENCE:
194 if(eState >= SfxItemState::DEFAULT)
201 const sal_Int64 nTrans = pItem->
GetValue();
202 mxMtrTrans->set_value(nTrans, FieldUnit::PERCENT);
205 else if(SfxItemState::DISABLED == eState)
216 case SID_ATTR_GRAF_MODE:
218 if(eState >= SfxItemState::DEFAULT)
228 else if(SfxItemState::DISABLED == eState)
sal_uInt16 GetValue() const
SfxDispatcher * GetDispatcher() const
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
sal_Int16 GetValue() const
OUString SvxResId(TranslateId aId)
virtual SfxBindings & GetBindings() override
#define LINK(Instance, Class, Member)
constexpr OUStringLiteral PERCENT(u"Percent")