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 XBitmapListRef pList = SfxObjectShell::Current()->GetItem(SID_BITMAP_LIST)->GetBitmapList();
207 INetURLObject aURL( aDlg.GetPath() );
208 OUString aFileName = aURL.GetLastName().getToken(0, '.');
209 OUString aName = aFileName;
210 tools::Long j = 1;
211 bool bValidBitmapName = false;
212 while( !bValidBitmapName )
213 {
214 bValidBitmapName = true;
215 for( tools::Long i = 0; i < pList->Count() && bValidBitmapName; i++ )
216 {
217 if( aName == pList->GetBitmap(i)->GetName() )
218 {
219 bValidBitmapName = false;
220 aName = aFileName + OUString::number(j++);
221 }
222 }
223 }
224
225 pList->Insert(std::make_unique<XBitmapEntry>(aGraphic, aName));
226 pList->Save();
227 mxLbFillAttr->clear();
228 SvxFillAttrBox::Fill(*mxLbFillAttr, pList);
229 mxLbFillAttr->set_active_text(aName);
230 SelectFillAttrHdl(*mxLbFillAttr);
231}
232
234{
235 FillStyleChanged(true);
236}
237
239{
240 SelectFillAttrHdl_Impl();
241}
242
244{
245 SelectFillAttrHdl_Impl();
246}
247
249{
250 SelectFillAttrHdl_Impl();
251}
252
254{
255 sal_Int32 nPosFillStyle = static_cast<eFillStyle>(mxLbFillType->get_active());
257
258 // #i122676# dependent from bFillStyleChange, do execute a single or two
259 // changes in one Execute call
260 const bool bFillStyleChange(static_cast<eFillStyle>(meLastXFS) != static_cast<eFillStyle>(nPosFillStyle));
261
262 switch(nPosFillStyle)
263 {
264 case eFillStyle::NONE:
265 {
266 if(bFillStyleChange)
267 {
268 const XFillStyleItem aXFillStyleItem(drawing::FillStyle_NONE);
269 // Need to disable the XFillUseSlideBackgroundItem
270 const XFillUseSlideBackgroundItem aXFillUseSlideBackgroundItem(false);
271 setFillUseBackground(&aXFillStyleItem, aXFillUseSlideBackgroundItem);
272 }
273 break;
274 }
275 case eFillStyle::SOLID:
276 {
277 if(bFillStyleChange)
278 {
279 // #i122676# Single FillStyle change call needed here
280 XFillStyleItem aXFillStyleItem(drawing::FillStyle_SOLID);
281 setFillStyle(aXFillStyleItem);
282 }
283 break;
284 }
285 case eFillStyle::GRADIENT:
286 {
287
288 if(pSh && pSh->GetItem(SID_COLOR_TABLE))
289 {
290 XGradient aGradient;
291 aGradient.SetAngle(Degree10(mxMTRAngle->get_value(FieldUnit::DEGREE) * 10));
292 aGradient.SetGradientStyle(static_cast<css::awt::GradientStyle>(mxGradientStyle->get_active()));
293 aGradient.SetStartColor(mxLbFillGradFrom->GetSelectEntryColor());
294 aGradient.SetEndColor(mxLbFillGradTo->GetSelectEntryColor());
295
296 const XFillGradientItem aXFillGradientItem(mxLbFillAttr->get_active_text(), aGradient);
297
298 // #i122676# Change FillStyle and Gradient in one call
299 XFillStyleItem aXFillStyleItem(drawing::FillStyle_GRADIENT);
300 setFillStyleAndGradient(bFillStyleChange ? &aXFillStyleItem : nullptr, aXFillGradientItem);
301 }
302 break;
303 }
304 case eFillStyle::HATCH:
305 {
306 sal_Int32 nPos = mxLbFillAttr->get_active();
307
308 if (nPos == -1)
309 {
311 }
312
313 if (nPos != -1 && pSh && pSh->GetItem(SID_HATCH_LIST))
314 {
315 const SvxHatchListItem * pItem = pSh->GetItem(SID_HATCH_LIST);
316
317 if(nPos < pItem->GetHatchList()->Count())
318 {
319 const XHatch aHatch = pItem->GetHatchList()->GetHatch(nPos)->GetHatch();
320 const XFillHatchItem aXFillHatchItem( mxLbFillAttr->get_active_text(), aHatch);
321
322 // #i122676# Change FillStyle and Hatch in one call
323 XFillStyleItem aXFillStyleItem(drawing::FillStyle_HATCH);
324 setFillStyleAndHatch(bFillStyleChange ? &aXFillStyleItem : nullptr, aXFillHatchItem);
325 }
326 }
327
328 if (nPos != -1)
329 {
331 }
332 break;
333 }
334 case eFillStyle::BITMAP:
335 {
336 sal_Int32 nPos = mxLbFillAttr->get_active();
337
338 if (nPos == -1)
339 {
341 }
342
343 if (nPos != -1 && pSh && pSh->GetItem(SID_BITMAP_LIST))
344 {
345 const SvxBitmapListItem * pItem = pSh->GetItem(SID_BITMAP_LIST);
346
347 if(nPos < pItem->GetBitmapList()->Count())
348 {
349 const XBitmapEntry* pXBitmapEntry = pItem->GetBitmapList()->GetBitmap(nPos);
350 const XFillBitmapItem aXFillBitmapItem(mxLbFillAttr->get_active_text(), pXBitmapEntry->GetGraphicObject());
351
352 // #i122676# Change FillStyle and Bitmap in one call
353 XFillStyleItem aXFillStyleItem(drawing::FillStyle_BITMAP);
354 setFillStyleAndBitmap(bFillStyleChange ? &aXFillStyleItem : nullptr, aXFillBitmapItem);
355 }
356 }
357
358 if (nPos != -1)
359 {
361 }
362 break;
363 }
364 case eFillStyle::PATTERN:
365 {
366 sal_Int32 nPos = mxLbFillAttr->get_active();
367
368 if (nPos == -1)
369 {
371 }
372
373 if (nPos != -1 && pSh && pSh->GetItem(SID_PATTERN_LIST))
374 {
375 const SvxPatternListItem * pItem = pSh->GetItem(SID_PATTERN_LIST);
376
377 if(nPos < pItem->GetPatternList()->Count())
378 {
379 const XBitmapEntry* pXPatternEntry = pItem->GetPatternList()->GetBitmap(nPos);
380 const XFillBitmapItem aXFillBitmapItem(mxLbFillAttr->get_active_text(), pXPatternEntry->GetGraphicObject());
381
382 // #i122676# Change FillStyle and Bitmap in one call
383 XFillStyleItem aXFillStyleItem(drawing::FillStyle_BITMAP);
384 setFillStyleAndBitmap(bFillStyleChange ? &aXFillStyleItem : nullptr, aXFillBitmapItem);
385 }
386 }
387
388 if (nPos != -1)
389 {
391 }
392 break;
393 }
394 }
397}
398
400{
401 sal_Int32 nPos = static_cast<eFillStyle>(mxLbFillType->get_active());
402 mxLbFillAttr->clear();
404 if (!pSh)
405 return;
406
407 bool bShowLbFillAttr = false;
408 bool bShowLbFillGradFrom = false;
409 bool bShowLbFillGradTo = false;
410 bool bShowGradientStyle = false;
411 bool bShowMTRAngle = false;
412 bool bShowToolBoxColor = false;
413 bool bShowBmpImport = false;
414 // Transparency widgets are shown by default
415 bool bShowLBTransType = true;
416 bool bShowTrspTextFT = true;
417 bool bShowMTRTransparent = true;
418 bool bShowSldTransparent = true;
419
420 // #i122676# Do no longer trigger two Execute calls, one for SID_ATTR_FILL_STYLE
421 // and one for setting the fill attribute itself, but add two SfxPoolItems to the
422 // call to get just one action at the SdrObject and to create only one Undo action, too.
423 // Checked that this works in all apps.
424 switch (nPos)
425 {
426 default:
427 case NONE:
428 {
429 if (bUpdateModel)
430 {
431 const XFillStyleItem aXFillStyleItem(drawing::FillStyle_NONE);
432 // Need to disable the XFillUseSlideBackgroundItem
433 const XFillUseSlideBackgroundItem aXFillUseSlideBackgroundItem(false);
434 setFillUseBackground(&aXFillStyleItem, aXFillUseSlideBackgroundItem);
435 }
436
437 break;
438 }
439 case SOLID:
440 {
441 bShowToolBoxColor = true;
442
443 if (bUpdateModel)
444 {
445 const Color aColor = mpColorItem ? mpColorItem->GetColorValue() : COL_AUTO;
446 const XFillColorItem aXFillColorItem("", aColor);
447
448 // #i122676# change FillStyle and Color in one call
449 XFillStyleItem aXFillStyleItem(drawing::FillStyle_SOLID);
450 setFillStyleAndColor(&aXFillStyleItem, aXFillColorItem);
451 }
452 break;
453 }
454 case GRADIENT:
455 {
456 bShowLbFillGradFrom = true;
457 bShowLbFillGradTo = true;
458 bShowGradientStyle = true;
459 bShowMTRAngle = true;
460
461 mxLbFillAttr->set_sensitive(true);
462 mxLbFillGradTo->set_sensitive(true);
463 mxLbFillGradFrom->set_sensitive(true);
464 mxGradientStyle->set_sensitive(true);
465 mxMTRAngle->set_sensitive(true);
466 mxLbFillAttr->clear();
467
468 if (bUpdateModel)
469 {
470 mxLbFillAttr->hide();
471 mxToolBoxColor->hide();
472 mxBmpImport->hide();
473
474 const SvxGradientListItem* pItem = pSh->GetItem(SID_GRADIENT_LIST);
475 if (pItem->GetGradientList()->Count() > 0)
476 {
477 const XGradient aGradient
478 = pItem->GetGradientList()->GetGradient(0)->GetGradient();
479 const OUString aName = pItem->GetGradientList()->GetGradient(0)->GetName();
480 const XFillGradientItem aXFillGradientItem(aName, aGradient);
481
482 // #i122676# change FillStyle and Gradient in one call
483 XFillStyleItem aXFillStyleItem(drawing::FillStyle_GRADIENT);
484 setFillStyleAndGradient(&aXFillStyleItem, aXFillGradientItem);
485 mxLbFillGradFrom->SelectEntry(aGradient.GetStartColor());
486 mxLbFillGradTo->SelectEntry(aGradient.GetEndColor());
487
488 mxMTRAngle->set_value(toDegrees(aGradient.GetAngle()), FieldUnit::DEGREE);
489 css::awt::GradientStyle eXGS = aGradient.GetGradientStyle();
490 mxGradientStyle->set_active(sal::static_int_cast<sal_Int32>(eXGS));
491 }
492 }
493 else
494 {
495 if (pSh && pSh->GetItem(SID_GRADIENT_LIST))
496 {
498 pSh->GetItem(SID_GRADIENT_LIST)->GetGradientList());
499 mxLbFillGradTo->SetNoSelection();
500 mxLbFillGradFrom->SetNoSelection();
502 {
503 const OUString aString(mpFillGradientItem->GetName());
504 mxLbFillAttr->set_active_text(aString);
505 const XGradient aGradient = mpFillGradientItem->GetGradientValue();
506 mxLbFillGradFrom->SelectEntry(aGradient.GetStartColor());
507 mxLbFillGradTo->SelectEntry(aGradient.GetEndColor());
508 mxGradientStyle->set_active(
509 sal::static_int_cast<sal_Int32>(aGradient.GetGradientStyle()));
510 if (mxGradientStyle->get_active() == sal_Int32(GradientStyle::Radial))
511 mxMTRAngle->set_sensitive(false);
512 else
513 mxMTRAngle->set_value(toDegrees(aGradient.GetAngle()),
514 FieldUnit::DEGREE);
515 }
516 else
517 {
518 mxLbFillAttr->set_active(-1);
519 }
520 }
521 else
522 {
523 mxLbFillAttr->set_active(-1);
524 }
525 }
526 break;
527 }
528 case HATCH:
529 {
530 bShowLbFillAttr = true;
531
532 const SvxHatchListItem* pItem(pSh->GetItem(SID_HATCH_LIST));
533 if (pItem)
534 {
535 const XHatchListRef& pXHatchList(pItem->GetHatchList());
536 mxLbFillAttr->set_sensitive(true);
537 mxLbFillAttr->clear();
538 SvxFillAttrBox::Fill(*mxLbFillAttr, pXHatchList);
539
540 if (mnLastPosHatch != -1)
541 {
542 if (mnLastPosHatch < pXHatchList->Count())
543 {
544 const XHatch aHatch = pXHatchList->GetHatch(mnLastPosHatch)->GetHatch();
545 const OUString aName = pXHatchList->GetHatch(mnLastPosHatch)->GetName();
546 const XFillHatchItem aXFillHatchItem(aName, aHatch);
547
548 // #i122676# change FillStyle and Hatch in one call
549 if (bUpdateModel)
550 {
551 XFillStyleItem aXFillStyleItem(drawing::FillStyle_HATCH);
552 setFillStyleAndHatch(&aXFillStyleItem, aXFillHatchItem);
553 }
554 mxLbFillAttr->set_active(mnLastPosHatch);
555 }
556 }
557 }
558 else
559 {
560 mxLbFillAttr->set_sensitive(false);
561 }
562 break;
563 }
564 case BITMAP:
565 case PATTERN:
566 {
567 bShowLbFillAttr = true;
568 mxLbFillAttr->set_sensitive(true);
569 mxLbFillAttr->clear();
570
571 OUString aName;
572 GraphicObject aBitmap;
573 if (nPos == static_cast<sal_Int32>(BITMAP))
574 {
576 bShowBmpImport = true;
577 const SvxBitmapListItem* pItem = pSh->GetItem(SID_BITMAP_LIST);
578 if (pItem)
579 {
580 const XBitmapListRef& pXBitmapList(pItem->GetBitmapList());
581 SvxFillAttrBox::Fill(*mxLbFillAttr, pXBitmapList);
582
583 if (mnLastPosBitmap != -1)
584 {
585 if (mnLastPosBitmap < pXBitmapList->Count())
586 {
587 const XBitmapEntry* pXBitmapEntry
588 = pXBitmapList->GetBitmap(mnLastPosBitmap);
589 aBitmap = pXBitmapEntry->GetGraphicObject();
590 aName = pXBitmapEntry->GetName();
591 mxLbFillAttr->set_active(mnLastPosBitmap);
592 }
593 }
594 }
595 else
596 {
597 bShowBmpImport = false;
598 }
599 }
600 else if (nPos == static_cast<sal_Int32>(PATTERN))
601 {
602 const SvxPatternListItem* pItem = pSh->GetItem(SID_PATTERN_LIST);
603 if (pItem)
604 {
605 const XPatternListRef& pXPatternList(pItem->GetPatternList());
606 SvxFillAttrBox::Fill(*mxLbFillAttr, pXPatternList);
607
608 if (mnLastPosPattern != -1)
609 {
610 if (mnLastPosPattern < pXPatternList->Count())
611 {
612 const XBitmapEntry* pXPatternEntry
613 = pXPatternList->GetBitmap(mnLastPosPattern);
614 aBitmap = pXPatternEntry->GetGraphicObject();
615 aName = pXPatternEntry->GetName();
616 mxLbFillAttr->set_active(mnLastPosPattern);
617 }
618 }
619 }
620 else
621 {
622 bShowLbFillAttr = false;
623 }
624 }
625 if (bUpdateModel)
626 {
627 const XFillBitmapItem aXFillBitmapItem(aName, aBitmap);
628 const XFillStyleItem aXFillStyleItem(drawing::FillStyle_BITMAP);
629 setFillStyleAndBitmap(&aXFillStyleItem, aXFillBitmapItem);
630 }
631 break;
632 }
633 case USE_BACKGROUND:
634 {
635 bShowLBTransType = false;
636 bShowTrspTextFT = false;
637 bShowMTRTransparent = false;
638 bShowSldTransparent = false;
639 if (bUpdateModel)
640 {
641 const XFillStyleItem aXFillStyleItem(drawing::FillStyle_NONE);
642 const XFillUseSlideBackgroundItem aXFillUseSlideBackgroundItem(true);
643 setFillUseBackground(&aXFillStyleItem, aXFillUseSlideBackgroundItem);
644 break;
645 }
646 }
647 }
648
649 mxLbFillAttr->set_visible(bShowLbFillAttr);
650 mxLbFillGradFrom->set_visible(bShowLbFillGradFrom);
651 mxLbFillGradTo->set_visible(bShowLbFillGradTo);
652 mxGradientStyle->set_visible(bShowGradientStyle);
653 mxMTRAngle->set_visible(bShowMTRAngle);
654 mxToolBoxColor->set_visible(bShowToolBoxColor);
655 mxBmpImport->set_visible(bShowBmpImport);
656 mxLBTransType->set_visible(bShowLBTransType);
657 mxTrspTextFT->set_visible(bShowTrspTextFT);
658 mxMTRTransparent->set_visible(bShowMTRTransparent);
659 mxSldTransparent->set_visible(bShowSldTransparent);
660
661 meLastXFS = static_cast<sal_uInt16>(nPos);
662
665}
666
668{
670 {
671 bool bZeroValue(false);
672
674 {
675 const sal_uInt16 nValue(mpTransparenceItem->GetValue());
676
677 if(!nValue)
678 {
679 bZeroValue = true;
680 }
681 else if(nValue <= 100)
682 {
683 mxLBTransType->set_sensitive(true);
684 mxTrspTextFT->set_sensitive(true);
685 mxLBTransType->set_active(1);
686 mxBTNGradient->hide();
687 mxMTRTransparent->show();
688 mxSldTransparent->show();
689 mxMTRTransparent->set_sensitive(true);
690 mxSldTransparent->set_sensitive(true);
692 }
693
694 if (!bZeroValue && mxTrGrPopup)
695 {
696 mxBTNGradient->set_menu_item_active(SIDEBARGRADIENT, false);
697 }
698 }
699
700 if(bZeroValue && mpFloatTransparenceItem)
701 {
702 if(mpFloatTransparenceItem->IsEnabled())
703 {
704 const XGradient& rGradient = mpFloatTransparenceItem->GetGradientValue();
705 sal_Int32 nEntryPos(0);
706 OUString* pImage = nullptr;
707
708 mxLBTransType->set_sensitive(true);
709 mxTrspTextFT->set_sensitive(true);
710 mxMTRTransparent->hide();
711 mxSldTransparent->hide();
712 mxBTNGradient->set_sensitive(true);
713 mxBTNGradient->show();
714
715 switch(rGradient.GetGradientStyle())
716 {
717 default:
718 case css::awt::GradientStyle_LINEAR:
719 {
720 nEntryPos = 2;
721 pImage = &maImgLinear;
722 break;
723 }
724 case css::awt::GradientStyle_AXIAL:
725 {
726 nEntryPos = 3;
727 pImage = &maImgAxial;
728 break;
729 }
730 case css::awt::GradientStyle_RADIAL:
731 {
732 nEntryPos = 4;
733 pImage = &maImgRadial;
734 break;
735 }
736 case css::awt::GradientStyle_ELLIPTICAL:
737 {
738 nEntryPos = 5;
739 pImage = &maImgElli;
740 break;
741 }
742 case css::awt::GradientStyle_SQUARE:
743 {
744 nEntryPos = 6;
745 pImage = &maImgQuad;
746 break;
747 }
748 case css::awt::GradientStyle_RECT:
749 {
750 nEntryPos = 7;
751 pImage = &maImgSquare;
752 break;
753 }
754 }
755 mxLBTransType->set_active(nEntryPos);
756 mxBTNGradient->set_item_icon_name(SIDEBARGRADIENT, *pImage);
757 mxTrGrPopup->Rearrange(mpFloatTransparenceItem.get());
758 bZeroValue = false;
759 }
760 else
761 {
762 bZeroValue = true;
763 }
764 }
765
766 if(bZeroValue)
767 {
768 mxLBTransType->set_sensitive(true);
769 mxTrspTextFT->set_sensitive(true);
770 mxLBTransType->set_active(0);
771 mxBTNGradient->hide();
772 mxMTRTransparent->set_sensitive(true);
773 mxSldTransparent->set_sensitive(true);
774 mxMTRTransparent->show();
775 mxSldTransparent->show();
777 }
778 }
779 else
780 {
781 // no transparency at all
782 mxLBTransType->set_active(-1);
783 mxLBTransType->set_sensitive(false);
784 mxTrspTextFT->set_sensitive(false);
785 mxMTRTransparent->set_sensitive(false);
786 mxSldTransparent->set_sensitive(false);
787 mxMTRTransparent->show();
788 mxSldTransparent->show();
789 mxBTNGradient->set_sensitive(false);
790 mxBTNGradient->hide();
791 }
792}
793
794void AreaPropertyPanelBase::updateFillTransparence(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState)
795{
796 if (bDisabled)
797 {
798 mpTransparenceItem.reset();
799 return;
800 }
801 else if (bDefaultOrSet)
802 {
803 if (pState)
804 {
805 const SfxUInt16Item* pItem = static_cast<const SfxUInt16Item*>(pState);
806 mpTransparenceItem.reset(pItem->Clone());
807 }
808 else
809 {
810 mpTransparenceItem.reset();
811 }
812 }
813 else
814 {
815 mpTransparenceItem.reset();
816 }
817
818 // update transparency settings dependent of mpTransparenceItem and mpFloatTransparenceItem
820}
821
822void AreaPropertyPanelBase::updateFillFloatTransparence(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState)
823{
824 if (bDisabled)
825 {
827 return;
828 }
829
830 if (bDefaultOrSet)
831 {
832 if (pState)
833 {
834 const XFillFloatTransparenceItem* pItem = static_cast<const XFillFloatTransparenceItem*>(pState);
835 mpFloatTransparenceItem.reset(pItem->Clone());
836 }
837 else
838 {
840 }
841 }
842 else
843 {
845 }
846
847 // update transparency settings dependent of mpTransparenceItem and mpFloatTransparenceItem
849}
850
851void AreaPropertyPanelBase::updateFillStyle(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState)
852{
853 if(bDisabled)
854 {
855 mxLbFillType->set_sensitive(false);
856 mxColorTextFT->set_sensitive(false);
857 mxLbFillType->set_active(-1);
858 mxLbFillAttr->show();
859 mxLbFillAttr->set_sensitive(false);
860 mxLbFillAttr->set_active(-1);
861 mxToolBoxColor->hide();
862 meLastXFS = static_cast<sal_uInt16>(-1);
863 mpStyleItem.reset();
864 }
865 else if (bDefaultOrSet && pState)
866 {
867 const XFillStyleItem* pItem = static_cast<const XFillStyleItem*>(pState);
868 mpStyleItem.reset(pItem->Clone());
869 mxLbFillType->set_sensitive(true);
870 mxColorTextFT->set_sensitive(true);
871 drawing::FillStyle eXFS = mpStyleItem->GetValue();
872 eFillStyle nPos = NONE;
873 switch(eXFS)
874 {
875 default:
876 case drawing::FillStyle_NONE:
877 {
878 mxLbFillAttr->set_active(-1);
879 mxLbFillAttr->set_sensitive(false);
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
1108 mxLbFillAttr->clear();
1109 mxLbFillAttr->set_sensitive(true);
1110 SvxFillAttrBox::Fill(*mxLbFillAttr, pSh->GetItem(SID_GRADIENT_LIST)->GetGradientList());
1111 mxLbFillAttr->set_active_text(aString);
1112 }
1113 else
1114 {
1115 mxLbFillAttr->set_active(-1);
1116 }
1117 }
1118 }
1119 break;
1120 }
1121 case SID_HATCH_LIST:
1122 {
1123 if(bDefault)
1124 {
1125 if(mpStyleItem && drawing::FillStyle_HATCH == mpStyleItem->GetValue())
1126 {
1127 if(mpHatchItem)
1128 {
1129 const OUString aString( mpHatchItem->GetName() );
1131
1132 mxLbFillAttr->clear();
1133 mxLbFillAttr->set_sensitive(true);
1134 SvxFillAttrBox::Fill(*mxLbFillAttr, pSh->GetItem(SID_HATCH_LIST)->GetHatchList());
1135 mxLbFillAttr->set_active_text(aString);
1136 }
1137 else
1138 {
1139 mxLbFillAttr->set_active(-1);
1140 }
1141 }
1142 }
1143 break;
1144 }
1145 case SID_BITMAP_LIST:
1146 case SID_PATTERN_LIST:
1147 {
1148 if(bDefault)
1149 {
1150 if(mpStyleItem && drawing::FillStyle_BITMAP == mpStyleItem->GetValue())
1151 {
1152 if(mpBitmapItem)
1153 {
1154 const OUString aString( mpBitmapItem->GetName() );
1156 mxLbFillAttr->clear();
1157 mxLbFillAttr->show();
1158 if(nSID == SID_BITMAP_LIST)
1159 {
1160 SvxFillAttrBox::Fill(*mxLbFillAttr, pSh->GetItem(SID_BITMAP_LIST)->GetBitmapList());
1161 }
1162 else if(nSID == SID_PATTERN_LIST)
1163 {
1164 SvxFillAttrBox::Fill(*mxLbFillAttr, pSh->GetItem(SID_PATTERN_LIST)->GetPatternList());
1165 }
1166 mxLbFillAttr->set_active_text(aString);
1167 }
1168 else
1169 {
1170 mxLbFillAttr->set_active(-1);
1171 }
1172 }
1173 }
1174 break;
1175 }
1176 }
1177 FillStyleChanged(false);
1178}
1179
1181{
1182 const sal_uInt16 nVal = mxSldTransparent->get_value();
1183 SetTransparency(nVal);
1184 const XFillTransparenceItem aLinearItem(nVal);
1185 setFillTransparence(aLinearItem);
1186}
1187
1189{
1190 sal_Int32 nSelectType = mxLBTransType->get_active();
1191 bool bGradient = false;
1192 sal_uInt16 nTrans = 0;
1193
1194 if(!nSelectType)
1195 {
1196 mxBTNGradient->hide();
1197 mxMTRTransparent->show();
1198 mxSldTransparent->show();
1199 mxMTRTransparent->set_sensitive(true);
1200 mxSldTransparent->set_sensitive(true);
1201 SetTransparency(0);
1202 }
1203 else if(1 == nSelectType)
1204 {
1205 mxBTNGradient->hide();
1206 mxMTRTransparent->show();
1207 mxSldTransparent->show();
1208 nTrans = mnLastTransSolid;
1209 mxMTRTransparent->set_value(nTrans, FieldUnit::PERCENT);
1210 mxLBTransType->set_active(1);
1211 mxMTRTransparent->set_sensitive(true);
1212 mxSldTransparent->set_sensitive(true);
1213 }
1214 else
1215 {
1216 mxBTNGradient->show();
1217
1218 switch (nSelectType)
1219 {
1220 case 2:
1221 mxBTNGradient->set_item_icon_name(SIDEBARGRADIENT, maImgLinear);
1222 break;
1223 case 3:
1224 mxBTNGradient->set_item_icon_name(SIDEBARGRADIENT, maImgAxial);
1225 break;
1226 case 4:
1227 mxBTNGradient->set_item_icon_name(SIDEBARGRADIENT, maImgRadial);
1228 break;
1229 case 5:
1230 mxBTNGradient->set_item_icon_name(SIDEBARGRADIENT, maImgElli);
1231 break;
1232 case 6:
1233 mxBTNGradient->set_item_icon_name(SIDEBARGRADIENT, maImgQuad);
1234 break;
1235 case 7:
1236 mxBTNGradient->set_item_icon_name(SIDEBARGRADIENT, maImgSquare);
1237 break;
1238 }
1239
1240 mxMTRTransparent->hide();
1241 mxSldTransparent->hide();
1242 mxBTNGradient->set_sensitive(true);
1243 bGradient = true;
1244 }
1245
1246 const XFillTransparenceItem aLinearItem(nTrans);
1247 setFillTransparence(aLinearItem);
1248
1249 if(nSelectType > 1)
1250 {
1251 nSelectType -= 2;
1252 }
1253
1254 XGradient aTmpGradient;
1255
1256 switch(static_cast<css::awt::GradientStyle>(nSelectType))
1257 {
1258 case css::awt::GradientStyle_LINEAR:
1259 aTmpGradient = maGradientLinear;
1260 break;
1261 case css::awt::GradientStyle_AXIAL:
1262 aTmpGradient = maGradientAxial;
1263 break;
1264 case css::awt::GradientStyle_RADIAL:
1265 aTmpGradient = maGradientRadial;
1266 break;
1267 case css::awt::GradientStyle_ELLIPTICAL:
1268 aTmpGradient = maGradientElliptical;
1269 break;
1270 case css::awt::GradientStyle_SQUARE:
1271 aTmpGradient = maGradientSquare;
1272 break;
1273 case css::awt::GradientStyle_RECT:
1274 aTmpGradient = maGradientRect;
1275 break;
1276 default:
1277 break;
1278 }
1279
1280 const XFillFloatTransparenceItem aGradientItem(aTmpGradient, bGradient);
1281 setFillFloatTransparence(aGradientItem);
1282}
1283
1285{
1286 const sal_uInt16 nTrans = static_cast<sal_uInt16>(mxMTRTransparent->get_value(FieldUnit::PERCENT));
1287 mnLastTransSolid = nTrans;
1288 SetTransparency(nTrans);
1289 const sal_Int32 nSelectType = mxLBTransType->get_active();
1290
1291 if(nTrans && !nSelectType)
1292 {
1293 mxLBTransType->set_active(1);
1294 }
1295
1296 const XFillTransparenceItem aLinearItem(nTrans);
1297 setFillTransparence(aLinearItem);
1298}
1299
1300const XGradient& AreaPropertyPanelBase::GetGradient (const css::awt::GradientStyle eStyle) const
1301{
1302 switch (eStyle)
1303 {
1304 default:
1305 case css::awt::GradientStyle_LINEAR:
1306 return maGradientLinear;
1307 case css::awt::GradientStyle_AXIAL:
1308 return maGradientAxial;
1309 case css::awt::GradientStyle_RADIAL:
1310 return maGradientRadial;
1311 case css::awt::GradientStyle_ELLIPTICAL:
1312 return maGradientElliptical;
1313 case css::awt::GradientStyle_SQUARE:
1314 return maGradientSquare;
1315 case css::awt::GradientStyle_RECT:
1316 return maGradientRect;
1317 }
1318}
1319
1321{
1322 switch (rGradient.GetGradientStyle())
1323 {
1324 case css::awt::GradientStyle_LINEAR:
1325 maGradientLinear = rGradient;
1326 break;
1327 case css::awt::GradientStyle_AXIAL:
1328 maGradientAxial = rGradient;
1329 break;
1330 case css::awt::GradientStyle_RADIAL:
1331 maGradientRadial = rGradient;
1332 break;
1333 case css::awt::GradientStyle_ELLIPTICAL:
1334 maGradientElliptical = rGradient;
1335 break;
1336 case css::awt::GradientStyle_SQUARE:
1337 maGradientSquare = rGradient;
1338 break;
1339 case css::awt::GradientStyle_RECT:
1340 maGradientRect = rGradient;
1341 break;
1342 default:
1343 break;
1344 }
1345}
1346
1348{
1349 return mxLBTransType->get_active();
1350}
1351
1352} // end of namespace svx::sidebar
1353
1354/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
constexpr OStringLiteral SIDEBARGRADIENT
sfx2::sidebar::Panel * m_pPanel
virtual weld::Window * GetFrameWeld() const
bool GetValue() const
static 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:1887
virtual XFillFloatTransparenceItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2533
virtual XFillGradientItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2215
virtual XFillHatchItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2655
virtual XFillStyleItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:1753
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