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 OStringLiteral SIDEBARGRADIENT = "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
133 maGradientLinear.SetGradientStyle(css::awt::GradientStyle_LINEAR);
134
136 maGradientAxial.SetGradientStyle(css::awt::GradientStyle_AXIAL);
137
139 maGradientRadial.SetGradientStyle(css::awt::GradientStyle_RADIAL);
140
142 maGradientElliptical.SetGradientStyle(css::awt::GradientStyle_ELLIPTICAL);
143
145 maGradientSquare.SetGradientStyle(css::awt::GradientStyle_SQUARE);
146
148 maGradientRect.SetGradientStyle(css::awt::GradientStyle_RECT);
149
150
151 mxLbFillType->connect_changed( LINK( this, AreaPropertyPanelBase, SelectFillTypeHdl ) );
152
153 Link<weld::ComboBox&,void> aLink = LINK( this, AreaPropertyPanelBase, SelectFillAttrHdl );
154 mxLbFillAttr->connect_changed( aLink );
155 mxGradientStyle->connect_changed( aLink );
156 Link<ColorListBox&,void> aLink3 = LINK( this, AreaPropertyPanelBase, SelectFillColorHdl );
157 mxLbFillGradFrom->SetSelectHdl( aLink3 );
158 mxLbFillGradTo->SetSelectHdl( aLink3 );
159 mxMTRAngle->connect_value_changed(LINK(this,AreaPropertyPanelBase, ChangeGradientAngle));
160
161 // set a small width to force widgets to take their final width from other widgets in the grid
162 mxLbFillGradFrom->get_widget().set_size_request(42, -1);
163 mxLbFillGradTo->get_widget().set_size_request(42, -1);
164
165 mxLBTransType->connect_changed(LINK(this, AreaPropertyPanelBase, ChangeTrgrTypeHdl_Impl));
166
167 SetTransparency( 50 );
168 mxMTRTransparent->connect_value_changed(LINK(this, AreaPropertyPanelBase, ModifyTransparentHdl_Impl));
169 mxSldTransparent->connect_value_changed(LINK(this, AreaPropertyPanelBase, ModifyTransSliderHdl));
170
171 mxTrGrPopup = std::make_unique<AreaTransparencyGradientPopup>(mxFrame, *this, mxBTNGradient.get());
172
173 mxBTNGradient->set_item_popover(SIDEBARGRADIENT, mxTrGrPopup->getTopLevel());
174 mxBTNGradient->connect_clicked(LINK(this, AreaPropertyPanelBase, ToolbarHdl_Impl));
175
176 mxBTNGradient->set_item_icon_name(SIDEBARGRADIENT, maImgLinear);
177 mxBTNGradient->hide();
178 mxBmpImport->connect_clicked( LINK(this, AreaPropertyPanelBase, ClickImportBitmapHdl));
179}
180
181IMPL_LINK_NOARG(AreaPropertyPanelBase, ToolbarHdl_Impl, const OString&, void)
182{
183 mxBTNGradient->set_menu_item_active(SIDEBARGRADIENT, !mxBTNGradient->get_menu_item_active(SIDEBARGRADIENT));
184}
185
187{
188 mxSldTransparent->set_value(nVal);
189 mxMTRTransparent->set_value(nVal, FieldUnit::PERCENT);
190}
191
193{
194 SvxOpenGraphicDialog aDlg("Import", GetFrameWeld());
195 aDlg.EnableLink(false);
196 if( aDlg.Execute() != ERRCODE_NONE )
197 return;
198
199 Graphic aGraphic;
200 auto xWait = std::make_unique<weld::WaitObject>(m_xContainer.get());
201 ErrCode nError = aDlg.GetGraphic( aGraphic );
202 xWait.reset();
203 if( nError != ERRCODE_NONE )
204 return;
205
206 mxLbFillAttr->clear();
207
209 {
210 INetURLObject aURL(aDlg.GetPath());
211 OUString aFileName = aURL.GetLastName().getToken(0, '.');
212 OUString aName = aFileName;
213
214 XBitmapListRef pList = pSh->GetItem(SID_BITMAP_LIST)->GetBitmapList();
215
216 tools::Long j = 1;
217 bool bValidBitmapName = false;
218 while( !bValidBitmapName )
219 {
220 bValidBitmapName = true;
221 for( tools::Long i = 0; i < pList->Count() && bValidBitmapName; i++ )
222 {
223 if( aName == pList->GetBitmap(i)->GetName() )
224 {
225 bValidBitmapName = false;
226 aName = aFileName + OUString::number(j++);
227 }
228 }
229 }
230
231 pList->Insert(std::make_unique<XBitmapEntry>(aGraphic, aName));
232 pList->Save();
233
234 SvxFillAttrBox::Fill(*mxLbFillAttr, pList);
235
236 mxLbFillAttr->set_active_text(aName);
237 SelectFillAttrHdl(*mxLbFillAttr);
238 }
239}
240
242{
243 FillStyleChanged(true);
244}
245
247{
248 SelectFillAttrHdl_Impl();
249}
250
252{
253 SelectFillAttrHdl_Impl();
254}
255
257{
258 SelectFillAttrHdl_Impl();
259}
260
262{
263 sal_Int32 nPosFillStyle = static_cast<eFillStyle>(mxLbFillType->get_active());
265
266 // #i122676# dependent from bFillStyleChange, do execute a single or two
267 // changes in one Execute call
268 const bool bFillStyleChange(static_cast<eFillStyle>(meLastXFS) != static_cast<eFillStyle>(nPosFillStyle));
269
270 switch(nPosFillStyle)
271 {
272 case eFillStyle::NONE:
273 {
274 if(bFillStyleChange)
275 {
276 const XFillStyleItem aXFillStyleItem(drawing::FillStyle_NONE);
277 // Need to disable the XFillUseSlideBackgroundItem
278 const XFillUseSlideBackgroundItem aXFillUseSlideBackgroundItem(false);
279 setFillUseBackground(&aXFillStyleItem, aXFillUseSlideBackgroundItem);
280 }
281 break;
282 }
283 case eFillStyle::SOLID:
284 {
285 if(bFillStyleChange)
286 {
287 // #i122676# Single FillStyle change call needed here
288 XFillStyleItem aXFillStyleItem(drawing::FillStyle_SOLID);
289 setFillStyle(aXFillStyleItem);
290 }
291 break;
292 }
293 case eFillStyle::GRADIENT:
294 {
295
296 if (pSh && pSh->GetItem(SID_COLOR_TABLE))
297 {
298 XGradient aGradient;
299 aGradient.SetAngle(Degree10(mxMTRAngle->get_value(FieldUnit::DEGREE) * 10));
300 aGradient.SetGradientStyle(static_cast<css::awt::GradientStyle>(mxGradientStyle->get_active()));
301 aGradient.SetStartColor(mxLbFillGradFrom->GetSelectEntryColor());
302 aGradient.SetEndColor(mxLbFillGradTo->GetSelectEntryColor());
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 XGradient 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(aGradient.GetStartColor());
489 mxLbFillGradTo->SelectEntry(aGradient.GetEndColor());
490
491 mxMTRAngle->set_value(toDegrees(aGradient.GetAngle()), FieldUnit::DEGREE);
492 css::awt::GradientStyle eXGS = aGradient.GetGradientStyle();
493 mxGradientStyle->set_active(sal::static_int_cast<sal_Int32>(eXGS));
494 }
495 }
496 else
497 {
498 if (pSh->GetItem(SID_GRADIENT_LIST))
499 {
501 pSh->GetItem(SID_GRADIENT_LIST)->GetGradientList());
502 mxLbFillGradTo->SetNoSelection();
503 mxLbFillGradFrom->SetNoSelection();
505 {
506 const OUString aString(mpFillGradientItem->GetName());
507 mxLbFillAttr->set_active_text(aString);
508 const XGradient aGradient = mpFillGradientItem->GetGradientValue();
509 mxLbFillGradFrom->SelectEntry(aGradient.GetStartColor());
510 mxLbFillGradTo->SelectEntry(aGradient.GetEndColor());
511 mxGradientStyle->set_active(
512 sal::static_int_cast<sal_Int32>(aGradient.GetGradientStyle()));
513 if (mxGradientStyle->get_active() == sal_Int32(GradientStyle::Radial))
514 mxMTRAngle->set_sensitive(false);
515 else
516 mxMTRAngle->set_value(toDegrees(aGradient.GetAngle()),
517 FieldUnit::DEGREE);
518 }
519 else
520 {
521 mxLbFillAttr->set_active(-1);
522 }
523 }
524 else
525 {
526 mxLbFillAttr->set_active(-1);
527 }
528 }
529 break;
530 }
531 case HATCH:
532 {
533 bShowLbFillAttr = true;
534
535 const SvxHatchListItem* pItem(pSh->GetItem(SID_HATCH_LIST));
536 if (pItem)
537 {
538 const XHatchListRef& pXHatchList(pItem->GetHatchList());
539 mxLbFillAttr->set_sensitive(true);
540 mxLbFillAttr->clear();
541 SvxFillAttrBox::Fill(*mxLbFillAttr, pXHatchList);
542
543 if (mnLastPosHatch != -1)
544 {
545 if (mnLastPosHatch < pXHatchList->Count())
546 {
547 const XHatch aHatch = pXHatchList->GetHatch(mnLastPosHatch)->GetHatch();
548 const OUString aName = pXHatchList->GetHatch(mnLastPosHatch)->GetName();
549 const XFillHatchItem aXFillHatchItem(aName, aHatch);
550
551 // #i122676# change FillStyle and Hatch in one call
552 if (bUpdateModel)
553 {
554 XFillStyleItem aXFillStyleItem(drawing::FillStyle_HATCH);
555 setFillStyleAndHatch(&aXFillStyleItem, aXFillHatchItem);
556 }
557 mxLbFillAttr->set_active(mnLastPosHatch);
558 }
559 }
560 }
561 else
562 {
563 mxLbFillAttr->set_sensitive(false);
564 }
565 break;
566 }
567 case BITMAP:
568 case PATTERN:
569 {
570 bShowLbFillAttr = true;
571 mxLbFillAttr->set_sensitive(true);
572 mxLbFillAttr->clear();
573
574 OUString aName;
575 GraphicObject aBitmap;
576 if (nPos == static_cast<sal_Int32>(BITMAP))
577 {
579 bShowBmpImport = true;
580 const SvxBitmapListItem* pItem = pSh->GetItem(SID_BITMAP_LIST);
581 if (pItem)
582 {
583 const XBitmapListRef& pXBitmapList(pItem->GetBitmapList());
584 SvxFillAttrBox::Fill(*mxLbFillAttr, pXBitmapList);
585
586 if (mnLastPosBitmap != -1)
587 {
588 if (mnLastPosBitmap < pXBitmapList->Count())
589 {
590 const XBitmapEntry* pXBitmapEntry
591 = pXBitmapList->GetBitmap(mnLastPosBitmap);
592 aBitmap = pXBitmapEntry->GetGraphicObject();
593 aName = pXBitmapEntry->GetName();
594 mxLbFillAttr->set_active(mnLastPosBitmap);
595 }
596 }
597 }
598 else
599 {
600 bShowBmpImport = false;
601 }
602 }
603 else if (nPos == static_cast<sal_Int32>(PATTERN))
604 {
605 const SvxPatternListItem* pItem = pSh->GetItem(SID_PATTERN_LIST);
606 if (pItem)
607 {
608 const XPatternListRef& pXPatternList(pItem->GetPatternList());
609 SvxFillAttrBox::Fill(*mxLbFillAttr, pXPatternList);
610
611 if (mnLastPosPattern != -1)
612 {
613 if (mnLastPosPattern < pXPatternList->Count())
614 {
615 const XBitmapEntry* pXPatternEntry
616 = pXPatternList->GetBitmap(mnLastPosPattern);
617 aBitmap = pXPatternEntry->GetGraphicObject();
618 aName = pXPatternEntry->GetName();
619 mxLbFillAttr->set_active(mnLastPosPattern);
620 }
621 }
622 }
623 else
624 {
625 bShowLbFillAttr = false;
626 }
627 }
628 if (bUpdateModel)
629 {
630 const XFillBitmapItem aXFillBitmapItem(aName, aBitmap);
631 const XFillStyleItem aXFillStyleItem(drawing::FillStyle_BITMAP);
632 setFillStyleAndBitmap(&aXFillStyleItem, aXFillBitmapItem);
633 }
634 break;
635 }
636 case USE_BACKGROUND:
637 {
638 // No transparencies here
639 mxLBTransType->hide();
640 mxTrspTextFT->hide();
641 mxMTRTransparent->hide();
642 mxSldTransparent->hide();
643 mxBTNGradient->hide();
644 if (bUpdateModel)
645 {
646 const XFillStyleItem aXFillStyleItem(drawing::FillStyle_NONE);
647 const XFillUseSlideBackgroundItem aXFillUseSlideBackgroundItem(true);
648 setFillUseBackground(&aXFillStyleItem, aXFillUseSlideBackgroundItem);
649 break;
650 }
651 }
652 }
653
654 mxLbFillAttr->set_visible(bShowLbFillAttr);
655 mxLbFillGradFrom->set_visible(bShowLbFillGradFrom);
656 mxLbFillGradTo->set_visible(bShowLbFillGradTo);
657 mxGradientStyle->set_visible(bShowGradientStyle);
658 mxMTRAngle->set_visible(bShowMTRAngle);
659 mxToolBoxColor->set_visible(bShowToolBoxColor);
660 mxBmpImport->set_visible(bShowBmpImport);
661
662 meLastXFS = static_cast<sal_uInt16>(nPos);
663
666}
667
669{
671 {
672 bool bZeroValue(false);
673
675 {
676 const sal_uInt16 nValue(mpTransparenceItem->GetValue());
677
678 if(!nValue)
679 {
680 bZeroValue = true;
681 }
682 else if(nValue <= 100)
683 {
684 mxLBTransType->set_sensitive(true);
685 mxTrspTextFT->set_sensitive(true);
686 mxLBTransType->set_active(1);
687 mxBTNGradient->hide();
688 mxMTRTransparent->show();
689 mxSldTransparent->show();
690 mxMTRTransparent->set_sensitive(true);
691 mxSldTransparent->set_sensitive(true);
693 }
694
695 if (!bZeroValue && mxTrGrPopup)
696 {
697 mxBTNGradient->set_menu_item_active(SIDEBARGRADIENT, false);
698 }
699 }
700
701 if(bZeroValue && mpFloatTransparenceItem)
702 {
703 if(mpFloatTransparenceItem->IsEnabled())
704 {
705 const XGradient& rGradient = mpFloatTransparenceItem->GetGradientValue();
706 sal_Int32 nEntryPos(0);
707 OUString* pImage = nullptr;
708
709 mxLBTransType->set_sensitive(true);
710 mxTrspTextFT->set_sensitive(true);
711 mxMTRTransparent->hide();
712 mxSldTransparent->hide();
713 mxBTNGradient->set_sensitive(true);
714 mxBTNGradient->show();
715
716 switch(rGradient.GetGradientStyle())
717 {
718 default:
719 case css::awt::GradientStyle_LINEAR:
720 {
721 nEntryPos = 2;
722 pImage = &maImgLinear;
723 break;
724 }
725 case css::awt::GradientStyle_AXIAL:
726 {
727 nEntryPos = 3;
728 pImage = &maImgAxial;
729 break;
730 }
731 case css::awt::GradientStyle_RADIAL:
732 {
733 nEntryPos = 4;
734 pImage = &maImgRadial;
735 break;
736 }
737 case css::awt::GradientStyle_ELLIPTICAL:
738 {
739 nEntryPos = 5;
740 pImage = &maImgElli;
741 break;
742 }
743 case css::awt::GradientStyle_SQUARE:
744 {
745 nEntryPos = 6;
746 pImage = &maImgQuad;
747 break;
748 }
749 case css::awt::GradientStyle_RECT:
750 {
751 nEntryPos = 7;
752 pImage = &maImgSquare;
753 break;
754 }
755 }
756 mxLBTransType->set_active(nEntryPos);
757 mxBTNGradient->set_item_icon_name(SIDEBARGRADIENT, *pImage);
758 mxTrGrPopup->Rearrange(mpFloatTransparenceItem.get());
759 bZeroValue = false;
760 }
761 else
762 {
763 bZeroValue = true;
764 }
765 }
766
767 if(bZeroValue)
768 {
769 mxLBTransType->set_sensitive(true);
770 mxTrspTextFT->set_sensitive(true);
771 mxLBTransType->set_active(0);
772 mxBTNGradient->hide();
773 mxMTRTransparent->set_sensitive(true);
774 mxSldTransparent->set_sensitive(true);
775 mxMTRTransparent->show();
776 mxSldTransparent->show();
778 }
779 }
780 else
781 {
782 // no transparency at all
783 mxLBTransType->set_active(-1);
784 mxLBTransType->set_sensitive(false);
785 mxTrspTextFT->set_sensitive(false);
786 mxMTRTransparent->set_sensitive(false);
787 mxSldTransparent->set_sensitive(false);
788 mxMTRTransparent->show();
789 mxSldTransparent->show();
790 mxBTNGradient->set_sensitive(false);
791 mxBTNGradient->hide();
792 }
793}
794
795void AreaPropertyPanelBase::updateFillTransparence(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState)
796{
797 if (bDisabled)
798 {
799 mpTransparenceItem.reset();
800 return;
801 }
802 else if (bDefaultOrSet)
803 {
804 if (pState)
805 {
806 const SfxUInt16Item* pItem = static_cast<const SfxUInt16Item*>(pState);
807 mpTransparenceItem.reset(pItem->Clone());
808 }
809 else
810 {
811 mpTransparenceItem.reset();
812 }
813 }
814 else
815 {
816 mpTransparenceItem.reset();
817 }
818
819 // update transparency settings dependent of mpTransparenceItem and mpFloatTransparenceItem
821}
822
823void AreaPropertyPanelBase::updateFillFloatTransparence(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState)
824{
825 if (bDisabled)
826 {
828 return;
829 }
830
831 if (bDefaultOrSet)
832 {
833 if (pState)
834 {
835 const XFillFloatTransparenceItem* pItem = static_cast<const XFillFloatTransparenceItem*>(pState);
836 mpFloatTransparenceItem.reset(pItem->Clone());
837 }
838 else
839 {
841 }
842 }
843 else
844 {
846 }
847
848 // update transparency settings dependent of mpTransparenceItem and mpFloatTransparenceItem
850}
851
852void AreaPropertyPanelBase::updateFillStyle(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState)
853{
854 if(bDisabled)
855 {
856 mxLbFillType->set_sensitive(false);
857 mxColorTextFT->set_sensitive(false);
858 mxLbFillType->set_active(-1);
859 mxLbFillAttr->show();
860 mxLbFillAttr->set_sensitive(false);
861 mxLbFillAttr->set_active(-1);
862 mxToolBoxColor->hide();
863 meLastXFS = static_cast<sal_uInt16>(-1);
864 mpStyleItem.reset();
865 }
866 else if (bDefaultOrSet && pState)
867 {
868 const XFillStyleItem* pItem = static_cast<const XFillStyleItem*>(pState);
869 mpStyleItem.reset(pItem->Clone());
870 mxLbFillType->set_sensitive(true);
871 mxColorTextFT->set_sensitive(true);
872 drawing::FillStyle eXFS = mpStyleItem->GetValue();
873 eFillStyle nPos = NONE;
874 switch(eXFS)
875 {
876 default:
877 case drawing::FillStyle_NONE:
878 {
879 mxLbFillAttr->hide();
880 // "Use slide background" also uses FillStyle_NONE internally,
881 // don't switch listbox in that case (will be handled by updateFillUseBackground)
882 nPos = meLastXFS == USE_BACKGROUND ? USE_BACKGROUND : NONE;
883 break;
884 }
885 case drawing::FillStyle_SOLID:
886 nPos = SOLID;
887 break;
888 case drawing::FillStyle_GRADIENT:
889 nPos = GRADIENT;
890 break;
891 case drawing::FillStyle_HATCH:
892 nPos = HATCH;
893 break;
894 case drawing::FillStyle_BITMAP:
895 {
896 if(mpBitmapItem)
897 {
898 if(!mpBitmapItem->isPattern())
899 nPos = BITMAP;
900 else
901 nPos = PATTERN;
902 }
903 else
904 nPos = BITMAP;
905 break;
906 }
907 }
908 meLastXFS = static_cast< sal_uInt16 >(mxLbFillType->get_active());
909 mxLbFillType->set_active(static_cast< sal_Int32 >(nPos));
910 FillStyleChanged(false);
911 return;
912 }
913
914 mxLbFillType->set_active(-1);
915 mxLbFillAttr->show();
916 mxLbFillAttr->set_sensitive(false);
917 mxLbFillAttr->set_active(-1);
918 mxToolBoxColor->hide();
919 meLastXFS = static_cast<sal_uInt16>(-1);
920 mpStyleItem.reset();
921}
922
923void AreaPropertyPanelBase::updateFillGradient(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState)
924{
925 if (bDefaultOrSet)
926 {
927 const XFillGradientItem* pItem = static_cast<const XFillGradientItem*>(pState);
928 mpFillGradientItem.reset(pItem ? pItem->Clone() : nullptr);
929 }
930
931 if(mpStyleItem && drawing::FillStyle_GRADIENT == mpStyleItem->GetValue())
932 {
933 mxLbFillAttr->hide();
934 mxLbFillGradFrom->show();
935 mxLbFillGradTo->show();
936 mxMTRAngle->show();
937 mxGradientStyle->show();
938 mxToolBoxColor->hide();
939
940 if (bDefaultOrSet)
941 {
942 mxLbFillType->set_active(GRADIENT);
943 FillStyleChanged(false);
944 }
945 else if(bDisabled)
946 {
947 mxLbFillGradFrom->SetNoSelection();
948 mxLbFillGradTo->SetNoSelection();
949 mxLbFillGradFrom->set_sensitive(false);
950 mxLbFillGradTo->set_sensitive(false);
951 mxMTRAngle->set_sensitive(false);
952 mxGradientStyle->set_sensitive(false);
953 }
954 else
955 {
956 mxLbFillGradFrom->SetNoSelection();
957 mxLbFillGradTo->SetNoSelection();
958 }
959 }
960}
961
962void AreaPropertyPanelBase::updateFillHatch(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState)
963{
964 if (bDefaultOrSet)
965 {
966 const XFillHatchItem* pItem = static_cast<const XFillHatchItem*>(pState);
967 mpHatchItem.reset(pItem ? pItem->Clone() : nullptr);
968 }
969
970 if(mpStyleItem && drawing::FillStyle_HATCH == mpStyleItem->GetValue())
971 {
972 mxLbFillAttr->show();
973 mxToolBoxColor->hide();
974
975 if (bDefaultOrSet)
976 {
977 mxLbFillAttr->set_sensitive(true);
978 mxLbFillType->set_active(HATCH);
979 FillStyleChanged(false);
980 }
981 else if(bDisabled)
982 {
983 mxLbFillAttr->set_sensitive(false);
984 mxLbFillAttr->set_active(-1);
985 }
986 else
987 {
988 mxLbFillAttr->set_active(-1);
989 }
990 }
991 FillStyleChanged(false);
992}
993
994void AreaPropertyPanelBase::updateFillColor(bool bDefaultOrSet, const SfxPoolItem* pState)
995{
996 if (bDefaultOrSet)
997 {
998 const XFillColorItem* pItem = static_cast<const XFillColorItem*>(pState);
999 mpColorItem.reset(pItem ? pItem->Clone() : nullptr);
1000 }
1001
1002 if(mpStyleItem && drawing::FillStyle_SOLID == mpStyleItem->GetValue())
1003 {
1004 mxLbFillAttr->hide();
1005 mxToolBoxColor->show();
1006 mxLbFillType->set_active(SOLID);
1007 FillStyleChanged(false);
1008 }
1009}
1010
1011void AreaPropertyPanelBase::updateFillBitmap(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState)
1012{
1013 if (bDefaultOrSet)
1014 {
1015 const XFillBitmapItem* pItem = static_cast<const XFillBitmapItem*>(pState);
1016 mpBitmapItem.reset(pItem ? pItem->Clone() : nullptr);
1017 }
1018
1019 if(mpStyleItem && drawing::FillStyle_BITMAP == mpStyleItem->GetValue())
1020 {
1021 mxLbFillAttr->show();
1022 mxToolBoxColor->hide();
1023
1024 if (bDefaultOrSet)
1025 {
1026 if(mpBitmapItem->isPattern())
1027 mxLbFillType->set_active(PATTERN);
1028 else
1029 mxLbFillType->set_active(BITMAP);
1030 FillStyleChanged(false);
1031 }
1032 else if(bDisabled)
1033 {
1034 mxLbFillAttr->hide();
1035 mxLbFillAttr->set_active(-1);
1036 }
1037 else
1038 {
1039 mxLbFillAttr->set_active(-1);
1040 }
1041 }
1042}
1043
1044void AreaPropertyPanelBase::updateFillUseBackground(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState)
1045{
1046 if (bDisabled)
1047 return;
1048
1049 if (bDefaultOrSet)
1050 {
1051 if (pState)
1052 {
1053 const XFillUseSlideBackgroundItem* pItem = static_cast<const XFillUseSlideBackgroundItem*>(pState);
1054 // When XFillUseSlideBackgroundItem is true, select "Use Background Fill". When false, select "None"
1055 int nPos = pItem->GetValue() ? USE_BACKGROUND : NONE;
1056 mxLbFillType->set_active(nPos);
1057 FillStyleChanged(false);
1058 }
1059 }
1060}
1061
1063 sal_uInt16 nSID,
1064 SfxItemState eState,
1065 const SfxPoolItem* pState)
1066{
1067 const bool bDisabled(SfxItemState::DISABLED == eState);
1068 const bool bDefaultOrSet(SfxItemState::DEFAULT <= eState);
1069 const bool bDefault(SfxItemState::DEFAULT == eState);
1070
1071 switch(nSID)
1072 {
1073 case SID_ATTR_FILL_TRANSPARENCE:
1074 updateFillTransparence(bDisabled, bDefaultOrSet, pState);
1075 break;
1076 case SID_ATTR_FILL_FLOATTRANSPARENCE:
1077 updateFillFloatTransparence(bDisabled, bDefaultOrSet, pState);
1078 break;
1079 case SID_ATTR_FILL_STYLE:
1080 updateFillStyle(bDisabled, bDefaultOrSet, pState);
1081 break;
1082 case SID_ATTR_FILL_COLOR:
1083 updateFillColor(bDefaultOrSet, pState);
1084 break;
1085 case SID_ATTR_FILL_GRADIENT:
1086 updateFillGradient(bDisabled, bDefaultOrSet, pState);
1087 break;
1088 case SID_ATTR_FILL_HATCH:
1089 updateFillHatch(bDisabled, bDefaultOrSet, pState);
1090 break;
1091 case SID_ATTR_FILL_BITMAP:
1092 updateFillBitmap(bDisabled, bDefaultOrSet, pState);
1093 break;
1094 case SID_ATTR_FILL_USE_SLIDE_BACKGROUND:
1095 updateFillUseBackground(bDisabled, bDefaultOrSet, pState);
1096 break;
1097 case SID_GRADIENT_LIST:
1098 {
1099 if(bDefault)
1100 {
1101 if(mpStyleItem && drawing::FillStyle_GRADIENT == mpStyleItem->GetValue())
1102 {
1104 {
1105 const OUString aString( mpFillGradientItem->GetName() );
1107 mxLbFillAttr->clear();
1108 if (pSh)
1109 {
1110 mxLbFillAttr->set_sensitive(true);
1111 SvxFillAttrBox::Fill(*mxLbFillAttr, pSh->GetItem(SID_GRADIENT_LIST)->GetGradientList());
1112 }
1113 mxLbFillAttr->set_active_text(aString);
1114 }
1115 else
1116 {
1117 mxLbFillAttr->set_active(-1);
1118 }
1119 }
1120 }
1121 break;
1122 }
1123 case SID_HATCH_LIST:
1124 {
1125 if(bDefault)
1126 {
1127 if(mpStyleItem && drawing::FillStyle_HATCH == mpStyleItem->GetValue())
1128 {
1129 if(mpHatchItem)
1130 {
1131 const OUString aString( mpHatchItem->GetName() );
1133 mxLbFillAttr->clear();
1134 if (pSh)
1135 {
1136 mxLbFillAttr->set_sensitive(true);
1137 SvxFillAttrBox::Fill(*mxLbFillAttr, pSh->GetItem(SID_HATCH_LIST)->GetHatchList());
1138 }
1139 mxLbFillAttr->set_active_text(aString);
1140 }
1141 else
1142 {
1143 mxLbFillAttr->set_active(-1);
1144 }
1145 }
1146 }
1147 break;
1148 }
1149 case SID_BITMAP_LIST:
1150 case SID_PATTERN_LIST:
1151 {
1152 if(bDefault)
1153 {
1154 if(mpStyleItem && drawing::FillStyle_BITMAP == mpStyleItem->GetValue())
1155 {
1156 if(mpBitmapItem)
1157 {
1158 const OUString aString( mpBitmapItem->GetName() );
1160 mxLbFillAttr->clear();
1161 mxLbFillAttr->show();
1162 if (pSh)
1163 {
1164 if(nSID == SID_BITMAP_LIST)
1165 SvxFillAttrBox::Fill(*mxLbFillAttr, pSh->GetItem(SID_BITMAP_LIST)->GetBitmapList());
1166 else if(nSID == SID_PATTERN_LIST)
1167 SvxFillAttrBox::Fill(*mxLbFillAttr, pSh->GetItem(SID_PATTERN_LIST)->GetPatternList());
1168 }
1169 mxLbFillAttr->set_active_text(aString);
1170 }
1171 else
1172 {
1173 mxLbFillAttr->set_active(-1);
1174 }
1175 }
1176 }
1177 break;
1178 }
1179 }
1180 FillStyleChanged(false);
1181}
1182
1184{
1185 const sal_uInt16 nVal = mxSldTransparent->get_value();
1186 SetTransparency(nVal);
1187 const XFillTransparenceItem aLinearItem(nVal);
1188 setFillTransparence(aLinearItem);
1189}
1190
1192{
1193 sal_Int32 nSelectType = mxLBTransType->get_active();
1194 bool bGradient = false;
1195 sal_uInt16 nTrans = 0;
1196
1197 if(!nSelectType)
1198 {
1199 mxBTNGradient->hide();
1200 mxMTRTransparent->show();
1201 mxSldTransparent->show();
1202 mxMTRTransparent->set_sensitive(true);
1203 mxSldTransparent->set_sensitive(true);
1204 SetTransparency(0);
1205 }
1206 else if(1 == nSelectType)
1207 {
1208 mxBTNGradient->hide();
1209 mxMTRTransparent->show();
1210 mxSldTransparent->show();
1211 nTrans = mnLastTransSolid;
1212 mxMTRTransparent->set_value(nTrans, FieldUnit::PERCENT);
1213 mxLBTransType->set_active(1);
1214 mxMTRTransparent->set_sensitive(true);
1215 mxSldTransparent->set_sensitive(true);
1216 }
1217 else
1218 {
1219 mxBTNGradient->show();
1220
1221 switch (nSelectType)
1222 {
1223 case 2:
1224 mxBTNGradient->set_item_icon_name(SIDEBARGRADIENT, maImgLinear);
1225 break;
1226 case 3:
1227 mxBTNGradient->set_item_icon_name(SIDEBARGRADIENT, maImgAxial);
1228 break;
1229 case 4:
1230 mxBTNGradient->set_item_icon_name(SIDEBARGRADIENT, maImgRadial);
1231 break;
1232 case 5:
1233 mxBTNGradient->set_item_icon_name(SIDEBARGRADIENT, maImgElli);
1234 break;
1235 case 6:
1236 mxBTNGradient->set_item_icon_name(SIDEBARGRADIENT, maImgQuad);
1237 break;
1238 case 7:
1239 mxBTNGradient->set_item_icon_name(SIDEBARGRADIENT, maImgSquare);
1240 break;
1241 }
1242
1243 mxMTRTransparent->hide();
1244 mxSldTransparent->hide();
1245 mxBTNGradient->set_sensitive(true);
1246 bGradient = true;
1247 }
1248
1249 const XFillTransparenceItem aLinearItem(nTrans);
1250 setFillTransparence(aLinearItem);
1251
1252 if(nSelectType > 1)
1253 {
1254 nSelectType -= 2;
1255 }
1256
1257 XGradient aTmpGradient;
1258
1259 switch(static_cast<css::awt::GradientStyle>(nSelectType))
1260 {
1261 case css::awt::GradientStyle_LINEAR:
1262 aTmpGradient = maGradientLinear;
1263 break;
1264 case css::awt::GradientStyle_AXIAL:
1265 aTmpGradient = maGradientAxial;
1266 break;
1267 case css::awt::GradientStyle_RADIAL:
1268 aTmpGradient = maGradientRadial;
1269 break;
1270 case css::awt::GradientStyle_ELLIPTICAL:
1271 aTmpGradient = maGradientElliptical;
1272 break;
1273 case css::awt::GradientStyle_SQUARE:
1274 aTmpGradient = maGradientSquare;
1275 break;
1276 case css::awt::GradientStyle_RECT:
1277 aTmpGradient = maGradientRect;
1278 break;
1279 default:
1280 break;
1281 }
1282
1283 const XFillFloatTransparenceItem aGradientItem(aTmpGradient, bGradient);
1284 setFillFloatTransparence(aGradientItem);
1285}
1286
1288{
1289 const sal_uInt16 nTrans = static_cast<sal_uInt16>(mxMTRTransparent->get_value(FieldUnit::PERCENT));
1290 mnLastTransSolid = nTrans;
1291 SetTransparency(nTrans);
1292 const sal_Int32 nSelectType = mxLBTransType->get_active();
1293
1294 if(nTrans && !nSelectType)
1295 {
1296 mxLBTransType->set_active(1);
1297 }
1298
1299 const XFillTransparenceItem aLinearItem(nTrans);
1300 setFillTransparence(aLinearItem);
1301}
1302
1303const XGradient& AreaPropertyPanelBase::GetGradient (const css::awt::GradientStyle eStyle) const
1304{
1305 switch (eStyle)
1306 {
1307 default:
1308 case css::awt::GradientStyle_LINEAR:
1309 return maGradientLinear;
1310 case css::awt::GradientStyle_AXIAL:
1311 return maGradientAxial;
1312 case css::awt::GradientStyle_RADIAL:
1313 return maGradientRadial;
1314 case css::awt::GradientStyle_ELLIPTICAL:
1315 return maGradientElliptical;
1316 case css::awt::GradientStyle_SQUARE:
1317 return maGradientSquare;
1318 case css::awt::GradientStyle_RECT:
1319 return maGradientRect;
1320 }
1321}
1322
1324{
1325 switch (rGradient.GetGradientStyle())
1326 {
1327 case css::awt::GradientStyle_LINEAR:
1328 maGradientLinear = rGradient;
1329 break;
1330 case css::awt::GradientStyle_AXIAL:
1331 maGradientAxial = rGradient;
1332 break;
1333 case css::awt::GradientStyle_RADIAL:
1334 maGradientRadial = rGradient;
1335 break;
1336 case css::awt::GradientStyle_ELLIPTICAL:
1337 maGradientElliptical = rGradient;
1338 break;
1339 case css::awt::GradientStyle_SQUARE:
1340 maGradientSquare = rGradient;
1341 break;
1342 case css::awt::GradientStyle_RECT:
1343 maGradientRect = rGradient;
1344 break;
1345 default:
1346 break;
1347 }
1348}
1349
1351{
1352 return mxLBTransType->get_active();
1353}
1354
1355} // end of namespace svx::sidebar
1356
1357/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
constexpr OStringLiteral 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:1933
virtual XFillFloatTransparenceItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2607
virtual XFillGradientItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2289
virtual XFillHatchItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2729
virtual XFillStyleItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:1799
Item to enable slide background for filled objects.
const Color & GetEndColor() const
Definition: xgrad.hxx:70
css::awt::GradientStyle GetGradientStyle() const
Definition: xgrad.hxx:68
void SetBorder(sal_uInt16 nNewBorder)
Definition: xgrad.hxx:61
const Color & GetStartColor() const
Definition: xgrad.hxx:69
Degree10 GetAngle() const
Definition: xgrad.hxx:71
void SetStartColor(const Color &rColor)
Definition: xgrad.hxx:58
void SetGradientStyle(css::awt::GradientStyle eNewStyle)
Definition: xgrad.hxx:57
void SetXOffset(sal_uInt16 nNewOffset)
Definition: xgrad.hxx:62
void SetEndColor(const Color &rColor)
Definition: xgrad.hxx:59
void SetAngle(Degree10 nNewAngle)
Definition: xgrad.hxx:60
void SetYOffset(sal_uInt16 nNewOffset)
Definition: xgrad.hxx:63
const OUString & GetName() const
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
const XGradient & GetGradient(const css::awt::GradientStyle eStyle) const
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)
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 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
void SetGradient(const XGradient &rGradient)
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
#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
Count
IMPL_LINK_NOARG(AreaPropertyPanelBase, ToolbarHdl_Impl, const OString &, void)
long Long
Reference< XNameAccess > m_xContainer
SfxItemState
constexpr OUStringLiteral PATTERN