LibreOffice Module svx (master) 1
AreaPropertyPanelBase.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 <osl/diagnose.h>
22#include <svx/drawitem.hxx>
23#include <svx/itemwin.hxx>
24#include <svx/svxids.hrc>
25#include <sfx2/objsh.hxx>
26#include <svx/xfltrit.hxx>
27#include <svx/xflftrit.hxx>
29#include <svx/xtable.hxx>
31#include <sfx2/opengrf.hxx>
32#include <sfx2/weldutils.hxx>
33#include <tools/urlobj.hxx>
34#include <bitmaps.hlst>
35#include <comphelper/lok.hxx>
36
37using namespace css;
38using namespace css::uno;
39
40constexpr OUStringLiteral SIDEBARGRADIENT = u"sidebargradient";
41
42namespace svx::sidebar {
43
44namespace {
45
46enum eFillStyle
47{
48 NONE,
49 SOLID,
51 HATCH,
52 BITMAP,
53 PATTERN,
54 USE_BACKGROUND
55};
56
57}
58
61const sal_Int32 AreaPropertyPanelBase::DEFAULT_ANGLE = 0;
63const sal_Int32 AreaPropertyPanelBase::DEFAULT_ENDVALUE = 16777215;
65
67 weld::Widget* pParent,
68 const css::uno::Reference<css::frame::XFrame>& rxFrame)
69 : PanelLayout(pParent, "AreaPropertyPanel", "svx/ui/sidebararea.ui"),
70 mxFrame(rxFrame),
71 meLastXFS(static_cast<sal_uInt16>(-1)),
72 mnLastPosHatch(0),
73 mnLastPosBitmap(0),
74 mnLastPosPattern(0),
75 mnLastTransSolid(50),
76 mxColorTextFT(m_xBuilder->weld_label("filllabel")),
77 mxLbFillType(m_xBuilder->weld_combo_box("fillstylearea")),
78 mxLbFillAttr(m_xBuilder->weld_combo_box("fillattrhb")),
79 mxLbFillGradFrom(new ColorListBox(m_xBuilder->weld_menu_button("fillgrad1"), [this]{ return GetFrameWeld(); })),
80 mxLbFillGradTo(new ColorListBox(m_xBuilder->weld_menu_button("fillgrad2"), [this]{ return GetFrameWeld(); })),
81 mxToolBoxColor(m_xBuilder->weld_toolbar("selectcolor")),
82 mxColorDispatch(new ToolbarUnoDispatcher(*mxToolBoxColor, *m_xBuilder, rxFrame)),
83 mxTrspTextFT(m_xBuilder->weld_label("transparencylabel")),
84 mxLBTransType(m_xBuilder->weld_combo_box("transtype")),
85 mxMTRTransparent(m_xBuilder->weld_metric_spin_button("settransparency", FieldUnit::PERCENT)),
86 mxSldTransparent(m_xBuilder->weld_scale("transparencyslider")),
87 mxBTNGradient(m_xBuilder->weld_toolbar("selectgradient")),
88 mxMTRAngle(m_xBuilder->weld_metric_spin_button("gradangle", FieldUnit::DEGREE)),
89 mxGradientStyle(m_xBuilder->weld_combo_box("gradientstyle")),
90 mxBmpImport(m_xBuilder->weld_button("bmpimport")),
91 maImgAxial(BMP_AXIAL),
92 maImgElli(BMP_ELLI),
93 maImgQuad(BMP_QUAD),
94 maImgRadial(BMP_RADIAL),
95 maImgSquare(BMP_SQUARE),
96 maImgLinear(BMP_LINEAR)
97{
98 Initialize();
99}
100
102{
103 mxTrGrPopup.reset();
104 mxColorTextFT.reset();
105 mxLbFillType.reset();
106 mxLbFillAttr.reset();
107 mxColorDispatch.reset();
108 mxToolBoxColor.reset();
109 mxTrspTextFT.reset();
110 mxLBTransType.reset();
111 mxMTRTransparent.reset();
112 mxSldTransparent.reset();
113 mxBTNGradient.reset();
114 mxMTRAngle.reset();
115 mxLbFillGradFrom.reset();
116 mxLbFillGradTo.reset();
117 mxGradientStyle.reset();
118 mxBmpImport.reset();
119}
120
122{
124
125 mxLbFillAttr->set_size_request(42, -1);
126
132 Color(DEFAULT_STARTVALUE).getBColor(),
133 Color(DEFAULT_ENDVALUE).getBColor()));
135 maGradientLinear.SetGradientStyle(css::awt::GradientStyle_LINEAR);
136
138 maGradientAxial.SetGradientStyle(css::awt::GradientStyle_AXIAL);
139
141 maGradientRadial.SetGradientStyle(css::awt::GradientStyle_RADIAL);
142
144 maGradientElliptical.SetGradientStyle(css::awt::GradientStyle_ELLIPTICAL);
145
147 maGradientSquare.SetGradientStyle(css::awt::GradientStyle_SQUARE);
148
150 maGradientRect.SetGradientStyle(css::awt::GradientStyle_RECT);
151
152
153 mxLbFillType->connect_changed( LINK( this, AreaPropertyPanelBase, SelectFillTypeHdl ) );
154
155 Link<weld::ComboBox&,void> aLink = LINK( this, AreaPropertyPanelBase, SelectFillAttrHdl );
156 mxLbFillAttr->connect_changed( aLink );
157 mxGradientStyle->connect_changed( aLink );
158 Link<ColorListBox&,void> aLink3 = LINK( this, AreaPropertyPanelBase, SelectFillColorHdl );
159 mxLbFillGradFrom->SetSelectHdl( aLink3 );
160 mxLbFillGradTo->SetSelectHdl( aLink3 );
161 mxMTRAngle->connect_value_changed(LINK(this,AreaPropertyPanelBase, ChangeGradientAngle));
162
163 // set a small width to force widgets to take their final width from other widgets in the grid
164 mxLbFillGradFrom->get_widget().set_size_request(42, -1);
165 mxLbFillGradTo->get_widget().set_size_request(42, -1);
166
167 mxLBTransType->connect_changed(LINK(this, AreaPropertyPanelBase, ChangeTrgrTypeHdl_Impl));
168
169 SetTransparency( 50 );
170 mxMTRTransparent->connect_value_changed(LINK(this, AreaPropertyPanelBase, ModifyTransparentHdl_Impl));
171 mxSldTransparent->connect_value_changed(LINK(this, AreaPropertyPanelBase, ModifyTransSliderHdl));
172
173 mxTrGrPopup = std::make_unique<AreaTransparencyGradientPopup>(mxFrame, *this, mxBTNGradient.get());
174
175 mxBTNGradient->set_item_popover(SIDEBARGRADIENT, mxTrGrPopup->getTopLevel());
176 mxBTNGradient->connect_clicked(LINK(this, AreaPropertyPanelBase, ToolbarHdl_Impl));
177
178 mxBTNGradient->set_item_icon_name(SIDEBARGRADIENT, maImgLinear);
179 mxBTNGradient->hide();
180 mxBmpImport->connect_clicked( LINK(this, AreaPropertyPanelBase, ClickImportBitmapHdl));
181}
182
183IMPL_LINK_NOARG(AreaPropertyPanelBase, ToolbarHdl_Impl, const OUString&, void)
184{
185 mxBTNGradient->set_menu_item_active(SIDEBARGRADIENT, !mxBTNGradient->get_menu_item_active(SIDEBARGRADIENT));
186}
187
189{
190 mxSldTransparent->set_value(nVal);
191 mxMTRTransparent->set_value(nVal, FieldUnit::PERCENT);
192}
193
195{
196 SvxOpenGraphicDialog aDlg("Import", GetFrameWeld());
197 aDlg.EnableLink(false);
198 if( aDlg.Execute() != ERRCODE_NONE )
199 return;
200
201 Graphic aGraphic;
202 auto xWait = std::make_unique<weld::WaitObject>(m_xContainer.get());
203 ErrCode nError = aDlg.GetGraphic( aGraphic );
204 xWait.reset();
205 if( nError != ERRCODE_NONE )
206 return;
207
208 mxLbFillAttr->clear();
209
211 {
212 INetURLObject aURL(aDlg.GetPath());
213 OUString aFileName = aURL.GetLastName().getToken(0, '.');
214 OUString aName = aFileName;
215
216 XBitmapListRef pList = pSh->GetItem(SID_BITMAP_LIST)->GetBitmapList();
217
218 tools::Long j = 1;
219 bool bValidBitmapName = false;
220 while( !bValidBitmapName )
221 {
222 bValidBitmapName = true;
223 for( tools::Long i = 0; i < pList->Count() && bValidBitmapName; i++ )
224 {
225 if( aName == pList->GetBitmap(i)->GetName() )
226 {
227 bValidBitmapName = false;
228 aName = aFileName + OUString::number(j++);
229 }
230 }
231 }
232
233 pList->Insert(std::make_unique<XBitmapEntry>(aGraphic, aName));
234 pList->Save();
235
236 SvxFillAttrBox::Fill(*mxLbFillAttr, pList);
237
238 mxLbFillAttr->set_active_text(aName);
239 SelectFillAttrHdl(*mxLbFillAttr);
240 }
241}
242
244{
245 FillStyleChanged(true);
246}
247
249{
250 SelectFillAttrHdl_Impl();
251}
252
254{
255 SelectFillAttrHdl_Impl();
256}
257
259{
260 SelectFillAttrHdl_Impl();
261}
262
264{
265 sal_Int32 nPosFillStyle = static_cast<eFillStyle>(mxLbFillType->get_active());
267
268 // #i122676# dependent from bFillStyleChange, do execute a single or two
269 // changes in one Execute call
270 const bool bFillStyleChange(static_cast<eFillStyle>(meLastXFS) != static_cast<eFillStyle>(nPosFillStyle));
271
272 switch(nPosFillStyle)
273 {
274 case eFillStyle::NONE:
275 {
276 if(bFillStyleChange)
277 {
278 const XFillStyleItem aXFillStyleItem(drawing::FillStyle_NONE);
279 // Need to disable the XFillUseSlideBackgroundItem
280 const XFillUseSlideBackgroundItem aXFillUseSlideBackgroundItem(false);
281 setFillUseBackground(&aXFillStyleItem, aXFillUseSlideBackgroundItem);
282 }
283 break;
284 }
285 case eFillStyle::SOLID:
286 {
287 if(bFillStyleChange)
288 {
289 // #i122676# Single FillStyle change call needed here
290 XFillStyleItem aXFillStyleItem(drawing::FillStyle_SOLID);
291 setFillStyle(aXFillStyleItem);
292 }
293 break;
294 }
295 case eFillStyle::GRADIENT:
296 {
297
298 if (pSh && pSh->GetItem(SID_COLOR_TABLE))
299 {
301 aGradient.SetAngle(Degree10(mxMTRAngle->get_value(FieldUnit::DEGREE) * 10));
302 aGradient.SetGradientStyle(static_cast<css::awt::GradientStyle>(mxGradientStyle->get_active()));
303
304 const XFillGradientItem aXFillGradientItem(mxLbFillAttr->get_active_text(), aGradient);
305
306 // #i122676# Change FillStyle and Gradient in one call
307 XFillStyleItem aXFillStyleItem(drawing::FillStyle_GRADIENT);
308 setFillStyleAndGradient(bFillStyleChange ? &aXFillStyleItem : nullptr, aXFillGradientItem);
309 }
310 break;
311 }
312 case eFillStyle::HATCH:
313 {
314 sal_Int32 nPos = mxLbFillAttr->get_active();
315
316 if (nPos == -1)
317 {
319 }
320
321 if (nPos != -1 && pSh && pSh->GetItem(SID_HATCH_LIST))
322 {
323 const SvxHatchListItem * pItem = pSh->GetItem(SID_HATCH_LIST);
324
325 if(nPos < pItem->GetHatchList()->Count())
326 {
327 const XHatch aHatch = pItem->GetHatchList()->GetHatch(nPos)->GetHatch();
328 const XFillHatchItem aXFillHatchItem( mxLbFillAttr->get_active_text(), aHatch);
329
330 // #i122676# Change FillStyle and Hatch in one call
331 XFillStyleItem aXFillStyleItem(drawing::FillStyle_HATCH);
332 setFillStyleAndHatch(bFillStyleChange ? &aXFillStyleItem : nullptr, aXFillHatchItem);
333 }
334 }
335
336 if (nPos != -1)
337 {
339 }
340 break;
341 }
342 case eFillStyle::BITMAP:
343 {
344 sal_Int32 nPos = mxLbFillAttr->get_active();
345
346 if (nPos == -1)
347 {
349 }
350
351 if (nPos != -1 && pSh && pSh->GetItem(SID_BITMAP_LIST))
352 {
353 const SvxBitmapListItem * pItem = pSh->GetItem(SID_BITMAP_LIST);
354
355 if(nPos < pItem->GetBitmapList()->Count())
356 {
357 const XBitmapEntry* pXBitmapEntry = pItem->GetBitmapList()->GetBitmap(nPos);
358 const XFillBitmapItem aXFillBitmapItem(mxLbFillAttr->get_active_text(), pXBitmapEntry->GetGraphicObject());
359
360 // #i122676# Change FillStyle and Bitmap in one call
361 XFillStyleItem aXFillStyleItem(drawing::FillStyle_BITMAP);
362 setFillStyleAndBitmap(bFillStyleChange ? &aXFillStyleItem : nullptr, aXFillBitmapItem);
363 }
364 }
365
366 if (nPos != -1)
367 {
369 }
370 break;
371 }
372 case eFillStyle::PATTERN:
373 {
374 sal_Int32 nPos = mxLbFillAttr->get_active();
375
376 if (nPos == -1)
377 {
379 }
380
381 if (nPos != -1 && pSh && pSh->GetItem(SID_PATTERN_LIST))
382 {
383 const SvxPatternListItem * pItem = pSh->GetItem(SID_PATTERN_LIST);
384
385 if(nPos < pItem->GetPatternList()->Count())
386 {
387 const XBitmapEntry* pXPatternEntry = pItem->GetPatternList()->GetBitmap(nPos);
388 const XFillBitmapItem aXFillBitmapItem(mxLbFillAttr->get_active_text(), pXPatternEntry->GetGraphicObject());
389
390 // #i122676# Change FillStyle and Bitmap in one call
391 XFillStyleItem aXFillStyleItem(drawing::FillStyle_BITMAP);
392 setFillStyleAndBitmap(bFillStyleChange ? &aXFillStyleItem : nullptr, aXFillBitmapItem);
393 }
394 }
395
396 if (nPos != -1)
397 {
399 }
400 break;
401 }
402 }
405}
406
408{
409 sal_Int32 nPos = static_cast<eFillStyle>(mxLbFillType->get_active());
410 mxLbFillAttr->clear();
412 if (!pSh)
413 return;
414
415 bool bShowLbFillAttr = false;
416 bool bShowLbFillGradFrom = false;
417 bool bShowLbFillGradTo = false;
418 bool bShowGradientStyle = false;
419 bool bShowMTRAngle = false;
420 bool bShowToolBoxColor = false;
421 bool bShowBmpImport = false;
422
423 // #i122676# Do no longer trigger two Execute calls, one for SID_ATTR_FILL_STYLE
424 // and one for setting the fill attribute itself, but add two SfxPoolItems to the
425 // call to get just one action at the SdrObject and to create only one Undo action, too.
426 // Checked that this works in all apps.
427 switch (nPos)
428 {
429 default:
430 case NONE:
431 {
432 if (bUpdateModel)
433 {
434 const XFillStyleItem aXFillStyleItem(drawing::FillStyle_NONE);
435 // Need to disable the XFillUseSlideBackgroundItem
436 const XFillUseSlideBackgroundItem aXFillUseSlideBackgroundItem(false);
437 setFillUseBackground(&aXFillStyleItem, aXFillUseSlideBackgroundItem);
438 }
439
440 break;
441 }
442 case SOLID:
443 {
444 bShowToolBoxColor = true;
445
446 if (bUpdateModel)
447 {
448 const Color aColor = mpColorItem ? mpColorItem->GetColorValue() : COL_AUTO;
449 const XFillColorItem aXFillColorItem("", aColor);
450
451 // #i122676# change FillStyle and Color in one call
452 XFillStyleItem aXFillStyleItem(drawing::FillStyle_SOLID);
453 setFillStyleAndColor(&aXFillStyleItem, aXFillColorItem);
454 }
455 break;
456 }
457 case GRADIENT:
458 {
459 bShowLbFillGradFrom = true;
460 bShowLbFillGradTo = true;
461 bShowGradientStyle = true;
462 bShowMTRAngle = true;
463
464 mxLbFillAttr->set_sensitive(true);
465 mxLbFillGradTo->set_sensitive(true);
466 mxLbFillGradFrom->set_sensitive(true);
467 mxGradientStyle->set_sensitive(true);
468 mxMTRAngle->set_sensitive(true);
469 mxLbFillAttr->clear();
470
471 if (bUpdateModel)
472 {
473 mxLbFillAttr->hide();
474 mxToolBoxColor->hide();
475 mxBmpImport->hide();
476
477 const SvxGradientListItem* pItem = pSh->GetItem(SID_GRADIENT_LIST);
478 if (pItem->GetGradientList()->Count() > 0)
479 {
480 const basegfx::BGradient aGradient
481 = pItem->GetGradientList()->GetGradient(0)->GetGradient();
482 const OUString aName = pItem->GetGradientList()->GetGradient(0)->GetName();
483 const XFillGradientItem aXFillGradientItem(aName, aGradient);
484
485 // #i122676# change FillStyle and Gradient in one call
486 XFillStyleItem aXFillStyleItem(drawing::FillStyle_GRADIENT);
487 setFillStyleAndGradient(&aXFillStyleItem, aXFillGradientItem);
488 mxLbFillGradFrom->SelectEntry(Color(aGradient.GetColorStops().front().getStopColor()));
489 mxLbFillGradTo->SelectEntry(Color(aGradient.GetColorStops().back().getStopColor()));
490
491 // MCGR: preserve ColorStops if given
492 // tdf#155901 We need offset of first and last stop, so include them.
493 if (aGradient.GetColorStops().size() >= 2)
494 maColorStops = aGradient.GetColorStops();
495 else
496 maColorStops.clear();
497
498 mxMTRAngle->set_value(toDegrees(aGradient.GetAngle()), FieldUnit::DEGREE);
499 css::awt::GradientStyle eXGS = aGradient.GetGradientStyle();
500 mxGradientStyle->set_active(sal::static_int_cast<sal_Int32>(eXGS));
501 }
502 }
503 else
504 {
505 if (pSh->GetItem(SID_GRADIENT_LIST))
506 {
508 pSh->GetItem(SID_GRADIENT_LIST)->GetGradientList());
509 mxLbFillGradTo->SetNoSelection();
510 mxLbFillGradFrom->SetNoSelection();
512 {
513 const OUString aString(mpFillGradientItem->GetName());
514 mxLbFillAttr->set_active_text(aString);
515 const basegfx::BGradient aGradient = mpFillGradientItem->GetGradientValue();
516 mxLbFillGradFrom->SelectEntry(Color(aGradient.GetColorStops().front().getStopColor()));
517 mxLbFillGradTo->SelectEntry(Color(aGradient.GetColorStops().back().getStopColor()));
518
519 // MCGR: preserve ColorStops if given
520 // tdf#155901 We need offset of first and last stop, so include them.
521 if (aGradient.GetColorStops().size() >= 2)
522 maColorStops = aGradient.GetColorStops();
523 else
524 maColorStops.clear();
525
526 mxGradientStyle->set_active(
527 sal::static_int_cast<sal_Int32>(aGradient.GetGradientStyle()));
528 if (mxGradientStyle->get_active() == sal_Int32(css::awt::GradientStyle_RADIAL))
529 mxMTRAngle->set_sensitive(false);
530 else
531 mxMTRAngle->set_value(toDegrees(aGradient.GetAngle()),
532 FieldUnit::DEGREE);
533 }
534 else
535 {
536 mxLbFillAttr->set_active(-1);
537 }
538 }
539 else
540 {
541 mxLbFillAttr->set_active(-1);
542 }
543 }
544 break;
545 }
546 case HATCH:
547 {
548 bShowLbFillAttr = true;
549
550 const SvxHatchListItem* pItem(pSh->GetItem(SID_HATCH_LIST));
551 if (pItem)
552 {
553 const XHatchListRef& pXHatchList(pItem->GetHatchList());
554 mxLbFillAttr->set_sensitive(true);
555 mxLbFillAttr->clear();
556 SvxFillAttrBox::Fill(*mxLbFillAttr, pXHatchList);
557
558 if (mnLastPosHatch != -1)
559 {
560 if (mnLastPosHatch < pXHatchList->Count())
561 {
562 const XHatch aHatch = pXHatchList->GetHatch(mnLastPosHatch)->GetHatch();
563 const OUString aName = pXHatchList->GetHatch(mnLastPosHatch)->GetName();
564 const XFillHatchItem aXFillHatchItem(aName, aHatch);
565
566 // #i122676# change FillStyle and Hatch in one call
567 if (bUpdateModel)
568 {
569 XFillStyleItem aXFillStyleItem(drawing::FillStyle_HATCH);
570 setFillStyleAndHatch(&aXFillStyleItem, aXFillHatchItem);
571 }
572 mxLbFillAttr->set_active(mnLastPosHatch);
573 }
574 }
575 }
576 else
577 {
578 mxLbFillAttr->set_sensitive(false);
579 }
580 break;
581 }
582 case BITMAP:
583 case PATTERN:
584 {
585 bShowLbFillAttr = true;
586 mxLbFillAttr->set_sensitive(true);
587 mxLbFillAttr->clear();
588
589 OUString aName;
590 GraphicObject aBitmap;
591 if (nPos == static_cast<sal_Int32>(BITMAP))
592 {
594 bShowBmpImport = true;
595 const SvxBitmapListItem* pItem = pSh->GetItem(SID_BITMAP_LIST);
596 if (pItem)
597 {
598 const XBitmapListRef& pXBitmapList(pItem->GetBitmapList());
599 SvxFillAttrBox::Fill(*mxLbFillAttr, pXBitmapList);
600
601 if (mnLastPosBitmap != -1)
602 {
603 if (mnLastPosBitmap < pXBitmapList->Count())
604 {
605 const XBitmapEntry* pXBitmapEntry
606 = pXBitmapList->GetBitmap(mnLastPosBitmap);
607 aBitmap = pXBitmapEntry->GetGraphicObject();
608 aName = pXBitmapEntry->GetName();
609 mxLbFillAttr->set_active(mnLastPosBitmap);
610 }
611 }
612 }
613 else
614 {
615 bShowBmpImport = false;
616 }
617 }
618 else if (nPos == static_cast<sal_Int32>(PATTERN))
619 {
620 const SvxPatternListItem* pItem = pSh->GetItem(SID_PATTERN_LIST);
621 if (pItem)
622 {
623 const XPatternListRef& pXPatternList(pItem->GetPatternList());
624 SvxFillAttrBox::Fill(*mxLbFillAttr, pXPatternList);
625
626 if (mnLastPosPattern != -1)
627 {
628 if (mnLastPosPattern < pXPatternList->Count())
629 {
630 const XBitmapEntry* pXPatternEntry
631 = pXPatternList->GetBitmap(mnLastPosPattern);
632 aBitmap = pXPatternEntry->GetGraphicObject();
633 aName = pXPatternEntry->GetName();
634 mxLbFillAttr->set_active(mnLastPosPattern);
635 }
636 }
637 }
638 else
639 {
640 bShowLbFillAttr = false;
641 }
642 }
643 if (bUpdateModel)
644 {
645 const XFillBitmapItem aXFillBitmapItem(aName, aBitmap);
646 const XFillStyleItem aXFillStyleItem(drawing::FillStyle_BITMAP);
647 setFillStyleAndBitmap(&aXFillStyleItem, aXFillBitmapItem);
648 }
649 break;
650 }
651 case USE_BACKGROUND:
652 {
653 // No transparencies here
654 mxLBTransType->hide();
655 mxTrspTextFT->hide();
656 mxMTRTransparent->hide();
657 mxSldTransparent->hide();
658 mxBTNGradient->hide();
659 if (bUpdateModel)
660 {
661 const XFillStyleItem aXFillStyleItem(drawing::FillStyle_NONE);
662 const XFillUseSlideBackgroundItem aXFillUseSlideBackgroundItem(true);
663 setFillUseBackground(&aXFillStyleItem, aXFillUseSlideBackgroundItem);
664 break;
665 }
666 }
667 }
668
669 mxLbFillAttr->set_visible(bShowLbFillAttr);
670 mxLbFillGradFrom->set_visible(bShowLbFillGradFrom);
671 mxLbFillGradTo->set_visible(bShowLbFillGradTo);
672 mxGradientStyle->set_visible(bShowGradientStyle);
673 mxMTRAngle->set_visible(bShowMTRAngle);
674 mxToolBoxColor->set_visible(bShowToolBoxColor);
675 mxBmpImport->set_visible(bShowBmpImport);
676
677 meLastXFS = static_cast<sal_uInt16>(nPos);
678
681}
682
684{
686 {
687 bool bZeroValue(false);
688
690 {
691 const sal_uInt16 nValue(mpTransparenceItem->GetValue());
692
693 if(!nValue)
694 {
695 bZeroValue = true;
696 }
697 else if(nValue <= 100)
698 {
699 mxLBTransType->set_sensitive(true);
700 mxTrspTextFT->set_sensitive(true);
701 mxLBTransType->set_active(1);
702 mxBTNGradient->hide();
703 mxMTRTransparent->show();
704 mxSldTransparent->show();
705 mxMTRTransparent->set_sensitive(true);
706 mxSldTransparent->set_sensitive(true);
708 }
709
710 if (!bZeroValue && mxTrGrPopup)
711 {
712 mxBTNGradient->set_menu_item_active(SIDEBARGRADIENT, false);
713 }
714 }
715
716 if(bZeroValue && mpFloatTransparenceItem)
717 {
718 if(mpFloatTransparenceItem->IsEnabled())
719 {
720 const basegfx::BGradient& rGradient = mpFloatTransparenceItem->GetGradientValue();
721 sal_Int32 nEntryPos(0);
722 OUString* pImage = nullptr;
723
724 mxLBTransType->set_sensitive(true);
725 mxTrspTextFT->set_sensitive(true);
726 mxMTRTransparent->hide();
727 mxSldTransparent->hide();
728 mxBTNGradient->set_sensitive(true);
729 mxBTNGradient->show();
730
731 switch(rGradient.GetGradientStyle())
732 {
733 default:
734 case css::awt::GradientStyle_LINEAR:
735 {
736 nEntryPos = 2;
737 pImage = &maImgLinear;
738 break;
739 }
740 case css::awt::GradientStyle_AXIAL:
741 {
742 nEntryPos = 3;
743 pImage = &maImgAxial;
744 break;
745 }
746 case css::awt::GradientStyle_RADIAL:
747 {
748 nEntryPos = 4;
749 pImage = &maImgRadial;
750 break;
751 }
752 case css::awt::GradientStyle_ELLIPTICAL:
753 {
754 nEntryPos = 5;
755 pImage = &maImgElli;
756 break;
757 }
758 case css::awt::GradientStyle_SQUARE:
759 {
760 nEntryPos = 6;
761 pImage = &maImgQuad;
762 break;
763 }
764 case css::awt::GradientStyle_RECT:
765 {
766 nEntryPos = 7;
767 pImage = &maImgSquare;
768 break;
769 }
770 }
771 mxLBTransType->set_active(nEntryPos);
772 mxBTNGradient->set_item_icon_name(SIDEBARGRADIENT, *pImage);
773 mxTrGrPopup->Rearrange(mpFloatTransparenceItem.get());
774 bZeroValue = false;
775 }
776 else
777 {
778 bZeroValue = true;
779 }
780 }
781
782 if(bZeroValue)
783 {
784 mxLBTransType->set_sensitive(true);
785 mxTrspTextFT->set_sensitive(true);
786 mxLBTransType->set_active(0);
787 mxBTNGradient->hide();
788 mxMTRTransparent->set_sensitive(true);
789 mxSldTransparent->set_sensitive(true);
790 mxMTRTransparent->show();
791 mxSldTransparent->show();
793 }
794 }
795 else
796 {
797 // no transparency at all
798 mxLBTransType->set_active(-1);
799 mxLBTransType->set_sensitive(false);
800 mxTrspTextFT->set_sensitive(false);
801 mxMTRTransparent->set_sensitive(false);
802 mxSldTransparent->set_sensitive(false);
803 mxMTRTransparent->show();
804 mxSldTransparent->show();
805 mxBTNGradient->set_sensitive(false);
806 mxBTNGradient->hide();
807 }
808}
809
810void AreaPropertyPanelBase::updateFillTransparence(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState)
811{
812 if (bDisabled)
813 {
814 mpTransparenceItem.reset();
815 return;
816 }
817 else if (bDefaultOrSet)
818 {
819 if (pState)
820 {
821 const SfxUInt16Item* pItem = static_cast<const SfxUInt16Item*>(pState);
822 mpTransparenceItem.reset(pItem->Clone());
823 }
824 else
825 {
826 mpTransparenceItem.reset();
827 }
828 }
829 else
830 {
831 mpTransparenceItem.reset();
832 }
833
834 // update transparency settings dependent of mpTransparenceItem and mpFloatTransparenceItem
836}
837
838void AreaPropertyPanelBase::updateFillFloatTransparence(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState)
839{
840 if (bDisabled)
841 {
843 return;
844 }
845
846 if (bDefaultOrSet)
847 {
848 if (pState)
849 {
850 const XFillFloatTransparenceItem* pItem = static_cast<const XFillFloatTransparenceItem*>(pState);
851 mpFloatTransparenceItem.reset(pItem->Clone());
852 }
853 else
854 {
856 }
857 }
858 else
859 {
861 }
862
863 // update transparency settings dependent of mpTransparenceItem and mpFloatTransparenceItem
865}
866
867void AreaPropertyPanelBase::updateFillStyle(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState)
868{
869 if(bDisabled)
870 {
871 mxLbFillType->set_sensitive(false);
872 mxColorTextFT->set_sensitive(false);
873 mxLbFillType->set_active(-1);
874 mxLbFillAttr->show();
875 mxLbFillAttr->set_sensitive(false);
876 mxLbFillAttr->set_active(-1);
877 mxToolBoxColor->hide();
878 meLastXFS = static_cast<sal_uInt16>(-1);
879 mpStyleItem.reset();
880 }
881 else if (bDefaultOrSet && pState)
882 {
883 const XFillStyleItem* pItem = static_cast<const XFillStyleItem*>(pState);
884 mpStyleItem.reset(pItem->Clone());
885 mxLbFillType->set_sensitive(true);
886 mxColorTextFT->set_sensitive(true);
887 drawing::FillStyle eXFS = mpStyleItem->GetValue();
888 eFillStyle nPos = NONE;
889 switch(eXFS)
890 {
891 default:
892 case drawing::FillStyle_NONE:
893 {
894 mxLbFillAttr->hide();
895 // "Use slide background" also uses FillStyle_NONE internally,
896 // don't switch listbox in that case (will be handled by updateFillUseBackground)
897 nPos = meLastXFS == USE_BACKGROUND ? USE_BACKGROUND : NONE;
898 break;
899 }
900 case drawing::FillStyle_SOLID:
901 nPos = SOLID;
902 break;
903 case drawing::FillStyle_GRADIENT:
904 nPos = GRADIENT;
905 break;
906 case drawing::FillStyle_HATCH:
907 nPos = HATCH;
908 break;
909 case drawing::FillStyle_BITMAP:
910 {
911 if(mpBitmapItem)
912 {
913 if(!mpBitmapItem->isPattern())
914 nPos = BITMAP;
915 else
916 nPos = PATTERN;
917 }
918 else
919 nPos = BITMAP;
920 break;
921 }
922 }
923 meLastXFS = static_cast< sal_uInt16 >(mxLbFillType->get_active());
924 mxLbFillType->set_active(static_cast< sal_Int32 >(nPos));
925 FillStyleChanged(false);
926 return;
927 }
928
929 mxLbFillType->set_active(-1);
930 mxLbFillAttr->show();
931 mxLbFillAttr->set_sensitive(false);
932 mxLbFillAttr->set_active(-1);
933 mxToolBoxColor->hide();
934 meLastXFS = static_cast<sal_uInt16>(-1);
935 mpStyleItem.reset();
936}
937
938void AreaPropertyPanelBase::updateFillGradient(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState)
939{
940 if (bDefaultOrSet)
941 {
942 const XFillGradientItem* pItem = static_cast<const XFillGradientItem*>(pState);
943 mpFillGradientItem.reset(pItem ? pItem->Clone() : nullptr);
944 }
945
946 if(mpStyleItem && drawing::FillStyle_GRADIENT == mpStyleItem->GetValue())
947 {
948 mxLbFillAttr->hide();
949 mxLbFillGradFrom->show();
950 mxLbFillGradTo->show();
951 mxMTRAngle->show();
952 mxGradientStyle->show();
953 mxToolBoxColor->hide();
954
955 if (bDefaultOrSet)
956 {
957 mxLbFillType->set_active(GRADIENT);
958 FillStyleChanged(false);
959 }
960 else if(bDisabled)
961 {
962 mxLbFillGradFrom->SetNoSelection();
963 mxLbFillGradTo->SetNoSelection();
964 mxLbFillGradFrom->set_sensitive(false);
965 mxLbFillGradTo->set_sensitive(false);
966 mxMTRAngle->set_sensitive(false);
967 mxGradientStyle->set_sensitive(false);
968 }
969 else
970 {
971 mxLbFillGradFrom->SetNoSelection();
972 mxLbFillGradTo->SetNoSelection();
973 }
974 }
975}
976
977void AreaPropertyPanelBase::updateFillHatch(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState)
978{
979 if (bDefaultOrSet)
980 {
981 const XFillHatchItem* pItem = static_cast<const XFillHatchItem*>(pState);
982 mpHatchItem.reset(pItem ? pItem->Clone() : nullptr);
983 }
984
985 if(mpStyleItem && drawing::FillStyle_HATCH == mpStyleItem->GetValue())
986 {
987 mxLbFillAttr->show();
988 mxToolBoxColor->hide();
989
990 if (bDefaultOrSet)
991 {
992 mxLbFillAttr->set_sensitive(true);
993 mxLbFillType->set_active(HATCH);
994 FillStyleChanged(false);
995 }
996 else if(bDisabled)
997 {
998 mxLbFillAttr->set_sensitive(false);
999 mxLbFillAttr->set_active(-1);
1000 }
1001 else
1002 {
1003 mxLbFillAttr->set_active(-1);
1004 }
1005 }
1006 FillStyleChanged(false);
1007}
1008
1009void AreaPropertyPanelBase::updateFillColor(bool bDefaultOrSet, const SfxPoolItem* pState)
1010{
1011 if (bDefaultOrSet)
1012 {
1013 const XFillColorItem* pItem = static_cast<const XFillColorItem*>(pState);
1014 mpColorItem.reset(pItem ? pItem->Clone() : nullptr);
1015 }
1016
1017 if(mpStyleItem && drawing::FillStyle_SOLID == mpStyleItem->GetValue())
1018 {
1019 mxLbFillAttr->hide();
1020 mxToolBoxColor->show();
1021 mxLbFillType->set_active(SOLID);
1022 FillStyleChanged(false);
1023 }
1024}
1025
1026void AreaPropertyPanelBase::updateFillBitmap(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState)
1027{
1028 if (bDefaultOrSet)
1029 {
1030 const XFillBitmapItem* pItem = static_cast<const XFillBitmapItem*>(pState);
1031 mpBitmapItem.reset(pItem ? pItem->Clone() : nullptr);
1032 }
1033
1034 if(mpStyleItem && drawing::FillStyle_BITMAP == mpStyleItem->GetValue())
1035 {
1036 mxLbFillAttr->show();
1037 mxToolBoxColor->hide();
1038
1039 if (bDefaultOrSet)
1040 {
1041 if(mpBitmapItem->isPattern())
1042 mxLbFillType->set_active(PATTERN);
1043 else
1044 mxLbFillType->set_active(BITMAP);
1045 FillStyleChanged(false);
1046 }
1047 else if(bDisabled)
1048 {
1049 mxLbFillAttr->hide();
1050 mxLbFillAttr->set_active(-1);
1051 }
1052 else
1053 {
1054 mxLbFillAttr->set_active(-1);
1055 }
1056 }
1057}
1058
1059void AreaPropertyPanelBase::updateFillUseBackground(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState)
1060{
1061 if (bDisabled)
1062 return;
1063
1064 if (bDefaultOrSet)
1065 {
1066 if (pState)
1067 {
1068 const XFillUseSlideBackgroundItem* pItem = static_cast<const XFillUseSlideBackgroundItem*>(pState);
1069 // When XFillUseSlideBackgroundItem is true, select "Use Background Fill". When false, select "None"
1070 int nPos = pItem->GetValue() ? USE_BACKGROUND : NONE;
1071 mxLbFillType->set_active(nPos);
1072 FillStyleChanged(false);
1073 }
1074 }
1075}
1076
1078 sal_uInt16 nSID,
1079 SfxItemState eState,
1080 const SfxPoolItem* pState)
1081{
1082 const bool bDisabled(SfxItemState::DISABLED == eState);
1083 const bool bDefaultOrSet(SfxItemState::DEFAULT <= eState);
1084 const bool bDefault(SfxItemState::DEFAULT == eState);
1085
1086 switch(nSID)
1087 {
1088 case SID_ATTR_FILL_TRANSPARENCE:
1089 updateFillTransparence(bDisabled, bDefaultOrSet, pState);
1090 break;
1091 case SID_ATTR_FILL_FLOATTRANSPARENCE:
1092 updateFillFloatTransparence(bDisabled, bDefaultOrSet, pState);
1093 break;
1094 case SID_ATTR_FILL_STYLE:
1095 updateFillStyle(bDisabled, bDefaultOrSet, pState);
1096 break;
1097 case SID_ATTR_FILL_COLOR:
1098 updateFillColor(bDefaultOrSet, pState);
1099 break;
1100 case SID_ATTR_FILL_GRADIENT:
1101 updateFillGradient(bDisabled, bDefaultOrSet, pState);
1102 break;
1103 case SID_ATTR_FILL_HATCH:
1104 updateFillHatch(bDisabled, bDefaultOrSet, pState);
1105 break;
1106 case SID_ATTR_FILL_BITMAP:
1107 updateFillBitmap(bDisabled, bDefaultOrSet, pState);
1108 break;
1109 case SID_ATTR_FILL_USE_SLIDE_BACKGROUND:
1110 updateFillUseBackground(bDisabled, bDefaultOrSet, pState);
1111 break;
1112 case SID_GRADIENT_LIST:
1113 {
1114 if(bDefault)
1115 {
1116 if(mpStyleItem && drawing::FillStyle_GRADIENT == mpStyleItem->GetValue())
1117 {
1119 {
1120 const OUString aString( mpFillGradientItem->GetName() );
1122 mxLbFillAttr->clear();
1123 if (pSh)
1124 {
1125 mxLbFillAttr->set_sensitive(true);
1126 SvxFillAttrBox::Fill(*mxLbFillAttr, pSh->GetItem(SID_GRADIENT_LIST)->GetGradientList());
1127 }
1128 mxLbFillAttr->set_active_text(aString);
1129 }
1130 else
1131 {
1132 mxLbFillAttr->set_active(-1);
1133 }
1134 }
1135 }
1136 break;
1137 }
1138 case SID_HATCH_LIST:
1139 {
1140 if(bDefault)
1141 {
1142 if(mpStyleItem && drawing::FillStyle_HATCH == mpStyleItem->GetValue())
1143 {
1144 if(mpHatchItem)
1145 {
1146 const OUString aString( mpHatchItem->GetName() );
1148 mxLbFillAttr->clear();
1149 if (pSh)
1150 {
1151 mxLbFillAttr->set_sensitive(true);
1152 SvxFillAttrBox::Fill(*mxLbFillAttr, pSh->GetItem(SID_HATCH_LIST)->GetHatchList());
1153 }
1154 mxLbFillAttr->set_active_text(aString);
1155 }
1156 else
1157 {
1158 mxLbFillAttr->set_active(-1);
1159 }
1160 }
1161 }
1162 break;
1163 }
1164 case SID_BITMAP_LIST:
1165 case SID_PATTERN_LIST:
1166 {
1167 if(bDefault)
1168 {
1169 if(mpStyleItem && drawing::FillStyle_BITMAP == mpStyleItem->GetValue())
1170 {
1171 if(mpBitmapItem)
1172 {
1173 const OUString aString( mpBitmapItem->GetName() );
1175 mxLbFillAttr->clear();
1176 mxLbFillAttr->show();
1177 if (pSh)
1178 {
1179 if(nSID == SID_BITMAP_LIST)
1180 SvxFillAttrBox::Fill(*mxLbFillAttr, pSh->GetItem(SID_BITMAP_LIST)->GetBitmapList());
1181 else if(nSID == SID_PATTERN_LIST)
1182 SvxFillAttrBox::Fill(*mxLbFillAttr, pSh->GetItem(SID_PATTERN_LIST)->GetPatternList());
1183 }
1184 mxLbFillAttr->set_active_text(aString);
1185 }
1186 else
1187 {
1188 mxLbFillAttr->set_active(-1);
1189 }
1190 }
1191 }
1192 break;
1193 }
1194 }
1195 FillStyleChanged(false);
1196}
1197
1199{
1200 const sal_uInt16 nVal = mxSldTransparent->get_value();
1201 SetTransparency(nVal);
1202 const XFillTransparenceItem aLinearItem(nVal);
1203 setFillTransparence(aLinearItem);
1204}
1205
1207{
1208 sal_Int32 nSelectType = mxLBTransType->get_active();
1209 bool bGradient = false;
1210 sal_uInt16 nTrans = 0;
1211
1212 if(!nSelectType)
1213 {
1214 mxBTNGradient->hide();
1215 mxMTRTransparent->show();
1216 mxSldTransparent->show();
1217 mxMTRTransparent->set_sensitive(true);
1218 mxSldTransparent->set_sensitive(true);
1219 SetTransparency(0);
1220 }
1221 else if(1 == nSelectType)
1222 {
1223 mxBTNGradient->hide();
1224 mxMTRTransparent->show();
1225 mxSldTransparent->show();
1226 nTrans = mnLastTransSolid;
1227 mxMTRTransparent->set_value(nTrans, FieldUnit::PERCENT);
1228 mxLBTransType->set_active(1);
1229 mxMTRTransparent->set_sensitive(true);
1230 mxSldTransparent->set_sensitive(true);
1231 }
1232 else
1233 {
1234 mxBTNGradient->show();
1235
1236 switch (nSelectType)
1237 {
1238 case 2:
1239 mxBTNGradient->set_item_icon_name(SIDEBARGRADIENT, maImgLinear);
1240 break;
1241 case 3:
1242 mxBTNGradient->set_item_icon_name(SIDEBARGRADIENT, maImgAxial);
1243 break;
1244 case 4:
1245 mxBTNGradient->set_item_icon_name(SIDEBARGRADIENT, maImgRadial);
1246 break;
1247 case 5:
1248 mxBTNGradient->set_item_icon_name(SIDEBARGRADIENT, maImgElli);
1249 break;
1250 case 6:
1251 mxBTNGradient->set_item_icon_name(SIDEBARGRADIENT, maImgQuad);
1252 break;
1253 case 7:
1254 mxBTNGradient->set_item_icon_name(SIDEBARGRADIENT, maImgSquare);
1255 break;
1256 }
1257
1258 mxMTRTransparent->hide();
1259 mxSldTransparent->hide();
1260 mxBTNGradient->set_sensitive(true);
1261 bGradient = true;
1262 }
1263
1264 const XFillTransparenceItem aLinearItem(nTrans);
1265 setFillTransparence(aLinearItem);
1266
1267 if(nSelectType > 1)
1268 {
1269 nSelectType -= 2;
1270 }
1271
1272 basegfx::BGradient aTmpGradient;
1273
1274 switch(static_cast<css::awt::GradientStyle>(nSelectType))
1275 {
1276 case css::awt::GradientStyle_LINEAR:
1277 aTmpGradient = maGradientLinear;
1278 break;
1279 case css::awt::GradientStyle_AXIAL:
1280 aTmpGradient = maGradientAxial;
1281 break;
1282 case css::awt::GradientStyle_RADIAL:
1283 aTmpGradient = maGradientRadial;
1284 break;
1285 case css::awt::GradientStyle_ELLIPTICAL:
1286 aTmpGradient = maGradientElliptical;
1287 break;
1288 case css::awt::GradientStyle_SQUARE:
1289 aTmpGradient = maGradientSquare;
1290 break;
1291 case css::awt::GradientStyle_RECT:
1292 aTmpGradient = maGradientRect;
1293 break;
1294 default:
1295 break;
1296 }
1297
1298 const XFillFloatTransparenceItem aGradientItem(aTmpGradient, bGradient);
1299 setFillFloatTransparence(aGradientItem);
1300}
1301
1303{
1304 const sal_uInt16 nTrans = static_cast<sal_uInt16>(mxMTRTransparent->get_value(FieldUnit::PERCENT));
1305 mnLastTransSolid = nTrans;
1306 SetTransparency(nTrans);
1307 const sal_Int32 nSelectType = mxLBTransType->get_active();
1308
1309 if(nTrans && !nSelectType)
1310 {
1311 mxLBTransType->set_active(1);
1312 }
1313
1314 const XFillTransparenceItem aLinearItem(nTrans);
1315 setFillTransparence(aLinearItem);
1316}
1317
1318const basegfx::BGradient& AreaPropertyPanelBase::GetGradient (const css::awt::GradientStyle eStyle) const
1319{
1320 switch (eStyle)
1321 {
1322 default:
1323 case css::awt::GradientStyle_LINEAR:
1324 return maGradientLinear;
1325 case css::awt::GradientStyle_AXIAL:
1326 return maGradientAxial;
1327 case css::awt::GradientStyle_RADIAL:
1328 return maGradientRadial;
1329 case css::awt::GradientStyle_ELLIPTICAL:
1330 return maGradientElliptical;
1331 case css::awt::GradientStyle_SQUARE:
1332 return maGradientSquare;
1333 case css::awt::GradientStyle_RECT:
1334 return maGradientRect;
1335 }
1336}
1337
1339{
1340 switch (rGradient.GetGradientStyle())
1341 {
1342 case css::awt::GradientStyle_LINEAR:
1343 maGradientLinear = rGradient;
1344 break;
1345 case css::awt::GradientStyle_AXIAL:
1346 maGradientAxial = rGradient;
1347 break;
1348 case css::awt::GradientStyle_RADIAL:
1349 maGradientRadial = rGradient;
1350 break;
1351 case css::awt::GradientStyle_ELLIPTICAL:
1352 maGradientElliptical = rGradient;
1353 break;
1354 case css::awt::GradientStyle_SQUARE:
1355 maGradientSquare = rGradient;
1356 break;
1357 case css::awt::GradientStyle_RECT:
1358 maGradientRect = rGradient;
1359 break;
1360 default:
1361 break;
1362 }
1363}
1364
1366{
1367 return mxLBTransType->get_active();
1368}
1369
1371{
1372 basegfx::BColorStops aColorStops;
1373
1374 if (maColorStops.size() >= 2)
1375 {
1376 aColorStops = maColorStops;
1377 aColorStops.front() = basegfx::BColorStop(maColorStops.front().getStopOffset(),
1378 mxLbFillGradFrom->GetSelectEntryColor().getBColor());
1379 aColorStops.back() = basegfx::BColorStop(maColorStops.back().getStopOffset(),
1380 mxLbFillGradTo->GetSelectEntryColor().getBColor());
1381 }
1382 else
1383 {
1384 aColorStops.emplace_back(0.0, mxLbFillGradFrom->GetSelectEntryColor().getBColor());
1385 aColorStops.emplace_back(1.0, mxLbFillGradTo->GetSelectEntryColor().getBColor());
1386 }
1387
1388 return aColorStops;
1389}
1390
1391} // end of namespace svx::sidebar
1392
1393/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
constexpr OUStringLiteral SIDEBARGRADIENT
sfx2::sidebar::Panel * m_pPanel
virtual weld::Window * GetFrameWeld() const
bool GetValue() const
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
virtual SfxUInt16Item * Clone(SfxItemPool *=nullptr) const override
const XBitmapListRef & GetBitmapList() const
Definition: drawitem.hxx:122
const XGradientListRef & GetGradientList() const
Definition: drawitem.hxx:73
const XHatchListRef & GetHatchList() const
Definition: drawitem.hxx:97
OUString GetPath() const
ErrCode GetGraphic(Graphic &) const
const XPatternListRef & GetPatternList() const
Definition: drawitem.hxx:146
const GraphicObject & GetGraphicObject() const
Definition: xtable.hxx:125
virtual XFillBitmapItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattrbmp.cxx:150
virtual XFillColorItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2005
virtual XFillFloatTransparenceItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2522
virtual XFillGradientItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2215
virtual XFillHatchItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2668
virtual XFillStyleItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:1871
Item to enable slide background for filled objects.
const OUString & GetName() const
void SetGradientStyle(css::awt::GradientStyle eNewStyle)
void SetColorStops(const basegfx::BColorStops &rSteps)
void SetYOffset(sal_uInt16 nNewOffset)
void SetXOffset(sal_uInt16 nNewOffset)
void SetBorder(sal_uInt16 nNewBorder)
const basegfx::BColorStops & GetColorStops() const
Degree10 GetAngle() const
css::awt::GradientStyle GetGradientStyle() const
void SetAngle(Degree10 nNewAngle)
std::unique_ptr< XFillStyleItem > mpStyleItem
std::unique_ptr< weld::ComboBox > mxLbFillAttr
virtual void setFillUseBackground(const XFillStyleItem *pStyleItem, const XFillUseSlideBackgroundItem &rItem)=0
std::unique_ptr< ToolbarUnoDispatcher > mxColorDispatch
std::unique_ptr< XFillBitmapItem > mpBitmapItem
AreaPropertyPanelBase(weld::Widget *pParent, const css::uno::Reference< css::frame::XFrame > &rxFrame)
void updateFillUseBackground(bool BDisabled, bool bDefaultOrSet, const SfxPoolItem *pState)
std::unique_ptr< SfxUInt16Item > mpTransparenceItem
void updateFillFloatTransparence(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem *pState)
std::unique_ptr< weld::ComboBox > mxLbFillType
std::unique_ptr< weld::ComboBox > mxGradientStyle
virtual void setFillStyleAndBitmap(const XFillStyleItem *pStyleItem, const XFillBitmapItem &aHatchItem)=0
void updateFillColor(bool bDefaultOrSet, const SfxPoolItem *pState)
void updateFillHatch(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem *pState)
const basegfx::BGradient & GetGradient(const css::awt::GradientStyle eStyle) const
std::unique_ptr< weld::Button > mxBmpImport
std::unique_ptr< ColorListBox > mxLbFillGradFrom
std::unique_ptr< XFillGradientItem > mpFillGradientItem
virtual void setFillStyle(const XFillStyleItem &rItem)=0
const css::uno::Reference< css::frame::XFrame > & mxFrame
std::unique_ptr< ColorListBox > mxLbFillGradTo
std::unique_ptr< weld::Toolbar > mxBTNGradient
std::unique_ptr< XFillHatchItem > mpHatchItem
std::unique_ptr< XFillFloatTransparenceItem > mpFloatTransparenceItem
void SetGradient(const basegfx::BGradient &rGradient)
void updateFillStyle(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem *pState)
virtual void setFillStyleAndHatch(const XFillStyleItem *pStyleItem, const XFillHatchItem &aHatchItem)=0
std::unique_ptr< weld::Label > mxTrspTextFT
virtual void setFillStyleAndGradient(const XFillStyleItem *pStyleItem, const XFillGradientItem &aGradientItem)=0
virtual void NotifyItemUpdate(const sal_uInt16 nSId, const SfxItemState eState, const SfxPoolItem *pState) override
std::unique_ptr< AreaTransparencyGradientPopup > mxTrGrPopup
void updateFillBitmap(bool BDisabled, bool bDefaultOrSet, const SfxPoolItem *pState)
void updateFillGradient(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem *pState)
std::unique_ptr< XFillColorItem > mpColorItem
std::unique_ptr< weld::MetricSpinButton > mxMTRTransparent
std::unique_ptr< weld::Scale > mxSldTransparent
std::unique_ptr< weld::ComboBox > mxLBTransType
std::unique_ptr< weld::Label > mxColorTextFT
virtual void setFillStyleAndColor(const XFillStyleItem *pStyleItem, const XFillColorItem &aColorItem)=0
std::unique_ptr< weld::Toolbar > mxToolBoxColor
void updateFillTransparence(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem *pState)
std::unique_ptr< weld::MetricSpinButton > mxMTRAngle
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
double toDegrees(D x)
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
URL aURL
float u
#define ERRCODE_NONE
sal_Int16 nValue
Definition: fmsrccfg.cxx:81
OUString aName
sal_uInt16 nPos
SVX_DLLPUBLIC void Fill(weld::ComboBox &, const XHatchListRef &pList)
Definition: itemwin.cxx:244
SVX_DLLPUBLIC void Fill(weld::ComboBox &rListBox)
Definition: itemwin.cxx:173
NONE
int i
IMPL_LINK_NOARG(AreaPropertyPanelBase, ToolbarHdl_Impl, const OUString &, void)
long Long
Reference< XNameAccess > m_xContainer
SfxItemState
Count
constexpr OUStringLiteral PATTERN