LibreOffice Module cui (master)  1
tptrans.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <stdlib.h>
21 
22 #include <tools/urlobj.hxx>
23 #include <sfx2/app.hxx>
24 #include <sfx2/module.hxx>
25 #include <svx/dialogs.hrc>
26 #include <svx/svxids.hrc>
27 
28 #include <svx/xfillit0.hxx>
29 #include <svx/xflclit.hxx>
30 #include <svx/xflftrit.hxx>
31 #include <svx/xflgrit.hxx>
32 #include <svx/xflhtit.hxx>
33 #include <svx/xbtmpit.hxx>
34 #include <svx/xpool.hxx>
35 #include <svx/xflbckit.hxx>
36 #include <svx/sdshtitm.hxx>
37 #include <svx/xtable.hxx>
38 #include <svx/xlineit0.hxx>
39 #include <svx/drawitem.hxx>
40 #include <svx/xfltrit.hxx>
41 #include <cuitabarea.hxx>
42 #include <dlgname.hxx>
43 #include <svx/dlgutil.hxx>
44 #include <svl/intitem.hxx>
45 #include <sfx2/request.hxx>
46 
47 #include <sfx2/opengrf.hxx>
48 
49 using namespace com::sun::star;
50 
52 {
56  SDRATTR_SHADOWTRANSPARENCE,
58  XATTR_FILLFLOATTRANSPARENCE,
59  0
60 };
61 
62 /*************************************************************************
63 |*
64 |* Dialog for transparence
65 |*
66 \************************************************************************/
67 
69 {
70  // disable all other controls
71  ActivateLinear(false);
72  ActivateGradient(false);
73 
74  // Preview
75  rXFSet.ClearItem(XATTR_FILLTRANSPARENCE);
76  rXFSet.ClearItem(XATTR_FILLFLOATTRANSPARENCE);
77  m_aCtlXRectPreview.SetAttributes( aXFillAttr.GetItemSet() );
78  m_aCtlBitmapPreview.SetAttributes( aXFillAttr.GetItemSet() );
79 
80  InvalidatePreview(false);
81 }
82 
83 IMPL_LINK_NOARG(SvxTransparenceTabPage, ClickTransLinearHdl_Impl, weld::ToggleButton&, void)
84 {
85  // enable linear, disable other
86  ActivateLinear(true);
87  ActivateGradient(false);
88 
89  // preview
90  rXFSet.ClearItem (XATTR_FILLFLOATTRANSPARENCE);
91  ModifyTransparentHdl_Impl(*m_xMtrTransparent);
92 }
93 
94 IMPL_LINK_NOARG(SvxTransparenceTabPage, ClickTransGradientHdl_Impl, weld::ToggleButton&, void)
95 {
96  // enable gradient, disable other
97  ActivateLinear(false);
98  ActivateGradient(true);
99 
100  // preview
101  rXFSet.ClearItem (XATTR_FILLTRANSPARENCE);
102  ModifiedTrgrHdl_Impl(nullptr);
103 }
104 
106 {
107 }
108 
110 {
111  m_xMtrTransparent->set_sensitive(bActivate);
112 }
113 
115 {
116  sal_uInt16 nPos = m_xMtrTransparent->get_value(FieldUnit::PERCENT);
117  rXFSet.Put(XFillTransparenceItem(nPos));
118 
119  // preview
120  InvalidatePreview();
121 }
122 
123 IMPL_LINK(SvxTransparenceTabPage, ModifiedTrgrListBoxHdl_Impl, weld::ComboBox&, rListBox, void)
124 {
125  ModifiedTrgrHdl_Impl(&rListBox);
126 }
127 
129 {
130  ModifiedTrgrHdl_Impl(nullptr);
131 }
132 
134 {
135  if (pControl == m_xLbTrgrGradientType.get())
136  {
137  css::awt::GradientStyle eXGS = static_cast<css::awt::GradientStyle>(m_xLbTrgrGradientType->get_active());
138  SetControlState_Impl( eXGS );
139  }
140 
141  // preview
142  sal_uInt8 nStartCol = static_cast<sal_uInt8>((static_cast<sal_uInt16>(m_xMtrTrgrStartValue->get_value(FieldUnit::PERCENT)) * 255) / 100);
143  sal_uInt8 nEndCol = static_cast<sal_uInt8>((static_cast<sal_uInt16>(m_xMtrTrgrEndValue->get_value(FieldUnit::PERCENT)) * 255) / 100);
144  XGradient aTmpGradient(
145  Color(nStartCol, nStartCol, nStartCol),
146  Color(nEndCol, nEndCol, nEndCol),
147  static_cast<css::awt::GradientStyle>(m_xLbTrgrGradientType->get_active()),
148  static_cast<sal_uInt16>(m_xMtrTrgrAngle->get_value(FieldUnit::DEGREE)) * 10,
149  static_cast<sal_uInt16>(m_xMtrTrgrCenterX->get_value(FieldUnit::PERCENT)),
150  static_cast<sal_uInt16>(m_xMtrTrgrCenterY->get_value(FieldUnit::PERCENT)),
151  static_cast<sal_uInt16>(m_xMtrTrgrBorder->get_value(FieldUnit::PERCENT)),
152  100, 100);
153 
154  XFillFloatTransparenceItem aItem( aTmpGradient);
155  rXFSet.Put ( aItem );
156 
157  InvalidatePreview();
158 }
159 
161 {
162  m_xGridGradient->set_sensitive(bActivate);
163 
164  if (bActivate)
165  {
166  css::awt::GradientStyle eXGS = static_cast<css::awt::GradientStyle>(m_xLbTrgrGradientType->get_active());
167  SetControlState_Impl( eXGS );
168  }
169 }
170 
171 void SvxTransparenceTabPage::SetControlState_Impl(css::awt::GradientStyle eXGS)
172 {
173  switch(eXGS)
174  {
175  case css::awt::GradientStyle_LINEAR:
176  case css::awt::GradientStyle_AXIAL:
177  m_xFtTrgrCenterX->set_sensitive(false);
178  m_xMtrTrgrCenterX->set_sensitive(false);
179  m_xFtTrgrCenterY->set_sensitive(false);
180  m_xMtrTrgrCenterY->set_sensitive(false);
181  m_xFtTrgrAngle->set_sensitive(true);
182  m_xMtrTrgrAngle->set_sensitive(true);
183  break;
184 
185  case css::awt::GradientStyle_RADIAL:
186  m_xFtTrgrCenterX->set_sensitive(true);
187  m_xMtrTrgrCenterX->set_sensitive(true);
188  m_xFtTrgrCenterY->set_sensitive(true);
189  m_xMtrTrgrCenterY->set_sensitive(true);
190  m_xFtTrgrAngle->set_sensitive(false);
191  m_xMtrTrgrAngle->set_sensitive(false);
192  break;
193 
194  case css::awt::GradientStyle_ELLIPTICAL:
195  case css::awt::GradientStyle_SQUARE:
196  case css::awt::GradientStyle_RECT:
197  m_xFtTrgrCenterX->set_sensitive(true);
198  m_xMtrTrgrCenterX->set_sensitive(true);
199  m_xFtTrgrCenterY->set_sensitive(true);
200  m_xMtrTrgrCenterY->set_sensitive(true);
201  m_xFtTrgrAngle->set_sensitive(true);
202  m_xMtrTrgrAngle->set_sensitive(true);
203  break;
204  default:
205  break;
206  }
207 }
208 
210  : SfxTabPage(pParent, "cui/ui/transparencytabpage.ui", "TransparencyTabPage", &rInAttrs)
211  , rOutAttrs(rInAttrs)
212  , nPageType(PageType::Area)
213  , nDlgType(0)
214  , bBitmap(false)
215  , aXFillAttr(rInAttrs.GetPool())
216  , rXFSet(aXFillAttr.GetItemSet())
217  , m_xRbtTransOff(m_xBuilder->weld_radio_button("RBT_TRANS_OFF"))
218  , m_xRbtTransLinear(m_xBuilder->weld_radio_button("RBT_TRANS_LINEAR"))
219  , m_xRbtTransGradient(m_xBuilder->weld_radio_button("RBT_TRANS_GRADIENT"))
220  , m_xMtrTransparent(m_xBuilder->weld_metric_spin_button("MTR_TRANSPARENT", FieldUnit::PERCENT))
221  , m_xGridGradient(m_xBuilder->weld_widget("gridGradient"))
222  , m_xLbTrgrGradientType(m_xBuilder->weld_combo_box("LB_TRGR_GRADIENT_TYPES"))
223  , m_xFtTrgrCenterX(m_xBuilder->weld_label("FT_TRGR_CENTER_X"))
224  , m_xMtrTrgrCenterX(m_xBuilder->weld_metric_spin_button("MTR_TRGR_CENTER_X", FieldUnit::PERCENT))
225  , m_xFtTrgrCenterY(m_xBuilder->weld_label("FT_TRGR_CENTER_Y"))
226  , m_xMtrTrgrCenterY(m_xBuilder->weld_metric_spin_button("MTR_TRGR_CENTER_Y", FieldUnit::PERCENT))
227  , m_xFtTrgrAngle(m_xBuilder->weld_label("FT_TRGR_ANGLE"))
228  , m_xMtrTrgrAngle(m_xBuilder->weld_metric_spin_button("MTR_TRGR_ANGLE", FieldUnit::DEGREE))
229  , m_xMtrTrgrBorder(m_xBuilder->weld_metric_spin_button("MTR_TRGR_BORDER", FieldUnit::PERCENT))
230  , m_xMtrTrgrStartValue(m_xBuilder->weld_metric_spin_button("MTR_TRGR_START_VALUE", FieldUnit::PERCENT))
231  , m_xMtrTrgrEndValue(m_xBuilder->weld_metric_spin_button("MTR_TRGR_END_VALUE", FieldUnit::PERCENT))
232  , m_xCtlBitmapBorder(m_xBuilder->weld_widget("bitmap_border"))
233  , m_xCtlXRectBorder(m_xBuilder->weld_widget("trans_border"))
234  , m_xCtlBitmapPreview(new weld::CustomWeld(*m_xBuilder, "CTL_BITMAP_PREVIEW", m_aCtlBitmapPreview))
235  , m_xCtlXRectPreview(new weld::CustomWeld(*m_xBuilder, "CTL_TRANS_PREVIEW", m_aCtlXRectPreview))
236 {
237  // main selection
238  m_xRbtTransOff->connect_toggled(LINK(this, SvxTransparenceTabPage, ClickTransOffHdl_Impl));
239  m_xRbtTransLinear->connect_toggled(LINK(this, SvxTransparenceTabPage, ClickTransLinearHdl_Impl));
240  m_xRbtTransGradient->connect_toggled(LINK(this, SvxTransparenceTabPage, ClickTransGradientHdl_Impl));
241 
242  // linear transparency
243  m_xMtrTransparent->set_value(50, FieldUnit::PERCENT);
244  m_xMtrTransparent->connect_value_changed(LINK(this, SvxTransparenceTabPage, ModifyTransparentHdl_Impl));
245 
246  // gradient transparency
247  m_xMtrTrgrEndValue->set_value(100, FieldUnit::PERCENT);
248  m_xMtrTrgrStartValue->set_value(0, FieldUnit::PERCENT);
249  Link<weld::MetricSpinButton&,void> aLink = LINK( this, SvxTransparenceTabPage, ModifiedTrgrEditHdl_Impl);
250  m_xLbTrgrGradientType->connect_changed(LINK(this, SvxTransparenceTabPage, ModifiedTrgrListBoxHdl_Impl));
251  m_xMtrTrgrCenterX->connect_value_changed( aLink );
252  m_xMtrTrgrCenterY->connect_value_changed( aLink );
253  m_xMtrTrgrAngle->connect_value_changed( aLink );
254  m_xMtrTrgrBorder->connect_value_changed( aLink );
255  m_xMtrTrgrStartValue->connect_value_changed( aLink );
256  m_xMtrTrgrEndValue->connect_value_changed( aLink );
257 
258  // this page needs ExchangeSupport
260 }
261 
263 {
264  return VclPtr<SvxTransparenceTabPage>::Create(pParent, *rAttrs);
265 }
266 
268 {
269  const SfxPoolItem* pGradientItem = nullptr;
270  const SfxPoolItem* pLinearItem = nullptr;
271  SfxItemState eStateGradient(rOutAttrs.GetItemState(XATTR_FILLFLOATTRANSPARENCE, true, &pGradientItem));
272  SfxItemState eStateLinear(rOutAttrs.GetItemState(XATTR_FILLTRANSPARENCE, true, &pLinearItem));
273  bool bGradActive = (eStateGradient == SfxItemState::SET && static_cast<const XFillFloatTransparenceItem*>(pGradientItem)->IsEnabled());
274  bool bLinearActive = (eStateLinear == SfxItemState::SET && static_cast<const XFillTransparenceItem*>(pLinearItem)->GetValue() != 0);
275 
276  bool bGradUsed = (eStateGradient == SfxItemState::DONTCARE);
277  bool bLinearUsed = (eStateLinear == SfxItemState::DONTCARE);
278 
279  bool bModified(false);
280  bool bSwitchOffLinear(false);
281  bool bSwitchOffGradient(false);
282 
283  if (m_xMtrTransparent->get_sensitive())
284  {
285  // linear transparence
286  sal_uInt16 nPos = m_xMtrTransparent->get_value(FieldUnit::PERCENT);
287  if (m_xMtrTransparent->get_value_changed_from_saved() || !bLinearActive)
288  {
289  XFillTransparenceItem aItem(nPos);
291  const SfxPoolItem* pOld = GetOldItem(*rAttrs, XATTR_FILLTRANSPARENCE);
292  if(!pOld || !(*static_cast<const XFillTransparenceItem*>(pOld) == aItem) || !bLinearActive)
293  {
294  rAttrs->Put(aItem);
295  rAttrs->Put(aShadowItem);
296  bModified = true;
297  bSwitchOffGradient = true;
298  }
299  }
300  }
301  else if (m_xGridGradient->get_sensitive())
302  {
303  // transparence gradient, fill ItemSet from values
304  if (!bGradActive
305  || m_xLbTrgrGradientType->get_value_changed_from_saved()
306  || m_xMtrTrgrAngle->get_value_changed_from_saved()
307  || m_xMtrTrgrCenterX->get_value_changed_from_saved()
308  || m_xMtrTrgrCenterY->get_value_changed_from_saved()
309  || m_xMtrTrgrBorder->get_value_changed_from_saved()
310  || m_xMtrTrgrStartValue->get_value_changed_from_saved()
311  || m_xMtrTrgrEndValue->get_value_changed_from_saved())
312  {
313  sal_uInt8 nStartCol = static_cast<sal_uInt8>((static_cast<sal_uInt16>(m_xMtrTrgrStartValue->get_value(FieldUnit::PERCENT)) * 255) / 100);
314  sal_uInt8 nEndCol = static_cast<sal_uInt8>((static_cast<sal_uInt16>(m_xMtrTrgrEndValue->get_value(FieldUnit::PERCENT)) * 255) / 100);
315  XGradient aTmpGradient(
316  Color(nStartCol, nStartCol, nStartCol),
317  Color(nEndCol, nEndCol, nEndCol),
318  static_cast<css::awt::GradientStyle>(m_xLbTrgrGradientType->get_active()),
319  static_cast<sal_uInt16>(m_xMtrTrgrAngle->get_value(FieldUnit::DEGREE)) * 10,
320  static_cast<sal_uInt16>(m_xMtrTrgrCenterX->get_value(FieldUnit::PERCENT)),
321  static_cast<sal_uInt16>(m_xMtrTrgrCenterY->get_value(FieldUnit::PERCENT)),
322  static_cast<sal_uInt16>(m_xMtrTrgrBorder->get_value(FieldUnit::PERCENT)),
323  100, 100);
324 
325  XFillFloatTransparenceItem aItem(aTmpGradient);
326  const SfxPoolItem* pOld = GetOldItem(*rAttrs, XATTR_FILLFLOATTRANSPARENCE);
327 
328  if(!pOld || !(*static_cast<const XFillFloatTransparenceItem*>(pOld) == aItem) || !bGradActive)
329  {
330  rAttrs->Put(aItem);
331  bModified = true;
332  bSwitchOffLinear = true;
333  }
334  }
335  }
336  else
337  {
338  // no transparence
339  bSwitchOffGradient = true;
340  bSwitchOffLinear = true;
341  }
342 
343  // disable unused XFillFloatTransparenceItem
344  if(bSwitchOffGradient && (bGradActive || bGradUsed))
345  {
346  XGradient aGrad(COL_BLACK, COL_WHITE);
347  aGrad.SetStartIntens(100);
348  aGrad.SetEndIntens(100);
349  XFillFloatTransparenceItem aItem(aGrad);
350  aItem.SetEnabled(false);
351  rAttrs->Put(aItem);
352  bModified = true;
353  }
354 
355  // disable unused XFillFloatTransparenceItem
356  if(bSwitchOffLinear && (bLinearActive || bLinearUsed))
357  {
358  XFillTransparenceItem aItem(0);
360  rAttrs->Put(aItem);
361  rAttrs->Put(aShadowItem);
362  bModified = true;
363  }
364  rAttrs->Put(CntUInt16Item(SID_PAGE_TYPE, static_cast<sal_uInt16>(nPageType)));
365  return bModified;
366 }
367 
369 {
370  const SfxPoolItem* pGradientItem = nullptr;
371  SfxItemState eStateGradient(rAttrs->GetItemState(XATTR_FILLFLOATTRANSPARENCE, true, &pGradientItem));
372  if(!pGradientItem)
373  pGradientItem = &rAttrs->Get(XATTR_FILLFLOATTRANSPARENCE);
374  bool bGradActive = (eStateGradient == SfxItemState::SET && static_cast<const XFillFloatTransparenceItem*>(pGradientItem)->IsEnabled());
375 
376  const SfxPoolItem* pLinearItem = nullptr;
377  SfxItemState eStateLinear(rAttrs->GetItemState(XATTR_FILLTRANSPARENCE, true, &pLinearItem));
378  if(!pLinearItem)
379  pLinearItem = &rAttrs->Get(XATTR_FILLTRANSPARENCE);
380  bool bLinearActive = (eStateLinear == SfxItemState::SET && static_cast<const XFillTransparenceItem*>(pLinearItem)->GetValue() != 0);
381 
382  // transparence gradient
383  const XGradient& rGradient = static_cast<const XFillFloatTransparenceItem*>(pGradientItem)->GetGradientValue();
384  css::awt::GradientStyle eXGS(rGradient.GetGradientStyle());
385  m_xLbTrgrGradientType->set_active(sal::static_int_cast< sal_Int32 >(eXGS));
386  m_xMtrTrgrAngle->set_value(rGradient.GetAngle() / 10, FieldUnit::DEGREE);
387  m_xMtrTrgrBorder->set_value(rGradient.GetBorder(), FieldUnit::PERCENT);
388  m_xMtrTrgrCenterX->set_value(rGradient.GetXOffset(), FieldUnit::PERCENT);
389  m_xMtrTrgrCenterY->set_value(rGradient.GetYOffset(), FieldUnit::PERCENT);
390  m_xMtrTrgrStartValue->set_value(static_cast<sal_uInt16>(((static_cast<sal_uInt16>(rGradient.GetStartColor().GetRed()) + 1) * 100) / 255), FieldUnit::PERCENT);
391  m_xMtrTrgrEndValue->set_value(static_cast<sal_uInt16>(((static_cast<sal_uInt16>(rGradient.GetEndColor().GetRed()) + 1) * 100) / 255), FieldUnit::PERCENT);
392 
393  // linear transparence
394  sal_uInt16 nTransp = static_cast<const XFillTransparenceItem*>(pLinearItem)->GetValue();
395  m_xMtrTransparent->set_value(bLinearActive ? nTransp : 50, FieldUnit::PERCENT);
396  ModifyTransparentHdl_Impl(*m_xMtrTransparent);
397 
398  // select the correct radio button
399  if(bGradActive)
400  {
401  // transparence gradient, set controls appropriate to item
402  m_xRbtTransGradient->set_active(true);
403  ClickTransGradientHdl_Impl(*m_xRbtTransGradient);
404  }
405  else if(bLinearActive)
406  {
407  // linear transparence
408  m_xRbtTransLinear->set_active(true);
409  ClickTransLinearHdl_Impl(*m_xRbtTransLinear);
410  }
411  else
412  {
413  // no transparence
414  m_xRbtTransOff->set_active(true);
415  ClickTransOffHdl_Impl(*m_xRbtTransOff);
416  ModifiedTrgrHdl_Impl(nullptr);
417  }
418 
419  // save values
420  ChangesApplied();
421  bool bActive = InitPreview ( *rAttrs );
422  InvalidatePreview ( bActive );
423 }
424 
426 {
427  m_xMtrTransparent->save_value();
428  m_xLbTrgrGradientType->save_value();
429  m_xMtrTrgrCenterX->save_value();
430  m_xMtrTrgrCenterY->save_value();
431  m_xMtrTrgrAngle->save_value();
432  m_xMtrTrgrBorder->save_value();
433  m_xMtrTrgrStartValue->save_value();
434  m_xMtrTrgrEndValue->save_value();
435 }
436 
438 {
439  const CntUInt16Item* pPageTypeItem = rSet.GetItem<CntUInt16Item>(SID_PAGE_TYPE, false);
440  if (pPageTypeItem)
441  SetPageType(static_cast<PageType>(pPageTypeItem->GetValue()));
442 
443  if(nDlgType == 0) // area dialog
445 
446  InitPreview ( rSet );
447 }
448 
450 {
451  if( _pSet )
452  FillItemSet( _pSet );
453  return DeactivateRC::LeavePage;
454 }
455 
456 // Preview-Methods
457 
459 {
460  // set transparencetype for preview
461  if (m_xRbtTransOff->get_active())
462  {
463  ClickTransOffHdl_Impl(*m_xRbtTransOff);
464  }
465  else if (m_xRbtTransLinear->get_active())
466  {
467  ClickTransLinearHdl_Impl(*m_xRbtTransLinear);
468  }
469  else if (m_xRbtTransGradient->get_active())
470  {
471  ClickTransGradientHdl_Impl(*m_xRbtTransGradient);
472  }
473 
474  // Get fillstyle for preview
475  rXFSet.Put ( rSet.Get(XATTR_FILLSTYLE) );
476  rXFSet.Put ( rSet.Get(XATTR_FILLCOLOR) );
477  rXFSet.Put ( rSet.Get(XATTR_FILLGRADIENT) );
478  rXFSet.Put ( rSet.Get(XATTR_FILLHATCH) );
480  rXFSet.Put ( rSet.Get(XATTR_FILLBITMAP) );
481 
484 
485  bBitmap = rSet.Get(XATTR_FILLSTYLE).GetValue() == drawing::FillStyle_BITMAP;
486 
487  // show the right preview window
488  if ( bBitmap )
489  {
490  m_xCtlBitmapBorder->show();
491  m_xCtlXRectBorder->hide();
492  }
493  else
494  {
495  m_xCtlBitmapBorder->hide();
496  m_xCtlXRectBorder->show();
497  }
498 
499  return !m_xRbtTransOff->get_active();
500 }
501 
503 {
504  if ( bBitmap )
505  {
506  if ( bEnable )
507  {
508  m_xCtlBitmapPreview->set_sensitive(true);
510  }
511  else
512  m_xCtlBitmapPreview->set_sensitive(false);
513  m_xCtlBitmapPreview->queue_draw();
514  }
515  else
516  {
517  if ( bEnable )
518  {
519  m_xCtlXRectPreview->set_sensitive(true);
521  }
522  else
523  m_xCtlXRectPreview->set_sensitive(false);
524  m_xCtlXRectPreview->queue_draw();
525  }
526 }
527 
529 {
530  const SfxUInt16Item* pPageTypeItem = aSet.GetItem<SfxUInt16Item>(SID_PAGE_TYPE, false);
531  const SfxUInt16Item* pDlgTypeItem = aSet.GetItem<SfxUInt16Item>(SID_DLG_TYPE, false);
532 
533  if (pPageTypeItem)
534  SetPageType(static_cast<PageType>(pPageTypeItem->GetValue()));
535  if (pDlgTypeItem)
536  SetDlgType(pDlgTypeItem->GetValue());
537 }
538 
539 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
FieldUnit
#define XATTR_FILLHATCH
constexpr::Color COL_BLACK(0x00, 0x00, 0x00)
sal_uInt8 GetRed() const
std::unique_ptr< weld::MetricSpinButton > m_xMtrTrgrStartValue
Definition: cuitabarea.hxx:166
virtual void Reset(const SfxItemSet *) override
Definition: tptrans.cxx:368
std::unique_ptr< weld::MetricSpinButton > m_xMtrTrgrCenterX
Definition: cuitabarea.hxx:160
std::string GetValue
std::unique_ptr< weld::Widget > m_xCtlXRectBorder
Definition: cuitabarea.hxx:169
virtual void ChangesApplied() override
Definition: tptrans.cxx:425
void ActivateLinear(bool bActivate)
Definition: tptrans.cxx:109
std::unique_ptr< weld::RadioButton > m_xRbtTransGradient
Definition: cuitabarea.hxx:151
#define XATTR_FILLGRADIENT
#define SDRATTR_SHADOWTRANSPARENCE
sal_uInt16 GetValue() const
#define XATTR_FILLFLOATTRANSPARENCE
XFillAttrSetItem aXFillAttr
Definition: cuitabarea.hxx:142
PageType
std::unique_ptr< weld::MetricSpinButton > m_xMtrTrgrAngle
Definition: cuitabarea.hxx:164
std::unique_ptr< weld::MetricSpinButton > m_xMtrTrgrBorder
Definition: cuitabarea.hxx:165
#define XATTR_FILLCOLOR
std::unique_ptr< weld::RadioButton > m_xRbtTransOff
Definition: cuitabarea.hxx:149
std::unique_ptr< weld::Widget > m_xCtlBitmapBorder
Definition: cuitabarea.hxx:168
const Color & GetStartColor() const
IMPL_LINK(SvxTransparenceTabPage, ModifiedTrgrListBoxHdl_Impl, weld::ComboBox &, rListBox, void)
Definition: tptrans.cxx:123
static const sal_uInt16 pTransparenceRanges[]
Definition: cuitabarea.hxx:133
sal_uInt16 GetYOffset() const
SvxXRectPreview m_aCtlXRectPreview
Definition: cuitabarea.hxx:146
void SetExchangeSupport()
void InvalidatePreview(bool bEnable=true)
Definition: tptrans.cxx:502
void SetDlgType(sal_uInt16 nInType)
Definition: cuitabarea.hxx:204
std::unique_ptr< weld::CustomWeld > m_xCtlXRectPreview
Definition: cuitabarea.hxx:173
sal_uInt16 GetXOffset() const
IMPL_LINK_NOARG(SvxTransparenceTabPage, ClickTransOffHdl_Impl, weld::ToggleButton &, void)
Definition: tptrans.cxx:68
void ModifiedTrgrHdl_Impl(const weld::ComboBox *)
Definition: tptrans.cxx:133
void SetPageType(PageType nInType)
Definition: cuitabarea.hxx:203
std::unique_ptr< weld::RadioButton > m_xRbtTransLinear
Definition: cuitabarea.hxx:150
void SetEndIntens(sal_uInt16 nNewIntens)
const SfxPoolItem * GetOldItem(const SfxItemSet &rSet, sal_uInt16 nSlot, bool bDeep=true)
virtual bool FillItemSet(SfxItemSet *) override
Definition: tptrans.cxx:267
const SfxItemSet & rOutAttrs
Definition: cuitabarea.hxx:135
sal_uInt16 GetBorder() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
SdrPercentItem makeSdrShadowTransparenceItem(sal_uInt16 nTransp)
std::unique_ptr< weld::MetricSpinButton > m_xMtrTrgrEndValue
Definition: cuitabarea.hxx:167
std::unique_ptr< weld::ComboBox > m_xLbTrgrGradientType
Definition: cuitabarea.hxx:158
long GetAngle() const
const SfxItemSet * GetItemSet(const SfxPoolItem &rAttr)
void SetAttributes(const SfxItemSet &rItemSet)
bool InitPreview(const SfxItemSet &rSet)
Definition: tptrans.cxx:458
#define XATTR_FILLSTYLE
static VclPtr< SfxTabPage > Create(TabPageParent, const SfxItemSet *)
Definition: tptrans.cxx:262
void SetStartIntens(sal_uInt16 nNewIntens)
css::awt::GradientStyle GetGradientStyle() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SfxItemState
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
SvxXRectPreview m_aCtlBitmapPreview
Definition: cuitabarea.hxx:145
unsigned char sal_uInt8
SvxTransparenceTabPage(TabPageParent pParent, const SfxItemSet &rInAttrs)
Definition: tptrans.cxx:209
virtual ~SvxTransparenceTabPage() override
Definition: tptrans.cxx:105
static VclPtr< reference_type > Create(Arg &&...arg)
const OUString PERCENT("Percent")
std::unique_ptr< weld::MetricSpinButton > m_xMtrTransparent
linear transparency
Definition: cuitabarea.hxx:154
constexpr::Color COL_WHITE(0xFF, 0xFF, 0xFF)
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: tptrans.cxx:528
std::unique_ptr< weld::CustomWeld > m_xCtlBitmapPreview
Definition: cuitabarea.hxx:172
std::unique_ptr< weld::MetricSpinButton > m_xMtrTrgrCenterY
Definition: cuitabarea.hxx:162
void ActivateGradient(bool bActivate)
Definition: tptrans.cxx:160
DeactivateRC
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: tptrans.cxx:437
#define XATTR_FILLBITMAP
void SetEnabled(bool bEnable)
void SetControlState_Impl(css::awt::GradientStyle eXGS)
Definition: tptrans.cxx:171
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
sal_Int32 nPos
std::unique_ptr< weld::Widget > m_xGridGradient
Definition: cuitabarea.hxx:157
const Color & GetEndColor() const
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: tptrans.cxx:449
#define XATTR_FILLBACKGROUND
#define XATTR_FILLTRANSPARENCE