LibreOffice Module sd (master) 1
SlideBackground.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 <com/sun/star/ui/XDeck.hpp>
21#include <com/sun/star/ui/XPanel.hpp>
22#include <com/sun/star/frame/XController2.hpp>
23#include <SlideSorter.hxx>
27#include "SlideBackground.hxx"
28#include <sdresid.hxx>
29#include <ViewShellBase.hxx>
30#include <FrameView.hxx>
31#include <DrawDocShell.hxx>
32#include <drawdoc.hxx>
33#include <sdpage.hxx>
34#include "PageMarginUtils.hxx"
35#include <strings.hrc>
36#include <pageformatpanel.hrc>
37#include <DrawViewShell.hxx>
38#include <svl/intitem.hxx>
39#include <svx/colorbox.hxx>
40#include <svx/dlgutil.hxx>
41#include <svx/drawitem.hxx>
42#include <svx/itemwin.hxx>
43#include <svx/pageitem.hxx>
44#include <app.hrc>
45#include <editeng/paperinf.hxx>
46#include <svx/xflgrit.hxx>
47#include <svx/rulritem.hxx>
48#include <svx/svxids.hrc>
49#include <svx/xfillit0.hxx>
50#include <svx/xflclit.hxx>
51#include <svx/xbtmpit.hxx>
52#include <svx/xflhtit.hxx>
53#include <svx/svdpage.hxx>
54#include <sfx2/bindings.hxx>
55#include <sfx2/dispatch.hxx>
57#include <EventMultiplexer.hxx>
59#include <utility>
60#include <vcl/EnumContext.hxx>
61#include <vcl/svapp.hxx>
62
63#include <editeng/sizeitem.hxx>
64#include <comphelper/lok.hxx>
65#include <unomodel.hxx>
66#include <sfx2/lokhelper.hxx>
67
68using namespace ::com::sun::star;
69
70using ::com::sun::star::uno::Reference;
71
72namespace sd::sidebar {
73
74namespace {
75
76enum eFillStyle
77{
78 NONE,
79 SOLID,
81 HATCH,
82 BITMAP,
84};
85
86}
87
89 weld::Widget* pParent,
90 ViewShellBase& rBase,
91 css::uno::Reference<css::frame::XFrame> xFrame,
92 SfxBindings* pBindings) :
93 PanelLayout( pParent, "SlideBackgroundPanel", "modules/simpress/ui/sidebarslidebackground.ui" ),
94 mrBase( rBase ),
95 mxPaperSizeBox(new SvxPaperSizeListBox(m_xBuilder->weld_combo_box("paperformat"))),
96 mxPaperOrientation(m_xBuilder->weld_combo_box("orientation")),
97 mxMasterSlide(m_xBuilder->weld_combo_box("masterslide")),
98 mxBackgroundLabel(m_xBuilder->weld_label("label3")),
99 mxFillStyle(m_xBuilder->weld_combo_box("fillstyle")),
100 mxFillLB(new ColorListBox(m_xBuilder->weld_menu_button("fillattr"), [this]{ return GetFrameWeld(); })),
101 mxFillAttr(m_xBuilder->weld_combo_box("fillattr1")),
102 mxFillGrad1(new ColorListBox(m_xBuilder->weld_menu_button("fillattr2"), [this]{ return GetFrameWeld(); })),
103 mxFillGrad2(new ColorListBox(m_xBuilder->weld_menu_button("fillattr3"), [this]{ return GetFrameWeld(); })),
104 mxInsertImage(m_xBuilder->weld_button("button2")),
105 mxDspMasterBackground(m_xBuilder->weld_check_button("displaymasterbackground")),
106 mxDspMasterObjects(m_xBuilder->weld_check_button("displaymasterobjects")),
107 mxCloseMaster(m_xBuilder->weld_button("closemasterslide")),
108 mxEditMaster(m_xBuilder->weld_button("masterslidebutton")),
109 mxMasterLabel(m_xBuilder->weld_label("masterlabel")),
110 mxMarginSelectBox(m_xBuilder->weld_combo_box("marginLB")),
111 mxCustomEntry(m_xBuilder->weld_label("customlabel")),
112 mxMarginLabel(m_xBuilder->weld_label("labelmargin")),
113 maPaperSizeController(SID_ATTR_PAGE_SIZE, *pBindings, *this),
114 maPaperOrientationController(SID_ATTR_PAGE, *pBindings, *this),
115 maPaperMarginLRController(SID_ATTR_PAGE_LRSPACE, *pBindings, *this),
116 maPaperMarginULController(SID_ATTR_PAGE_ULSPACE, *pBindings, *this),
117 maBckColorController(SID_ATTR_PAGE_COLOR, *pBindings, *this),
118 maBckGradientController(SID_ATTR_PAGE_GRADIENT, *pBindings, *this),
119 maBckHatchController(SID_ATTR_PAGE_HATCH, *pBindings, *this),
120 maBckBitmapController(SID_ATTR_PAGE_BITMAP, *pBindings, *this),
121 maBckFillStyleController(SID_ATTR_PAGE_FILLSTYLE, *pBindings, *this),
122 maBckImageController(SID_SELECT_BACKGROUND, *pBindings, *this),
123 maDspBckController(SID_DISPLAY_MASTER_BACKGROUND, *pBindings, *this),
124 maDspObjController(SID_DISPLAY_MASTER_OBJECTS, *pBindings, *this),
125 maMetricController(SID_ATTR_METRIC, *pBindings, *this),
126 maCloseMasterController(SID_CLOSE_MASTER_VIEW, *pBindings, *this),
127 mpPageItem( new SvxPageItem(SID_ATTR_PAGE) ),
128 mbSwitchModeToNormal(false),
129 mbSwitchModeToMaster(false),
130 mxFrame(std::move(xFrame)),
137 mbTitle(false),
138 mpPageLRMarginItem( new SvxLongLRSpaceItem( 0, 0, SID_ATTR_PAGE_LRSPACE ) ),
139 mpPageULMarginItem( new SvxLongULSpaceItem( 0, 0, SID_ATTR_PAGE_ULSPACE ) ),
140 m_nPageLeftMargin(0),
141 m_nPageRightMargin(0),
142 m_nPageTopMargin(0),
143 m_nPageBottomMargin(0),
144 meFUnit(GetModuleFieldUnit()),
145 mpBindings(pBindings)
146{
147 //let the listbox shrink to any size so the sidebar isn't forced to grow to
148 //the size of the longest master slide name in the document
149 mxMasterSlide->set_size_request(42, -1);
150
151 maCustomEntry = mxCustomEntry->get_label();
152
153 addListener();
154 Initialize();
155}
156
158{
159 return ( maContext == maDrawMasterContext ||
161}
162
164{
165 return ( maContext == maImpressMasterContext ||
169}
170
172{
173 FieldUnit eUnit;
174
175 if (pState && eState >= SfxItemState::DEFAULT)
176 eUnit = static_cast<FieldUnit>(static_cast<const SfxUInt16Item*>(pState)->GetValue());
177 else
178 eUnit = GetModuleFieldUnit();
179
180 return eUnit;
181}
182
184{
185 auto nSelected = mxMarginSelectBox->get_active();
186 mxMarginSelectBox->clear();
187
189
190 if (IsInch(meFUnit))
191 {
192 OUString sSuffix = weld::MetricSpinButton::MetricToString(FieldUnit::INCH);
193 for (size_t i = 0; i < SAL_N_ELEMENTS(RID_PAGEFORMATPANEL_MARGINS_INCH); ++i)
194 {
195 OUString sMeasurement = rLocaleData.getNum(RID_PAGEFORMATPANEL_MARGINS_INCH[i].second, 2, true, false) + sSuffix;
196 mxMarginSelectBox->append_text(SdResId(RID_PAGEFORMATPANEL_MARGINS_INCH[i].first).replaceFirst("%1", sMeasurement));
197 }
198 }
199 else
200 {
201 OUString sSuffix = " " + weld::MetricSpinButton::MetricToString(FieldUnit::CM);
202 for (size_t i = 0; i < SAL_N_ELEMENTS(RID_PAGEFORMATPANEL_MARGINS_CM); ++i)
203 {
204 OUString sMeasurement = rLocaleData.getNum(RID_PAGEFORMATPANEL_MARGINS_CM[i].second, 2, true, false) + sSuffix;
205 mxMarginSelectBox->append_text(SdResId(RID_PAGEFORMATPANEL_MARGINS_CM[i].first).replaceFirst("%1", sMeasurement));
206 }
207 }
208
209 mxMarginSelectBox->set_active(nSelected);
210}
211
213{
215
217
218 mxPaperSizeBox->FillPaperSizeEntries( PaperSizeApp::Draw );
219 mxPaperSizeBox->connect_changed(LINK(this,SlideBackground,PaperSizeModifyHdl));
220 mxPaperOrientation->connect_changed(LINK(this,SlideBackground,PaperSizeModifyHdl));
221 mxEditMaster->connect_clicked(LINK(this, SlideBackground, EditMasterHdl));
222 mxCloseMaster->connect_clicked(LINK(this, SlideBackground, CloseMasterHdl));
223 mxInsertImage->connect_clicked(LINK(this, SlideBackground, SelectBgHdl));
225
226 mxMasterSlide->connect_changed(LINK(this, SlideBackground, AssignMasterPage));
227
228 mxFillStyle->connect_changed(LINK(this, SlideBackground, FillStyleModifyHdl));
229 mxFillLB->SetSelectHdl(LINK(this, SlideBackground, FillColorHdl));
230 mxFillGrad1->SetSelectHdl(LINK(this, SlideBackground, FillColorHdl));
231 mxFillGrad2->SetSelectHdl(LINK(this, SlideBackground, FillColorHdl));
232 mxFillAttr->connect_changed(LINK(this, SlideBackground, FillBackgroundHdl));
233
234 ViewShell* pMainViewShell = mrBase.GetMainViewShell().get();
235 if (pMainViewShell)
236 {
237 FrameView *pFrameView = pMainViewShell->GetFrameView();
238
239 if ( pFrameView->GetViewShEditMode() == EditMode::Page )
240 {
241 SdPage* mpPage = pMainViewShell->getCurrentPage();
243
244 OUString aLayoutName( mpPage->GetLayoutName() );
245 aLayoutName = aLayoutName.copy(0,aLayoutName.indexOf(SD_LT_SEPARATOR));
246 mxMasterSlide->set_active_text(aLayoutName);
247 }
248 }
249
250 mxFillStyle->set_active(static_cast< sal_Int32 >(NONE));
251
252 mxDspMasterBackground->connect_toggled(LINK(this, SlideBackground, DspBackground));
253 mxDspMasterObjects->connect_toggled(LINK(this, SlideBackground, DspObjects));
254
255 //margins
256 mxMarginSelectBox->connect_changed(LINK(this, SlideBackground, ModifyMarginHdl));
257
258 Update();
260}
261
263{
264 if (mxPaperSizeBox->get_active() == -1)
265 {
266 mpBindings->Update(SID_ATTR_PAGE_SIZE);
267 }
268
270}
271
273 const vcl::EnumContext& rContext)
274{
275 if (maContext == rContext)
276 return;
277 maContext = rContext;
278
279 if ( IsImpress() )
280 {
281 mxMasterLabel->set_label(SdResId(STR_MASTERSLIDE_LABEL));
282
283 // margin selector is only for Draw
284 mxMarginSelectBox->hide();
285 mxMarginLabel->hide();
286
288 {
289 mxCloseMaster->show();
290 mxEditMaster->hide();
291 mxMasterSlide->set_sensitive(false);
292 mxMasterSlide->clear();
293 mxDspMasterBackground->set_sensitive(false);
294 mxDspMasterObjects->set_sensitive(false);
295 mxFillStyle->hide();
296 mxBackgroundLabel->hide();
297 mxInsertImage->show();
298
299 mxFillLB->hide();
300 mxFillAttr->hide();
301 mxFillGrad1->hide();
302 mxFillGrad2->hide();
303 }
305 {
306 mxCloseMaster->hide();
307 mxEditMaster->hide();
308 mxMasterSlide->set_sensitive(false);
309 mxMasterSlide->clear();
310 mxDspMasterBackground->set_sensitive(false);
311 mxDspMasterObjects->set_sensitive(false);
312 mxFillStyle->hide();
313 mxBackgroundLabel->hide();
314 mxInsertImage->hide();
315 }
317 {
318 mxCloseMaster->hide();
319 mxEditMaster->show();
320 mxMasterSlide->set_sensitive(true);
322 mxDspMasterBackground->set_sensitive(true);
323 mxDspMasterObjects->set_sensitive(true);
324 mxFillStyle->show();
325 mxBackgroundLabel->show();
326 mxInsertImage->show();
327 }
328
329 // Need to do a relayouting, otherwise the panel size is not updated after show / hide controls
330 if (m_pPanel)
332
333 }
334 else if ( IsDraw() )
335 {
336 mxMasterLabel->set_label(SdResId(STR_MASTERPAGE_LABEL));
337 mxDspMasterBackground->hide();
338 mxDspMasterObjects->hide();
339
341 {
342 mxEditMaster->hide();
343 mxFillStyle->show();
344 mxBackgroundLabel->show();
345 }
346 else if (maContext == maDrawMasterContext)
347 {
348 mxFillStyle->hide();
349 mxBackgroundLabel->hide();
350 }
351 }
352
353 // The Insert Image button in the sidebar issues .uno:SelectBackground,
354 // which when invoked without arguments will open the file-open-dialog
355 // to prompt the user to select a file. This is useless in LOOL.
356 // Hide for now so the user will only be able to use the menu to insert
357 // background image, which prompts the user for file selection in the browser.
359 mxInsertImage->hide();
360}
361
363{
364 eFillStyle nPos = static_cast<eFillStyle>(mxFillStyle->get_active());
365
367 nPos = NONE;
368
370 if (!pSh)
371 return;
372
373 switch(nPos)
374 {
375 case NONE:
376 {
377 mxFillLB->hide();
378 mxFillAttr->hide();
379 mxFillGrad1->hide();
380 mxFillGrad2->hide();
381 }
382 break;
383 case SOLID:
384 {
385 mxFillAttr->hide();
386 mxFillGrad1->hide();
387 mxFillGrad2->hide();
388 mxFillLB->show();
389 const Color aColor = GetColorSetOrDefault();
390 mxFillLB->SelectEntry(aColor);
391 }
392 break;
393 case GRADIENT:
394 {
395 mxFillLB->hide();
396 mxFillAttr->hide();
397 mxFillGrad1->show();
398 mxFillGrad2->show();
399
400 const basegfx::BGradient aBGradient = GetGradientSetOrDefault();
401 const Color aStartColor(aBGradient.GetColorStops().front().getStopColor());
402 mxFillGrad1->SelectEntry(aStartColor);
403 const Color aEndColor(aBGradient.GetColorStops().back().getStopColor());
404 mxFillGrad2->SelectEntry(aEndColor);
405
406 // MCGR: preserve ColorStops if given.
407 // tdf#155901 We need offset of first and last stop, so include them.
408 if (aBGradient.GetColorStops().size() >= 2)
409 maColorStops = aBGradient.GetColorStops();
410 else
411 maColorStops.clear();
412 }
413 break;
414
415 case HATCH:
416 {
417 mxFillLB->hide();
418 mxFillAttr->show();
419 mxFillAttr->clear();
420 SvxFillAttrBox::Fill(*mxFillAttr, pSh->GetItem(SID_HATCH_LIST)->GetHatchList());
421 mxFillGrad1->hide();
422 mxFillGrad2->hide();
423
424 const OUString aHatchName = GetHatchingSetOrDefault();
425 mxFillAttr->set_active_text( aHatchName );
426 }
427 break;
428
429 case BITMAP:
430 case PATTERN:
431 {
432 mxFillLB->hide();
433 mxFillAttr->show();
434 mxFillAttr->clear();
435 mxFillGrad1->hide();
436 mxFillGrad2->hide();
437 OUString aName;
438 if(nPos == BITMAP)
439 {
440 SvxFillAttrBox::Fill(*mxFillAttr, pSh->GetItem(SID_BITMAP_LIST)->GetBitmapList());
442 }
443 else if(nPos == PATTERN)
444 {
445 SvxFillAttrBox::Fill(*mxFillAttr, pSh->GetItem(SID_PATTERN_LIST)->GetPatternList());
447 }
448 mxFillAttr->set_active_text( aName );
449 }
450 break;
451 default:
452 break;
453 }
454
455 // Need to do a relayouting, otherwise the panel size is not updated after show / hide controls
456 if (m_pPanel)
458}
459
461{
466
467 int nCustomIndex = mxMarginSelectBox->find_text(maCustomEntry);
468
470 {
471 mxMarginSelectBox->set_active(0);
472 if (nCustomIndex != -1)
473 mxMarginSelectBox->remove(nCustomIndex);
474 }
476 {
477 mxMarginSelectBox->set_active(1);
478 if (nCustomIndex != -1)
479 mxMarginSelectBox->remove(nCustomIndex);
480 }
482 {
483 mxMarginSelectBox->set_active(2);
484 if (nCustomIndex != -1)
485 mxMarginSelectBox->remove(nCustomIndex);
486 }
488 {
489 mxMarginSelectBox->set_active(3);
490 if (nCustomIndex != -1)
491 mxMarginSelectBox->remove(nCustomIndex);
492 }
494 {
495 mxMarginSelectBox->set_active(4);
496 if (nCustomIndex != -1)
497 mxMarginSelectBox->remove(nCustomIndex);
498 }
500 {
501 mxMarginSelectBox->set_active(5);
502 if (nCustomIndex != -1)
503 mxMarginSelectBox->remove(nCustomIndex);
504 }
506 {
507 mxMarginSelectBox->set_active(6);
508 if (nCustomIndex != -1)
509 mxMarginSelectBox->remove(nCustomIndex);
510 }
511 else
512 {
513 if (nCustomIndex == -1)
514 mxMarginSelectBox->append_text(maCustomEntry);
515 mxMarginSelectBox->set_active_text(maCustomEntry);
516 }
517}
518
519void SlideBackground::SetPanelTitle( const OUString& rTitle )
520{
521 Reference<frame::XController2> xController( mxFrame->getController(), uno::UNO_QUERY);
522 if ( !xController.is() )
523 return;
524
525 Reference<ui::XSidebarProvider> xSidebarProvider = xController->getSidebar();
526 if ( !xSidebarProvider.is() )
527 return;
528
529 Reference<ui::XDecks> xDecks = xSidebarProvider->getDecks();
530 if ( !xDecks.is() )
531 return;
532
533 Reference<ui::XDeck> xDeck ( xDecks->getByName("PropertyDeck"), uno::UNO_QUERY);
534 if ( !xDeck.is() )
535 return;
536
537 Reference<ui::XPanels> xPanels = xDeck->getPanels();
538 if ( !xPanels.is() )
539 return;
540
541 if (xPanels->hasByName("SlideBackgroundPanel"))
542 {
543 Reference<ui::XPanel> xPanel ( xPanels->getByName("SlideBackgroundPanel"), uno::UNO_QUERY);
544 if ( !xPanel.is() )
545 return;
546
547 xPanel->setTitle( rTitle );
548 }
549}
550
552{
553 Link<tools::EventMultiplexerEvent&,void> aLink( LINK(this, SlideBackground, EventMultiplexerListener) );
554 mrBase.GetEventMultiplexer()->AddEventListener( aLink );
555}
556
558{
559 Link<tools::EventMultiplexerEvent&,void> aLink( LINK(this, SlideBackground, EventMultiplexerListener) );
560 mrBase.GetEventMultiplexer()->RemoveEventListener( aLink );
561}
562
563IMPL_LINK(SlideBackground, EventMultiplexerListener,
564 tools::EventMultiplexerEvent&, rEvent, void)
565{
566 switch (rEvent.meEventId)
567 {
568 // add more events as per requirement
569 // Master Page change triggers a shape change event. Solves sync problem.
571 populateMasterSlideDropdown();
572 break;
574 mbSwitchModeToNormal = true;
575 break;
577 mbSwitchModeToMaster = true;
578 break;
581 {
582 if ( mbSwitchModeToMaster )
583 {
584 if( IsImpress() )
585 SetPanelTitle(SdResId(STR_MASTERSLIDE_NAME));
586 else
587 SetPanelTitle(SdResId(STR_MASTERPAGE_NAME));
588 mbSwitchModeToMaster = false;
589 }
590 else if ( mbSwitchModeToNormal )
591 {
592 if( IsImpress() )
593 SetPanelTitle(SdResId(STR_SLIDE_NAME));
594 else
595 SetPanelTitle(SdResId(STR_PAGE_NAME));
596 mbSwitchModeToNormal = false;
597 }
598
599 }
600 break;
602 {
603 static const sal_uInt16 SidArray[] = {
604 SID_ATTR_PAGE_COLOR,
605 SID_ATTR_PAGE_GRADIENT,
606 SID_ATTR_PAGE_HATCH,
607 SID_ATTR_PAGE_BITMAP,
608 SID_ATTR_PAGE_FILLSTYLE,
609 SID_DISPLAY_MASTER_BACKGROUND,
610 SID_DISPLAY_MASTER_OBJECTS,
611 0 };
612 updateMasterSlideSelection();
614 }
615 break;
617 {
618 if(!mbTitle)
619 {
620 if( IsDraw() )
621 {
622 mxCloseMaster->hide();
623 mxEditMaster->hide();
624 if( maContext == maDrawMasterContext)
625 SetPanelTitle(SdResId(STR_MASTERPAGE_NAME));
626 else
627 SetPanelTitle(SdResId(STR_PAGE_NAME));
628 }
629 else if ( maContext == maImpressOtherContext || maContext == maImpressMasterContext )
630 {
631 if( maContext == maImpressMasterContext )
632 SetPanelTitle(SdResId(STR_MASTERSLIDE_NAME));
633 else
634 SetPanelTitle(SdResId(STR_SLIDE_NAME));
635 }
636 else if ( maContext == maImpressNotesContext )
637 {
638 mxMasterLabel->set_label(SdResId(STR_MASTERSLIDE_LABEL));
639 ViewShell* pMainViewShell = mrBase.GetMainViewShell().get();
640
641 if (pMainViewShell)
642 {
643 DrawViewShell* pDrawViewShell = static_cast<DrawViewShell*>(pMainViewShell);
644 if ( pDrawViewShell->GetEditMode() == EditMode::MasterPage)
645 SetPanelTitle(SdResId(STR_MASTERSLIDE_NAME));
646 else // EditMode::Page
647 SetPanelTitle(SdResId(STR_SLIDE_NAME));
648 }
649 }
650 mbTitle = true;
651 }
652 }
653 break;
654 default:
655 break;
656 }
657}
658
660{
661 mxMasterSlide->clear();
662 ::sd::DrawDocShell* pDocSh = dynamic_cast<::sd::DrawDocShell*>( SfxObjectShell::Current() );
663 SdDrawDocument* pDoc = pDocSh ? pDocSh->GetDoc() : nullptr;
664 sal_uInt16 nCount = pDoc ? pDoc->GetMasterPageCount() : 0;
665 for( sal_uInt16 nLayout = 0; nLayout < nCount; nLayout++ )
666 {
667 SdPage* pMaster = static_cast<SdPage*>(pDoc->GetMasterPage(nLayout));
668 if( pMaster->GetPageKind() == PageKind::Standard)
669 {
670 OUString aLayoutName(pMaster->GetLayoutName());
671 aLayoutName = aLayoutName.copy(0,aLayoutName.indexOf(SD_LT_SEPARATOR));
672 mxMasterSlide->append_text(aLayoutName);
673 }
674 }
676}
677
679{
680 ViewShell* pMainViewShell = mrBase.GetMainViewShell().get();
681 SdPage* pPage = pMainViewShell ? pMainViewShell->getCurrentPage() : nullptr;
682 if (pPage != nullptr && pPage->TRG_HasMasterPage())
683 {
684 SdrPage& rMasterPage (pPage->TRG_GetMasterPage());
685 SdPage* pMasterPage = static_cast<SdPage*>(&rMasterPage);
686 mxMasterSlide->set_active_text(pMasterPage->GetName());
687 }
688}
689
691{
693
694 mxCustomEntry.reset();
695 mxMarginLabel.reset();
696 mxPaperSizeBox.reset();
697 mxPaperOrientation.reset();
698 mxMasterSlide.reset();
699 mxBackgroundLabel.reset();
700 mxFillAttr.reset();
701 mxFillGrad1.reset();
702 mxFillGrad2.reset();
703 mxFillStyle.reset();
704 mxFillLB.reset();
705 mxInsertImage.reset();
706 mxMarginSelectBox.reset();
707 mxDspMasterBackground.reset();
708 mxDspMasterObjects.reset();
709 mxMasterLabel.reset();
710 mxEditMaster.reset();
711 mxCloseMaster.reset();
712
727
728 mpPageItem.reset();
729 mpColorItem.reset();
730 mpHatchItem.reset();
731 mpBitmapItem.reset();
732 mpPageLRMarginItem.reset();
733 mpPageULMarginItem.reset();
734}
735
736void SlideBackground::ExecuteMarginLRChange(const ::tools::Long mnPageLeftMargin, const ::tools::Long mnPageRightMargin)
737{
738 mpPageLRMarginItem->SetLeft(mnPageLeftMargin);
739 mpPageLRMarginItem->SetRight(mnPageRightMargin);
740 GetBindings()->GetDispatcher()->ExecuteList( SID_ATTR_PAGE_LRSPACE, SfxCallMode::RECORD, { mpPageLRMarginItem.get() } );
741}
742
743void SlideBackground::ExecuteMarginULChange(const ::tools::Long mnPageTopMargin, const ::tools::Long mnPageBottomMargin)
744{
745 mpPageULMarginItem->SetUpper(mnPageTopMargin);
746 mpPageULMarginItem->SetLower(mnPageBottomMargin);
747 GetBindings()->GetDispatcher()->ExecuteList( SID_ATTR_PAGE_ULSPACE, SfxCallMode::RECORD, { mpPageULMarginItem.get() } );
748}
749
751{
752 // Tango Sky Blue 1, to be consistent w/ area fill panel (b/c COL_AUTO for slides is transparent)
753 if ( !mpColorItem )
754 mpColorItem.reset( new XFillColorItem( OUString(), Color(0x72, 0x9f, 0xcf) ) );
755
756 return mpColorItem->GetColorValue();
757}
758
760{
761 if( !mpGradientItem )
762 {
763 basegfx::BGradient aGradient;
764 OUString aGradientName;
766 {
767 const SvxGradientListItem * pGradListItem = pSh->GetItem(SID_GRADIENT_LIST);
768 aGradient = pGradListItem->GetGradientList()->GetGradient(0)->GetGradient();
769 aGradientName = pGradListItem->GetGradientList()->GetGradient(0)->GetName();
770 }
771 mpGradientItem.reset( new XFillGradientItem( aGradientName, aGradient ) );
772 }
773
774 return mpGradientItem->GetGradientValue();
775}
776
778{
779 if( !mpHatchItem )
780 {
781 XHatch aHatch;
782 OUString aHatchName;
784 {
785 const SvxHatchListItem * pHatchListItem = pSh->GetItem(SID_HATCH_LIST);
786 aHatch = pHatchListItem->GetHatchList()->GetHatch(0)->GetHatch();
787 aHatchName = pHatchListItem->GetHatchList()->GetHatch(0)->GetName();
788 }
789 mpHatchItem.reset( new XFillHatchItem( aHatchName, aHatch ) );
790 }
791
792 return mpHatchItem->GetName();
793}
794
796{
797 if( !mpBitmapItem || mpBitmapItem->isPattern())
798 {
799 GraphicObject aGraphObj;
800 OUString aBmpName;
802 {
803 const SvxBitmapListItem * pBmpListItem = pSh->GetItem(SID_BITMAP_LIST);
804 aGraphObj = pBmpListItem->GetBitmapList()->GetBitmap(0)->GetGraphicObject();
805 aBmpName = pBmpListItem->GetBitmapList()->GetBitmap(0)->GetName();
806 }
807 mpBitmapItem.reset( new XFillBitmapItem( aBmpName, aGraphObj ) );
808 }
809
810 return mpBitmapItem->GetName();
811}
812
814{
815 if( !mpBitmapItem || !(mpBitmapItem->isPattern()))
816 {
817 GraphicObject aGraphObj;
818 OUString aPtrnName;
820 {
821 const SvxPatternListItem * pPtrnListItem = pSh->GetItem(SID_PATTERN_LIST);
822 aGraphObj = pPtrnListItem->GetPatternList()->GetBitmap(0)->GetGraphicObject();
823 aPtrnName = pPtrnListItem->GetPatternList()->GetBitmap(0)->GetName();
824 }
825 mpBitmapItem.reset( new XFillBitmapItem( aPtrnName, aGraphObj ) );
826 }
827
828 return mpBitmapItem->GetName();
829}
830
832 const sal_uInt16 nSID,
833 const SfxItemState eState,
834 const SfxPoolItem* pState)
835{
836 switch(nSID)
837 {
838
839 case SID_ATTR_PAGE_COLOR:
840 {
841 if(eState >= SfxItemState::DEFAULT)
842 {
843 mxFillStyle->set_active(static_cast< sal_Int32 >(SOLID));
844 mpColorItem.reset(pState ? static_cast< XFillColorItem* >(pState->Clone()) : nullptr);
845 Update();
846 }
847 }
848 break;
849
850 case SID_ATTR_PAGE_HATCH:
851 {
852 if(eState >= SfxItemState::DEFAULT)
853 {
854 mxFillStyle->set_active(static_cast< sal_Int32 >(HATCH));
855 mpHatchItem.reset(pState ? static_cast < XFillHatchItem* >(pState->Clone()) : nullptr);
856 Update();
857 }
858 }
859 break;
860
861 case SID_ATTR_PAGE_GRADIENT:
862 {
863 if(eState >= SfxItemState::DEFAULT)
864 {
865 mxFillStyle->set_active(static_cast< sal_Int32>(GRADIENT));
866 mpGradientItem.reset(pState ? static_cast< XFillGradientItem* >(pState->Clone()) : nullptr);
867 Update();
868 }
869 }
870 break;
871 case SID_ATTR_PAGE_BITMAP:
872 {
873 if(eState >= SfxItemState::DEFAULT)
874 {
875 mpBitmapItem.reset(pState ? static_cast< XFillBitmapItem* >(pState->Clone()) : nullptr);
876 if(mpBitmapItem)
877 {
878 if(mpBitmapItem->isPattern())
879 mxFillStyle->set_active(static_cast< sal_Int32 >(PATTERN));
880 else
881 mxFillStyle->set_active(static_cast< sal_Int32 >(BITMAP));
882 }
883 else
884 mxFillStyle->set_active(static_cast< sal_Int32 >(BITMAP));
885 Update();
886 }
887 }
888 break;
889
890 case SID_ATTR_PAGE_FILLSTYLE:
891 {
892 const XFillStyleItem* pFillStyleItem = nullptr;
893 if (eState >= SfxItemState::DEFAULT)
894 pFillStyleItem = dynamic_cast< const XFillStyleItem* >(pState);
895 if (pFillStyleItem)
896 {
897 css::drawing::FillStyle eXFS = pFillStyleItem->GetValue();
898 switch(eXFS)
899 {
900 case drawing::FillStyle_NONE:
901 mxFillStyle->set_active(static_cast< sal_Int32 >(NONE));
902 break;
903 case drawing::FillStyle_SOLID:
904 mxFillStyle->set_active(static_cast< sal_Int32 >(SOLID));
905 break;
906 case drawing::FillStyle_GRADIENT:
907 mxFillStyle->set_active(static_cast< sal_Int32 >(GRADIENT));
908 break;
909 case drawing::FillStyle_HATCH:
910 mxFillStyle->set_active(static_cast< sal_Int32 >(HATCH));
911 break;
912 case drawing::FillStyle_BITMAP:
913 {
914 if(mpBitmapItem->isPattern())
915 mxFillStyle->set_active(static_cast< sal_Int32 >(PATTERN));
916 else
917 mxFillStyle->set_active(static_cast< sal_Int32 >(BITMAP));
918 }
919 break;
920 default:
921 break;
922 }
923 Update();
924 }
925 }
926 break;
927
928 case SID_ATTR_PAGE_SIZE:
929 {
930 const SvxSizeItem* pSizeItem = nullptr;
931 if (eState >= SfxItemState::DEFAULT)
932 pSizeItem = dynamic_cast<const SvxSizeItem*>(pState);
933 if (pSizeItem)
934 {
935 Size aPaperSize = pSizeItem->GetSize();
936 if (mxPaperOrientation->get_active() == 0)
937 Swap(aPaperSize);
938
939 Paper ePaper = SvxPaperInfo::GetSvxPaper(aPaperSize, meUnit);
940 mxPaperSizeBox->set_active_id( ePaper );
941 }
942 }
943 break;
944
945 case SID_ATTR_PAGE:
946 {
947 const SvxPageItem* pPageItem = nullptr;
948 if (eState >= SfxItemState::DEFAULT)
949 pPageItem = dynamic_cast<const SvxPageItem*>(pState);
950 if (pPageItem)
951 {
952 mpPageItem.reset(pPageItem->Clone());
953 bool bIsLandscape = mpPageItem->IsLandscape();
954 mxPaperOrientation->set_active( bIsLandscape ? 0 : 1 );
955 }
956 }
957 break;
958
959 case SID_ATTR_PAGE_LRSPACE:
960 {
961 const SvxLongLRSpaceItem* pLRItem = nullptr;
962 if (eState >= SfxItemState::DEFAULT)
963 pLRItem = dynamic_cast<const SvxLongLRSpaceItem*>(pState);
964 if (pLRItem)
965 {
966 mpPageLRMarginItem.reset( static_cast<SvxLongLRSpaceItem*>(pState->Clone()) );
968 }
969 }
970 break;
971
972 case SID_ATTR_PAGE_ULSPACE:
973 {
974 const SvxLongULSpaceItem* pULItem = nullptr;
975 if (eState >= SfxItemState::DEFAULT)
976 pULItem = dynamic_cast<const SvxLongULSpaceItem*>(pState);
977 if (pULItem)
978 {
979 mpPageULMarginItem.reset( static_cast<SvxLongULSpaceItem*>(pState->Clone()) );
981 }
982 }
983 break;
984
985 case SID_DISPLAY_MASTER_BACKGROUND:
986 {
987 const SfxBoolItem* pBoolItem = nullptr;
988 if (eState >= SfxItemState::DEFAULT)
989 pBoolItem = dynamic_cast< const SfxBoolItem* >(pState);
990 if (pBoolItem)
991 mxDspMasterBackground->set_active(pBoolItem->GetValue());
992 }
993 break;
994 case SID_DISPLAY_MASTER_OBJECTS:
995 {
996 const SfxBoolItem* pBoolItem = nullptr;
997 if (eState >= SfxItemState::DEFAULT)
998 pBoolItem = dynamic_cast< const SfxBoolItem* >(pState);
999 if (pBoolItem)
1000 mxDspMasterObjects->set_active(pBoolItem->GetValue());
1001 }
1002 break;
1003 case SID_SELECT_BACKGROUND:
1004 {
1005 if(eState >= SfxItemState::DEFAULT)
1006 {
1007 mxFillStyle->set_active(static_cast< sal_Int32 >(BITMAP));
1008 Update();
1009 }
1010 }
1011 break;
1012 case SID_ATTR_METRIC:
1013 {
1014 FieldUnit eFUnit = GetCurrentUnit(eState, pState);
1015 if (meFUnit != eFUnit)
1016 {
1017 meFUnit = eFUnit;
1020 }
1021 }
1022 break;
1023 default:
1024 break;
1025 }
1026}
1027
1029{
1030 const eFillStyle nPos = static_cast<eFillStyle>(mxFillStyle->get_active());
1031 Update();
1032
1033 switch (nPos)
1034 {
1035 case NONE:
1036 {
1037 const XFillStyleItem aXFillStyleItem(drawing::FillStyle_NONE);
1038 GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_FILLSTYLE, SfxCallMode::RECORD, { &aXFillStyleItem });
1039 }
1040 break;
1041
1042 case SOLID:
1043 {
1044 if (mpColorItem)
1045 {
1046 const XFillColorItem aItem( OUString(), mpColorItem->GetColorValue() );
1047 GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_COLOR, SfxCallMode::RECORD, { &aItem });
1048 }
1049 }
1050 break;
1051
1052 case GRADIENT:
1053 {
1054 if (mpGradientItem)
1055 {
1056 const XFillGradientItem aItem( mpGradientItem->GetName(), mpGradientItem->GetGradientValue() );
1057 GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_GRADIENT, SfxCallMode::RECORD, { &aItem });
1058 }
1059 }
1060 break;
1061
1062 case HATCH:
1063 {
1064 if (mpHatchItem)
1065 {
1066 const XFillHatchItem aItem( mpHatchItem->GetName(), mpHatchItem->GetHatchValue() );
1067 GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_HATCH, SfxCallMode::RECORD, { &aItem });
1068 }
1069 }
1070 break;
1071
1072 case BITMAP:
1073 case PATTERN:
1074 {
1075 if (mpBitmapItem)
1076 {
1077 const XFillBitmapItem aItem( mpBitmapItem->GetName(), mpBitmapItem->GetGraphicObject() );
1078 GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_BITMAP, SfxCallMode::RECORD, { &aItem });
1079 }
1080 }
1081 break;
1082
1083 default:
1084 break;
1085 }
1086//TODO mxFillStyle->Selected();
1087}
1088
1090{
1091 const Paper ePaper = mxPaperSizeBox->get_active_id();
1092 Size aSize(SvxPaperInfo::GetPaperSize(ePaper, meUnit));
1093
1094 if (mxPaperOrientation->get_active() == 0)
1095 Swap(aSize);
1096
1097 mpPageItem->SetLandscape(mxPaperOrientation->get_active() == 0);
1098 const SvxSizeItem aSizeItem(SID_ATTR_PAGE_SIZE, aSize);
1099 // Page/slide properties dialog (FuPage::ExecuteDialog and ::ApplyItemSet) misuses
1100 // SID_ATTR_PAGE_EXT1 to distinguish between Impress and Draw, as for whether to fit
1101 // objects to paper size. Until that is handled somehow better, we do the same here
1102 const SfxBoolItem aFitObjs(SID_ATTR_PAGE_EXT1, IsImpress());
1103
1104 GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_SIZE, SfxCallMode::RECORD,
1105 { &aSizeItem, mpPageItem.get(), &aFitObjs });
1106
1107 // Notify LOK clients of the page size change.
1109 return;
1110
1111 SfxViewShell* pViewShell = SfxViewShell::GetFirst();
1112 while (pViewShell)
1113 {
1114 if (pViewShell->GetDocId() == mrBase.GetDocId())
1115 {
1116 SdXImpressDocument* pDoc = comphelper::getFromUnoTunnel<SdXImpressDocument>(pViewShell->GetCurrentDocument());
1118 }
1119 pViewShell = SfxViewShell::GetNext(*pViewShell);
1120 }
1121}
1122
1124{
1125 const drawing::FillStyle eXFS = static_cast<drawing::FillStyle>(mxFillStyle->get_active());
1126 switch(eXFS)
1127 {
1128 case drawing::FillStyle_SOLID:
1129 {
1130 XFillColorItem aItem(OUString(), mxFillLB->GetSelectEntryColor());
1131 GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_COLOR, SfxCallMode::RECORD, { &aItem });
1132 }
1133 break;
1134 case drawing::FillStyle_GRADIENT:
1135 {
1136 basegfx::BGradient aGradient = GetGradientSetOrDefault();
1137 aGradient.SetColorStops(createColorStops());
1138
1139 // the name doesn't really matter, it'll be converted to unique one eventually,
1140 // but it has to be non-empty
1141 XFillGradientItem aItem("gradient", aGradient);
1142 GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_GRADIENT, SfxCallMode::RECORD, { &aItem });
1143 }
1144 break;
1145 default:
1146 break;
1147 }
1148}
1149
1151{
1152 const eFillStyle nFillPos = static_cast<eFillStyle>(mxFillStyle->get_active());
1154 if (!pSh)
1155 return;
1156 switch(nFillPos)
1157 {
1158
1159 case HATCH:
1160 {
1161 const SvxHatchListItem * pHatchListItem = pSh->GetItem(SID_HATCH_LIST);
1162 sal_uInt16 nPos = mxFillAttr->get_active();
1163 XHatch aHatch = pHatchListItem->GetHatchList()->GetHatch(nPos)->GetHatch();
1164 const OUString aHatchName = pHatchListItem->GetHatchList()->GetHatch(nPos)->GetName();
1165
1166 XFillHatchItem aItem(aHatchName, aHatch);
1167 GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_HATCH, SfxCallMode::RECORD, { &aItem });
1168 }
1169 break;
1170
1171 case BITMAP:
1172 case PATTERN:
1173 {
1174 sal_Int16 nPos = mxFillAttr->get_active();
1175 GraphicObject aBitmap;
1176 OUString aName;
1177 if( nFillPos == BITMAP )
1178 {
1179 SvxBitmapListItem const * pBitmapListItem = pSh->GetItem(SID_BITMAP_LIST);
1180 aBitmap = pBitmapListItem->GetBitmapList()->GetBitmap(nPos)->GetGraphicObject();
1181 aName = pBitmapListItem->GetBitmapList()->GetBitmap(nPos)->GetName();
1182 }
1183 else if( nFillPos == PATTERN )
1184 {
1185 SvxPatternListItem const * pPatternListItem = pSh->GetItem(SID_PATTERN_LIST);
1186 aBitmap = pPatternListItem->GetPatternList()->GetBitmap(nPos)->GetGraphicObject();
1187 aName = pPatternListItem->GetPatternList()->GetBitmap(nPos)->GetName();
1188 }
1189 XFillBitmapItem aItem(aName, aBitmap);
1190 GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_BITMAP, SfxCallMode::RECORD, { &aItem });
1191 }
1192 break;
1193
1194 default:
1195 break;
1196 }
1197}
1198
1200{
1201 ::sd::DrawDocShell* pDocSh = dynamic_cast<::sd::DrawDocShell*>( SfxObjectShell::Current() );
1202 SdDrawDocument* pDoc = pDocSh ? pDocSh->GetDoc() : nullptr;
1203 if (!pDoc)
1204 return;
1205
1207 if (pSSVS == nullptr)
1208 return;
1209
1210 auto& rSSController = pSSVS->GetSlideSorter().GetController();
1211 auto& rPageSelector = rSSController.GetPageSelector();
1212
1213 for( sal_uInt16 nPage = 0; nPage < pDoc->GetSdPageCount(PageKind::Standard); nPage++ )
1214 {
1215 if (rPageSelector.IsPageSelected(nPage))
1216 {
1217 OUString aLayoutName(mxMasterSlide->get_active_text());
1218 pDoc->SetMasterPage(nPage, aLayoutName, pDoc, false, false);
1219 }
1220 }
1221}
1222
1224{
1225 GetBindings()->GetDispatcher()->Execute( SID_SLIDE_MASTER_MODE, SfxCallMode::RECORD );
1226}
1227
1229{
1230 GetBindings()->GetDispatcher()->Execute( SID_SELECT_BACKGROUND, SfxCallMode::RECORD );
1231}
1232
1234{
1235 GetBindings()->GetDispatcher()->Execute( SID_CLOSE_MASTER_VIEW, SfxCallMode::RECORD );
1236}
1237
1239{
1240 bool IsChecked = mxDspMasterBackground->get_active();
1241 const SfxBoolItem aBoolItem(SID_DISPLAY_MASTER_BACKGROUND, IsChecked);
1242 GetBindings()->GetDispatcher()->ExecuteList(SID_DISPLAY_MASTER_BACKGROUND, SfxCallMode::RECORD, { &aBoolItem });
1243}
1244
1246{
1247 bool IsChecked = mxDspMasterObjects->get_active();
1248 const SfxBoolItem aBoolItem(SID_DISPLAY_MASTER_OBJECTS,IsChecked);
1249 GetBindings()->GetDispatcher()->ExecuteList(SID_DISPLAY_MASTER_OBJECTS, SfxCallMode::RECORD, { &aBoolItem, &aBoolItem });
1250}
1251
1253{
1254 bool bApplyNewPageMargins = true;
1255 switch ( mxMarginSelectBox->get_active() )
1256 {
1257 case 0:
1258 SetNone(m_nPageLeftMargin, m_nPageRightMargin, m_nPageTopMargin, m_nPageBottomMargin);
1259 break;
1260 case 1:
1261 SetNarrow(m_nPageLeftMargin, m_nPageRightMargin, m_nPageTopMargin, m_nPageBottomMargin);
1262 break;
1263 case 2:
1264 SetModerate(m_nPageLeftMargin, m_nPageRightMargin, m_nPageTopMargin, m_nPageBottomMargin);
1265 break;
1266 case 3:
1267 SetNormal075(m_nPageLeftMargin, m_nPageRightMargin, m_nPageTopMargin, m_nPageBottomMargin);
1268 break;
1269 case 4:
1270 SetNormal100(m_nPageLeftMargin, m_nPageRightMargin, m_nPageTopMargin, m_nPageBottomMargin);
1271 break;
1272 case 5:
1273 SetNormal125(m_nPageLeftMargin, m_nPageRightMargin, m_nPageTopMargin, m_nPageBottomMargin);
1274 break;
1275 case 6:
1276 SetWide(m_nPageLeftMargin, m_nPageRightMargin, m_nPageTopMargin, m_nPageBottomMargin);
1277 break;
1278 default:
1279 bApplyNewPageMargins = false;
1280 break;
1281 }
1282
1283 if(bApplyNewPageMargins)
1284 {
1285 ExecuteMarginLRChange(m_nPageLeftMargin, m_nPageRightMargin);
1286 ExecuteMarginULChange(m_nPageTopMargin, m_nPageBottomMargin);
1287 }
1288}
1289
1291{
1292 basegfx::BColorStops aColorStops;
1293
1294 if (maColorStops.size() >= 2)
1295 {
1296 aColorStops = maColorStops;
1297 aColorStops.front() = basegfx::BColorStop(maColorStops.front().getStopOffset(),
1298 mxFillGrad1->GetSelectEntryColor().getBColor());
1299 aColorStops.back() = basegfx::BColorStop(maColorStops.back().getStopOffset(),
1300 mxFillGrad2->GetSelectEntryColor().getBColor());
1301 }
1302 else
1303 {
1304 aColorStops.emplace_back(0.0, mxFillGrad1->GetSelectEntryColor().getBColor());
1305 aColorStops.emplace_back(1.0, mxFillGrad2->GetSelectEntryColor().getBColor());
1306 }
1307
1308 return aColorStops;
1309}
1310
1311}
1312
1313
1314/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@ EditViewSelection
The selection in the center pane has changed.
@ EditModeNormal
Edit mode was (or is being) switched to normal mode.
@ EditModeMaster
Edit mode was (or is being) switched to master mode.
@ ViewAdded
A new ViewShell is being displayed in one of the panes.
@ EndTextEdit
Text editing in one of the shapes in the MainViewShell has ended.
@ ShapeChanged
The state of a shape has changed.
@ CurrentPageChanged
The current page has changed.
FPDF_PAGE mpPage
const LocaleDataWrapper & GetLocaleDataWrapper() const
static const AllSettings & GetSettings()
OUString getNum(sal_Int64 nNumber, sal_uInt16 nDecimals, bool bUseThousandSep=true, bool bTrailingZeros=true) const
sfx2::sidebar::Panel * m_pPanel
virtual weld::Window * GetFrameWeld() const
virtual void DumpAsPropertyTree(tools::JsonWriter &)
void SetMasterPage(sal_uInt16 nSdPageNum, std::u16string_view rLayoutName, SdDrawDocument *pSourceDoc, bool bMaster, bool bCheckMasters)
Definition: drawdoc3.cxx:1370
sal_uInt16 GetSdPageCount(PageKind ePgKind) const
Definition: drawdoc2.cxx:212
PageKind GetPageKind() const
Definition: sdpage.hxx:205
virtual OUString GetLayoutName() const override
Definition: sdpage.hxx:255
const OUString & GetName() const
Definition: sdpage.cxx:2505
const SdrPage * GetMasterPage(sal_uInt16 nPgNum) const
sal_uInt16 GetMasterPageCount() const
SdrPage & TRG_GetMasterPage() const
bool TRG_HasMasterPage() const
void Update(sal_uInt16 nId)
SfxDispatcher * GetDispatcher() const
void Invalidate(sal_uInt16 nId)
bool GetValue() const
virtual void dispose()
MapUnit GetCoreMetric() const
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
static void notifyDocumentSizeChangedAllViews(vcl::ITiledRenderable *pDoc, bool bInvalidateAll=true)
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
ViewShellDocId GetDocId() const override
static SAL_WARN_UNUSED_RESULT SfxViewShell * GetNext(const SfxViewShell &rPrev, bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
static SAL_WARN_UNUSED_RESULT SfxViewShell * GetFirst(bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
virtual css::uno::Reference< css::frame::XModel > GetCurrentDocument() const
const XBitmapListRef & GetBitmapList() const
const XGradientListRef & GetGradientList() const
const XHatchListRef & GetHatchList() const
virtual SvxPageItem * Clone(SfxItemPool *pPool=nullptr) const override
static Paper GetSvxPaper(const Size &rSize, MapUnit eUnit)
static Size GetPaperSize(Paper ePaper, MapUnit eUnit=MapUnit::MapTwip)
const XPatternListRef & GetPatternList() const
const Size & GetSize() const
void SetColorStops(const basegfx::BColorStops &rSteps)
const basegfx::BColorStops & GetColorStops() const
SdDrawDocument * GetDoc()
Base class of the stacked shells that provide graphical views to Draw and Impress documents and editi...
EditMode GetEditMode() const
View for MDIFrame.
Definition: FrameView.hxx:36
EditMode GetViewShEditMode() const
Return EditMode (Page or MasterPage) of working mode.
Definition: frmview.cxx:334
SfxViewShell descendant that the stacked Draw/Impress shells are based on.
std::shared_ptr< ViewShell > GetMainViewShell() const
Return the main view shell stacked on the called ViewShellBase object.
std::shared_ptr< tools::EventMultiplexer > const & GetEventMultiplexer() const
Return an event multiplexer.
Base class of the stacked shell hierarchy.
Definition: ViewShell.hxx:92
virtual SdPage * getCurrentPage() const =0
FrameView * GetFrameView()
Definition: ViewShell.hxx:221
std::unique_ptr< SvxLongULSpaceItem > mpPageULMarginItem
::sfx2::sidebar::ControllerItem maDspObjController
::sfx2::sidebar::ControllerItem maCloseMasterController
::sfx2::sidebar::ControllerItem maPaperMarginLRController
OUString const & GetHatchingSetOrDefault()
vcl::EnumContext maImpressHandoutContext
virtual void NotifyItemUpdate(const sal_uInt16 nSID, const SfxItemState eState, const SfxPoolItem *pState) override
::sfx2::sidebar::ControllerItem maPaperOrientationController
std::unique_ptr< weld::ComboBox > mxFillStyle
std::unique_ptr< weld::Button > mxInsertImage
virtual ~SlideBackground() override
std::unique_ptr< weld::Button > mxEditMaster
std::unique_ptr< weld::ComboBox > mxMarginSelectBox
std::unique_ptr< SvxLongLRSpaceItem > mpPageLRMarginItem
vcl::EnumContext maImpressMasterContext
std::unique_ptr< SvxPaperSizeListBox > mxPaperSizeBox
virtual void DumpAsPropertyTree(::tools::JsonWriter &) override
std::unique_ptr< weld::CheckButton > mxDspMasterBackground
std::unique_ptr< weld::Label > mxBackgroundLabel
::sfx2::sidebar::ControllerItem maBckColorController
OUString const & GetPatternSetOrDefault()
vcl::EnumContext maImpressOtherContext
::sfx2::sidebar::ControllerItem maBckImageController
::sfx2::sidebar::ControllerItem maBckGradientController
void ExecuteMarginLRChange(const ::tools::Long mnPageLeftMargin, const ::tools::Long mnPageRightMargin)
std::unique_ptr< weld::ComboBox > mxMasterSlide
std::unique_ptr< weld::Label > mxMarginLabel
basegfx::BGradient const & GetGradientSetOrDefault()
basegfx::BColorStops maColorStops
std::unique_ptr< XFillHatchItem > mpHatchItem
SlideBackground(weld::Widget *pParent, ViewShellBase &rBase, css::uno::Reference< css::frame::XFrame > xFrame, SfxBindings *pBindings)
::sfx2::sidebar::ControllerItem maPaperSizeController
basegfx::BColorStops createColorStops()
vcl::EnumContext maDrawMasterContext
::sfx2::sidebar::ControllerItem maPaperMarginULController
std::unique_ptr< weld::Button > mxCloseMaster
void ExecuteMarginULChange(const ::tools::Long mnPageTopMargin, const ::tools::Long mnPageBottomMargin)
void SetPanelTitle(const OUString &rTitle)
std::unique_ptr< SvxPageItem > mpPageItem
std::unique_ptr< weld::Label > mxMasterLabel
::sfx2::sidebar::ControllerItem maBckFillStyleController
vcl::EnumContext maImpressNotesContext
std::unique_ptr< XFillBitmapItem > mpBitmapItem
std::unique_ptr< ColorListBox > mxFillGrad1
std::unique_ptr< weld::Label > mxCustomEntry
virtual void HandleContextChange(const vcl::EnumContext &rContext) override
std::unique_ptr< XFillGradientItem > mpGradientItem
css::uno::Reference< css::frame::XFrame > mxFrame
std::unique_ptr< ColorListBox > mxFillGrad2
std::unique_ptr< weld::CheckButton > mxDspMasterObjects
std::unique_ptr< ColorListBox > mxFillLB
std::unique_ptr< weld::ComboBox > mxPaperOrientation
::sfx2::sidebar::ControllerItem maDspBckController
OUString const & GetBitmapSetOrDefault()
static FieldUnit GetCurrentUnit(SfxItemState eState, const SfxPoolItem *pState)
::sfx2::sidebar::ControllerItem maBckHatchController
::sfx2::sidebar::ControllerItem maMetricController
std::unique_ptr< weld::ComboBox > mxFillAttr
::sfx2::sidebar::ControllerItem maBckBitmapController
std::unique_ptr< XFillColorItem > mpColorItem
SD_DLLPUBLIC SlideSorter & GetSlideSorter() const
static OUString MetricToString(FieldUnit rUnit)
int nCount
virtual SfxBindings & GetBindings() override
SVXCORE_DLLPUBLIC FieldUnit GetModuleFieldUnit(const SfxItemSet &)
FieldUnit
constexpr OUStringLiteral SD_LT_SEPARATOR
Definition: glob.hxx:49
SlideShowContext maContext
OUString aName
sal_uInt16 nPos
OUString sSuffix
#define SAL_N_ELEMENTS(arr)
SVX_DLLPUBLIC void Fill(weld::ComboBox &, const XHatchListRef &pList)
SVX_DLLPUBLIC void Fill(weld::ComboBox &rListBox)
NONE
void addListener(const InterfaceRef &xObject, const css::uno::Reference< css::lang::XEventListener > &xListener)
int i
constexpr OUStringLiteral first
bool IsNormal075(const ::tools::Long nPageLeftMargin, const ::tools::Long nPageRightMargin, const ::tools::Long nPageTopMargin, const ::tools::Long nPageBottomMargin)
bool IsModerate(const ::tools::Long nPageLeftMargin, const ::tools::Long nPageRightMargin, const ::tools::Long nPageTopMargin, const ::tools::Long nPageBottomMargin)
void SetNone(::tools::Long &nPageLeftMargin, ::tools::Long &nPageRightMargin, ::tools::Long &nPageTopMargin, ::tools::Long &nPageBottomMargin)
bool IsWide(const ::tools::Long nPageLeftMargin, const ::tools::Long nPageRightMargin, const ::tools::Long nPageTopMargin, const ::tools::Long nPageBottomMargin)
bool IsNone(const ::tools::Long nPageLeftMargin, const ::tools::Long nPageRightMargin, const ::tools::Long nPageTopMargin, const ::tools::Long nPageBottomMargin)
void SetNarrow(::tools::Long &nPageLeftMargin, ::tools::Long &nPageRightMargin, ::tools::Long &nPageTopMargin, ::tools::Long &nPageBottomMargin)
IMPL_LINK_NOARG(LayoutMenu, ClickHandler, ValueSet *, void)
Definition: LayoutMenu.cxx:369
bool IsNarrow(const ::tools::Long nPageLeftMargin, const ::tools::Long nPageRightMargin, const ::tools::Long nPageTopMargin, const ::tools::Long nPageBottomMargin)
bool IsNormal125(const ::tools::Long nPageLeftMargin, const ::tools::Long nPageRightMargin, const ::tools::Long nPageTopMargin, const ::tools::Long nPageBottomMargin)
void SetNormal125(::tools::Long &nPageLeftMargin, ::tools::Long &nPageRightMargin, ::tools::Long &nPageTopMargin, ::tools::Long &nPageBottomMargin)
void SetNormal075(::tools::Long &nPageLeftMargin, ::tools::Long &nPageRightMargin, ::tools::Long &nPageTopMargin, ::tools::Long &nPageBottomMargin)
IMPL_LINK(CurrentMasterPagesSelector, EventMultiplexerListener, sd::tools::EventMultiplexerEvent &, rEvent, void)
void SetModerate(::tools::Long &nPageLeftMargin, ::tools::Long &nPageRightMargin, ::tools::Long &nPageTopMargin, ::tools::Long &nPageBottomMargin)
void SetNormal100(::tools::Long &nPageLeftMargin, ::tools::Long &nPageRightMargin, ::tools::Long &nPageTopMargin, ::tools::Long &nPageBottomMargin)
void SetWide(::tools::Long &nPageLeftMargin, ::tools::Long &nPageRightMargin, ::tools::Long &nPageTopMargin, ::tools::Long &nPageBottomMargin)
bool IsNormal100(const ::tools::Long nPageLeftMargin, const ::tools::Long nPageRightMargin, const ::tools::Long nPageTopMargin, const ::tools::Long nPageBottomMargin)
const sal_uInt16 SidArray[]
Definition: fuoltext.cxx:43
const char GetValue[]
Paper
Size & Swap(Size &rSize)
SfxItemState
OUString SdResId(TranslateId aId)
Definition: sdmod.cxx:83
Reference< XController > xController
bool IsInch(MapUnit eU)
constexpr OUStringLiteral PATTERN