LibreOffice Module sd (master) 1
SlsSlotManager.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
21#include <SlideSorter.hxx>
34#include <view/SlsLayouter.hxx>
36#include <Window.hxx>
37#include <fupoor.hxx>
38#include <fucushow.hxx>
39#include <fusldlg.hxx>
40#include <fuexpand.hxx>
41#include <fusumry.hxx>
42#include <slideshow.hxx>
43#include <app.hrc>
44#include <strings.hrc>
45#include <sdresid.hxx>
46#include <unokywds.hxx>
47#include <drawdoc.hxx>
48#include <DrawDocShell.hxx>
49#include <ViewShellBase.hxx>
51#include <sdpage.hxx>
52#include <sdxfer.hxx>
53#include <helpids.h>
54#include <unmodpg.hxx>
55#include <DrawViewShell.hxx>
56#include <sdabstdlg.hxx>
57#include <sdmod.hxx>
58
59#include <vcl/uitest/logger.hxx>
61
62#include <sfx2/request.hxx>
63#include <sfx2/viewfrm.hxx>
64#include <sfx2/bindings.hxx>
66#include <svx/svxids.hrc>
67#include <svx/svxdlg.hxx>
68#include <svl/intitem.hxx>
69#include <svl/stritem.hxx>
70#include <svl/whiter.hxx>
71#include <svl/itempool.hxx>
72#include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
73#include <com/sun/star/drawing/XDrawPages.hpp>
74#include <osl/diagnose.h>
75
76#include <memory>
77
78using namespace ::com::sun::star;
79using namespace ::com::sun::star::uno;
80using namespace ::com::sun::star::beans;
81
83
84namespace {
85
89enum SlideExclusionState {UNDEFINED, EXCLUDED, INCLUDED, MIXED};
90
94SlideExclusionState GetSlideExclusionState (model::PageEnumeration& rPageSet);
95
96} // end of anonymous namespace
97
98
99namespace {
100
101void collectUIInformation(std::map<OUString, OUString>&& aParameters, const OUString& rAction)
102{
103 EventDescription aDescription;
104 aDescription.aID = "impress_win_or_draw_win";
105 aDescription.aParameters = std::move(aParameters);
106 aDescription.aAction = rAction;
107 aDescription.aKeyWord = "ImpressWindowUIObject";
108 aDescription.aParent = "MainWindow";
109
110 UITestLogger::getInstance().logEvent(aDescription);
111}
112
113}
114
116 : mrSlideSorter(rSlideSorter)
117{
118}
119
121{
123
126 if (pShell == nullptr)
127 return;
128
129 switch (rRequest.GetSlot())
130 {
131 case SID_PRESENTATION:
132 case SID_PRESENTATION_CURRENT_SLIDE:
133 case SID_REHEARSE_TIMINGS:
135 pShell->Cancel();
136 rRequest.Done();
137 break;
138
139 case SID_HIDE_SLIDE:
141 break;
142
143 case SID_SHOW_SLIDE:
145 break;
146
147 case SID_PAGES_PER_ROW:
148 if (rRequest.GetArgs() != nullptr)
149 {
150 const SfxUInt16Item* pPagesPerRow = rRequest.GetArg<SfxUInt16Item>(SID_PAGES_PER_ROW);
151 if (pPagesPerRow != nullptr)
152 {
153 sal_Int32 nColumnCount = pPagesPerRow->GetValue();
154 // Force the given number of columns by setting
155 // the minimal and maximal number of columns to
156 // the same value.
158 nColumnCount, nColumnCount);
159 // Force a repaint and re-layout.
160 pShell->ArrangeGUIElements ();
161 // Rearrange the UI-elements controlled by the
162 // controller and force a rearrangement of the
163 // view.
165 }
166 }
167 rRequest.Done();
168 break;
169
170 case SID_SELECTALL:
172 rRequest.Done();
173 break;
174
175 case SID_SLIDE_TRANSITIONS_PANEL:
176 {
177 // First make sure that the sidebar is visible
178 pShell->GetViewFrame()->ShowChildWindow(SID_SIDEBAR);
180 u"SdSlideTransitionPanel",
182 rRequest.Ignore ();
183 break;
184 }
185
186 case SID_MASTER_SLIDES_PANEL:
187 {
188 // First make sure that the sidebar is visible
189 pShell->GetViewFrame()->ShowChildWindow(SID_SIDEBAR);
191 u"SdAllMasterPagesPanel",
193 rRequest.Ignore ();
194 break;
195 }
196
197 case SID_PRESENTATION_DLG:
199 pShell,
202 pDocument,
203 rRequest);
204 break;
205
206 case SID_CUSTOMSHOW_DLG:
208 pShell,
211 pDocument,
212 rRequest);
213 break;
214
215 case SID_EXPAND_PAGE:
217 pShell,
220 pDocument,
221 rRequest);
222 break;
223
224 case SID_SUMMARY_PAGE:
226 pShell,
229 pDocument,
230 rRequest);
231 break;
232
233 case SID_INSERTPAGE:
234 case SID_INSERT_MASTER_PAGE:
235 InsertSlide(rRequest);
236 rRequest.Done();
237 break;
238
239 case SID_DUPLICATE_PAGE:
240 DuplicateSelectedSlides(rRequest);
241 rRequest.Done();
242 break;
243
244 case SID_DELETE_PAGE:
245 case SID_DELETE_MASTER_PAGE:
246 case SID_DELETE: // we need SID_CUT to handle the delete key
247 // (DEL -> accelerator -> SID_CUT).
249 {
251 mrSlideSorter.GetController().GetSelectionManager()->DeleteSelectedPages();
252 }
253
254 rRequest.Done();
255 break;
256
257 case SID_RENAMEPAGE:
258 case SID_RENAME_MASTER_PAGE:
259 RenameSlide (rRequest);
260 rRequest.Done ();
261 break;
262
263 case SID_ASSIGN_LAYOUT:
264 {
265 pShell->mpImpl->AssignLayout( rRequest, PageKind::Standard );
266 rRequest.Done ();
267 }
268 break;
269
270 case SID_PHOTOALBUM:
271 {
275 pWin ? pWin->GetFrameWeld() : nullptr,
276 pDocument));
277 pDlg->Execute();
278 rRequest.Done ();
279 }
280 break;
281
282 case SID_REMOTE_DLG:
283 {
284#ifdef ENABLE_SDREMOTE
287 ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateRemoteDialog(pWin ? pWin->GetFrameWeld() : nullptr));
288 pDlg->Execute();
289#endif
290 }
291 break;
292
293 default:
294 break;
295 }
296}
297
299{
301 if (pShell == nullptr)
302 return;
303
304 if(pShell->GetCurrentFunction().is())
305 {
307 if (pShell->GetOldFunction() == pShell->GetCurrentFunction())
308 pShell->SetOldFunction(xEmpty);
309
310 pShell->GetCurrentFunction()->Deactivate();
311 pShell->SetCurrentFunction(xEmpty);
312 }
313
314 switch(rRequest.GetSlot())
315 {
316 case SID_OBJECT_SELECT:
318 rRequest.Done();
319 break;
320
321 default:
322 break;
323 }
324
325 if(pShell->GetOldFunction().is())
326 {
327 pShell->GetOldFunction()->Deactivate();
329 pShell->SetOldFunction(xEmpty);
330 }
331
332 if(pShell->GetCurrentFunction().is())
333 {
334 pShell->GetCurrentFunction()->Activate();
335 pShell->SetOldFunction(pShell->GetCurrentFunction());
336 }
337
339 // Invalidate( SID_OBJECT_SELECT );
340}
341
343{
344 switch (rRequest.GetSlot())
345 {
346 case SID_STYLE_FAMILY:
347 if (rRequest.GetArgs() != nullptr)
348 {
349 SdDrawDocument* pDocument
351 if (pDocument != nullptr)
352 {
353 const SfxPoolItem& rItem (
354 rRequest.GetArgs()->Get(SID_STYLE_FAMILY));
355 pDocument->GetDocSh()->SetStyleFamily(
356 static_cast<SfxStyleFamily>(static_cast<const SfxUInt16Item&>(rItem).GetValue()));
357 }
358 }
359 break;
360
361 case SID_PASTE:
362 {
363 SdTransferable* pTransferClip = SD_MOD()->pTransferClip;
364 if( pTransferClip )
365 {
366 SfxObjectShell* pTransferDocShell = pTransferClip->GetDocShell().get();
367
368 DrawDocShell* pDocShell = dynamic_cast<DrawDocShell*>(pTransferDocShell);
369 if (pDocShell && pDocShell->GetDoc()->GetPageCount() > 1)
370 {
372 break;
373 }
374 }
376 if (pBase != nullptr)
377 {
378 std::shared_ptr<DrawViewShell> pDrawViewShell (
379 std::dynamic_pointer_cast<DrawViewShell>(pBase->GetMainViewShell()));
380 if (pDrawViewShell != nullptr)
381 pDrawViewShell->FuSupport(rRequest);
382 }
383 }
384 break;
385
386 case SID_CUT:
387 case SID_COPY:
388 case SID_DELETE:
391 break;
392
393 case SID_DRAWINGMODE:
394 case SID_NOTES_MODE:
395 case SID_HANDOUT_MASTER_MODE:
396 case SID_SLIDE_SORTER_MODE:
397 case SID_OUTLINE_MODE:
398 {
400 if (pBase != nullptr)
401 {
402 framework::FrameworkHelper::Instance(*pBase)->HandleModeChangeSlot(
403 rRequest.GetSlot(), rRequest);
404 rRequest.Done();
405 }
406 break;
407 }
408
409 case SID_UNDO:
410 {
411 SlideSorterViewShell* pViewShell
413 if (pViewShell != nullptr)
414 {
415 pViewShell->ImpSidUndo (rRequest);
416 }
417 break;
418 }
419
420 case SID_REDO:
421 {
422 SlideSorterViewShell* pViewShell
424 if (pViewShell != nullptr)
425 {
426 pViewShell->ImpSidRedo (rRequest);
427 }
428 break;
429 }
430
431 default:
432 break;
433 }
434}
435
437{
438 ViewShell* pViewShell = mrSlideSorter.GetViewShell();
439 sal_uInt16 nSlot = rRequest.GetSlot();
440 switch (nSlot)
441 {
442 case SID_RELOAD:
443 {
444 // empty Undo-Manager
445 mrSlideSorter.GetModel().GetDocument()->GetDocSh()->ClearUndoBuffer();
446
447 // normal forwarding to ViewFrame for execution
448 if (pViewShell != nullptr)
449 pViewShell->GetViewFrame()->ExecuteSlot(rRequest);
450
451 // has to be finished right away
452 return;
453 }
454
455 case SID_OUTPUT_QUALITY_COLOR:
456 case SID_OUTPUT_QUALITY_GRAYSCALE:
457 case SID_OUTPUT_QUALITY_BLACKWHITE:
458 case SID_OUTPUT_QUALITY_CONTRAST:
459 {
460 // flush page cache
461 if (pViewShell != nullptr)
462 pViewShell->ExecReq (rRequest);
463 break;
464 }
465
466 case SID_MAIL_SCROLLBODY_PAGEDOWN:
467 {
468 if (pViewShell != nullptr)
469 pViewShell->ExecReq (rRequest);
470 break;
471 }
472
473 case SID_OPT_LOCALE_CHANGED:
474 {
476 if (pViewShell != nullptr)
477 pViewShell->UpdatePreview (pViewShell->GetActualPage());
478 rRequest.Done();
479 break;
480 }
481
482 case SID_SEARCH_DLG:
483 // We have to handle the SID_SEARCH_DLG slot explicitly because
484 // in some cases (when the slide sorter is displayed in the
485 // center pane) we want to disable the search dialog. Therefore
486 // we have to handle the execution of that slot as well.
487 // We try to do that by forwarding the request to the view frame
488 // of the view shell.
489 if (pViewShell != nullptr)
490 pViewShell->GetViewFrame()->ExecuteSlot(rRequest);
491 break;
492
493 default:
494 break;
495 }
496}
497
499{
500 // Iterate over all items.
501 SfxWhichIter aIter (rSet);
502 sal_uInt16 nWhich = aIter.FirstWhich();
503 while (nWhich)
504 {
505 sal_uInt16 nSlotId (nWhich);
506 if (SfxItemPool::IsWhich(nWhich) && mrSlideSorter.GetViewShell()!=nullptr)
507 nSlotId = mrSlideSorter.GetViewShell()->GetPool().GetSlotId(nWhich);
508 switch (nSlotId)
509 {
510 case SID_PAGES_PER_ROW:
511 rSet.Put (
513 nSlotId,
514 static_cast<sal_uInt16>(mrSlideSorter.GetView().GetLayouter().GetColumnCount())
515 )
516 );
517 break;
518 }
519 nWhich = aIter.NextWhich();
520 }
521}
522
524{
528
529 if (pShell!=nullptr && pShell->GetCurrentFunction().is())
530 {
531 sal_uInt16 nSId = pShell->GetCurrentFunction()->GetSlotID();
532
533 rSet.Put( SfxBoolItem( nSId, true ) );
534 }
535 rSet.Put( SfxBoolItem( SID_DRAWINGMODE, false ) );
536 rSet.Put( SfxBoolItem( SID_SLIDE_SORTER_MODE, true ) );
537 rSet.Put( SfxBoolItem( SID_OUTLINE_MODE, false ) );
538 rSet.Put( SfxBoolItem( SID_NOTES_MODE, false ) );
539 rSet.Put( SfxBoolItem( SID_HANDOUT_MASTER_MODE, false ) );
540
541 if (pShell!=nullptr && pShell->IsMainViewShell())
542 {
543 rSet.DisableItem(SID_SPELL_DIALOG);
544 rSet.DisableItem(SID_SEARCH_DLG);
545 }
546
547 if (SfxItemState::DEFAULT == rSet.GetItemState(SID_EXPAND_PAGE))
548 {
549 bool bDisable = true;
550 if (eEditMode == EditMode::Page)
551 {
552 // At least one of the selected pages has to contain an outline
553 // presentation objects in order to enable the expand page menu
554 // entry.
555 model::PageEnumeration aSelectedPages (
558 while (aSelectedPages.HasMoreElements())
559 {
560 SdPage* pPage = aSelectedPages.GetNextElement()->GetPage();
562 if (pObj!=nullptr )
563 {
564 if( !pObj->IsEmptyPresObj() )
565 {
566 bDisable = false;
567 }
568 else
569 {
570 // check if the object is in edit, then if it's temporarily not empty
571 SdrTextObj* pTextObj = DynCastSdrTextObj( pObj );
572 if( pTextObj )
573 {
574 if( pTextObj->CanCreateEditOutlinerParaObject() )
575 {
576 bDisable = false;
577 }
578 }
579 }
580 }
581 }
582 }
583
584 if (bDisable)
585 rSet.DisableItem (SID_EXPAND_PAGE);
586 }
587
588 if (SfxItemState::DEFAULT == rSet.GetItemState(SID_SUMMARY_PAGE))
589 {
590 bool bDisable = true;
591 if (eEditMode == EditMode::Page)
592 {
593 // At least one of the selected pages has to contain a title
594 // presentation objects in order to enable the summary page menu
595 // entry.
596 model::PageEnumeration aSelectedPages (
599 while (aSelectedPages.HasMoreElements())
600 {
601 SdPage* pPage = aSelectedPages.GetNextElement()->GetPage();
603
604 if (pObj!=nullptr && !pObj->IsEmptyPresObj())
605 bDisable = false;
606 }
607 }
608 if (bDisable)
609 rSet.DisableItem (SID_SUMMARY_PAGE);
610 }
611
612 // starting of presentation possible?
613 if( SfxItemState::DEFAULT == rSet.GetItemState( SID_PRESENTATION ) ||
614 SfxItemState::DEFAULT == rSet.GetItemState( SID_REHEARSE_TIMINGS ) )
615 {
616 bool bDisable = true;
617 model::PageEnumeration aAllPages (
619 while (aAllPages.HasMoreElements())
620 {
621 SdPage* pPage = aAllPages.GetNextElement()->GetPage();
622
623 if( !pPage->IsExcluded() )
624 bDisable = false;
625 }
626 if( bDisable || pDocShell->IsPreview())
627 {
628 rSet.DisableItem( SID_PRESENTATION );
629 rSet.DisableItem( SID_REHEARSE_TIMINGS );
630 }
631 }
632
633 // Disable the rename slots when there are no or more than one slides/master
634 // pages selected; disable the duplicate slot when there are no slides
635 // selected:
636 if (rSet.GetItemState(SID_RENAMEPAGE) == SfxItemState::DEFAULT
637 || rSet.GetItemState(SID_RENAME_MASTER_PAGE) == SfxItemState::DEFAULT
638 || rSet.GetItemState(SID_DUPLICATE_PAGE) == SfxItemState::DEFAULT)
639 {
642 if (n != 1)
643 {
644 rSet.DisableItem(SID_RENAMEPAGE);
645 rSet.DisableItem(SID_RENAME_MASTER_PAGE);
646 }
647 if (n == 0)
648 {
649 rSet.DisableItem(SID_DUPLICATE_PAGE);
650 }
651 }
652
653 if (rSet.GetItemState(SID_HIDE_SLIDE) == SfxItemState::DEFAULT
654 || rSet.GetItemState(SID_SHOW_SLIDE) == SfxItemState::DEFAULT)
655 {
656 model::PageEnumeration aSelectedPages (
659 const SlideExclusionState eState (GetSlideExclusionState(aSelectedPages));
660 switch (eState)
661 {
662 case MIXED:
663 // Show both entries.
664 break;
665
666 case EXCLUDED:
667 rSet.DisableItem(SID_HIDE_SLIDE);
668 break;
669
670 case INCLUDED:
671 rSet.DisableItem(SID_SHOW_SLIDE);
672 break;
673
674 case UNDEFINED:
675 rSet.DisableItem(SID_HIDE_SLIDE);
676 rSet.DisableItem(SID_SHOW_SLIDE);
677 break;
678 }
679 }
680
681 if (eEditMode == EditMode::MasterPage)
682 {
683 // Disable some slots when in master page mode.
684 rSet.DisableItem(SID_ASSIGN_LAYOUT);
685 rSet.DisableItem(SID_INSERTPAGE);
686
687 if (rSet.GetItemState(SID_DUPLICATE_PAGE) == SfxItemState::DEFAULT)
688 rSet.DisableItem(SID_DUPLICATE_PAGE);
689 }
690}
691
693{
694 SdTransferable* pTransferClip = SD_MOD()->pTransferClip;
695
696 if (rSet.GetItemState(SID_PASTE) == SfxItemState::DEFAULT
697 || rSet.GetItemState(SID_PASTE_SPECIAL) == SfxItemState::DEFAULT)
698 {
699 // no own clipboard data?
700 if ( !pTransferClip || !pTransferClip->GetDocShell().is() )
701 {
702 rSet.DisableItem(SID_PASTE);
703 rSet.DisableItem(SID_PASTE_SPECIAL);
704 }
705 else
706 {
707 SfxObjectShell* pTransferDocShell = pTransferClip->GetDocShell().get();
708
709 if( !pTransferDocShell || static_cast<DrawDocShell*>(pTransferDocShell)->GetDoc()->GetPageCount() <= 1 )
710 {
711 bool bIsPastingSupported (false);
712
713 // No or just one page. Check if there is anything that can be
714 // pasted via a DrawViewShell.
716 if (pBase != nullptr)
717 {
718 std::shared_ptr<DrawViewShell> pDrawViewShell (
719 std::dynamic_pointer_cast<DrawViewShell>(pBase->GetMainViewShell()));
720 if (pDrawViewShell != nullptr)
721 {
722 TransferableDataHelper aDataHelper (
724 pDrawViewShell->GetActiveWindow()));
725 if (aDataHelper.GetFormatCount() > 0)
726 bIsPastingSupported = true;
727 }
728 }
729
730 if ( ! bIsPastingSupported)
731 {
732 rSet.DisableItem(SID_PASTE);
733 rSet.DisableItem(SID_PASTE_SPECIAL);
734 }
735 }
736 }
737 }
738
739 // Cut, copy and paste of master pages is not yet implemented properly
740 if (rSet.GetItemState(SID_COPY) == SfxItemState::DEFAULT
741 || rSet.GetItemState(SID_PASTE) == SfxItemState::DEFAULT
742 || rSet.GetItemState(SID_PASTE_SPECIAL) == SfxItemState::DEFAULT
743 || rSet.GetItemState(SID_CUT) == SfxItemState::DEFAULT)
744 {
746 {
747 if (rSet.GetItemState(SID_CUT) == SfxItemState::DEFAULT)
748 rSet.DisableItem(SID_CUT);
749 if (rSet.GetItemState(SID_COPY) == SfxItemState::DEFAULT)
750 rSet.DisableItem(SID_COPY);
751 if (rSet.GetItemState(SID_PASTE) == SfxItemState::DEFAULT)
752 rSet.DisableItem(SID_PASTE);
753 if (rSet.GetItemState(SID_PASTE_SPECIAL) == SfxItemState::DEFAULT)
754 rSet.DisableItem(SID_PASTE_SPECIAL);
755 }
756 }
757
759 if (pBase && pBase->GetObjectShell()->isContentExtractionLocked())
760 {
761 rSet.DisableItem(SID_COPY);
762 rSet.DisableItem(SID_CUT);
763 }
764
765 // Cut, copy, and delete page are disabled when there is no selection.
766 if (!(rSet.GetItemState(SID_CUT) == SfxItemState::DEFAULT
767 || rSet.GetItemState(SID_COPY) == SfxItemState::DEFAULT
768 || rSet.GetItemState(SID_DELETE) == SfxItemState::DEFAULT
769 || rSet.GetItemState(SID_DELETE_PAGE) == SfxItemState::DEFAULT
770 || rSet.GetItemState(SID_DELETE_MASTER_PAGE) == SfxItemState::DEFAULT))
771 return;
772
773 model::PageEnumeration aSelectedPages (
776
777 // For copy to work we have to have at least one selected page.
778 if ( ! aSelectedPages.HasMoreElements())
779 rSet.DisableItem(SID_COPY);
780
781 bool bDisable = false;
782 // The operations that lead to the deletion of a page are valid if
783 // a) there is at least one selected page
784 // b) deleting the selected pages leaves at least one page in the
785 // document
786 // c) selected master pages must not be used by slides.
787
788 // Test a).
789 if ( ! aSelectedPages.HasMoreElements())
790 bDisable = true;
791 // Test b): Count the number of selected pages. It has to be less
792 // than the number of all pages.
795 bDisable = true;
796 // Test c): Iterate over the selected pages and look for a master
797 // page that is used by at least one page.
798 else while (aSelectedPages.HasMoreElements())
799 {
800 SdPage* pPage = aSelectedPages.GetNextElement()->GetPage();
801 int nUseCount (mrSlideSorter.GetModel().GetDocument()
802 ->GetMasterPageUserCount(pPage));
803 if (nUseCount > 0)
804 {
805 bDisable = true;
806 break;
807 }
808 }
809
810 if (bDisable)
811 {
812 rSet.DisableItem(SID_CUT);
813 rSet.DisableItem(SID_DELETE_PAGE);
814 rSet.DisableItem(SID_DELETE_MASTER_PAGE);
815 }
816}
817
819{
820 // page view and layout
821 SdPage* pPage = nullptr;
822 sal_uInt16 nSelectedPages = mrSlideSorter.GetController().GetPageSelector().GetSelectedPageCount();
823 View* pDrView = &mrSlideSorter.GetView();
824
825 //Set number of slides
826 if (nSelectedPages > 0)
827 {
828 model::PageEnumeration aSelectedPages (
831 model::SharedPageDescriptor pDescriptor (aSelectedPages.GetNextElement());
832 OUString aPageStr;
833 if (pDescriptor)
834 {
835 pPage = pDescriptor->GetPage();
836 sal_uInt16 nFirstPage = (pPage->GetPageNum()/2) + 1;
837 sal_Int32 nPageCount = mrSlideSorter.GetModel().GetPageCount();
838 sal_Int32 nActivePageCount = static_cast<sal_Int32>(mrSlideSorter.GetModel().GetDocument()->GetActiveSdPageCount());
839
840 if (pDrView->GetDoc().GetDocumentType() == DocumentType::Draw)
841 aPageStr = (nPageCount == nActivePageCount) ? SdResId(STR_SD_PAGE_COUNT_DRAW) : SdResId(STR_SD_PAGE_COUNT_CUSTOM_DRAW);
842 else
843 aPageStr = (nPageCount == nActivePageCount) ? SdResId(STR_SD_PAGE_COUNT) : SdResId(STR_SD_PAGE_COUNT_CUSTOM);
844
845 aPageStr = aPageStr.replaceFirst("%1", OUString::number(nFirstPage));
846 aPageStr = aPageStr.replaceFirst("%2", OUString::number(nPageCount));
847 if(nPageCount != nActivePageCount)
848 aPageStr = aPageStr.replaceFirst("%3", OUString::number(nActivePageCount));
849 }
850 rSet.Put( SfxStringItem( SID_STATUS_PAGE, aPageStr ) );
851 }
852 //Set layout
853 if (nSelectedPages == 1 && pPage != nullptr)
854 {
855 SdPage* pFirstPage = pPage;
856 OUString aLayoutStr = pFirstPage->GetLayoutName();
857 sal_Int32 nIndex = aLayoutStr.indexOf( SD_LT_SEPARATOR );
858 if( nIndex != -1 )
859 aLayoutStr = aLayoutStr.copy(0, nIndex);
860 rSet.Put( SfxStringItem( SID_STATUS_LAYOUT, aLayoutStr ) );
861 }
862 //Scale value
863 const Fraction& aUIScale = mrSlideSorter.GetModel().GetDocument()->GetUIScale();
864 OUString aString = OUString::number(aUIScale.GetNumerator()) +
865 ":" + OUString::number(aUIScale.GetDenominator());
866 rSet.Put( SfxStringItem( SID_SCALE, aString ) );
867}
868
870{
871 View* pDrView = &mrSlideSorter.GetView();
872
873 if ( pDrView->IsTextEdit() )
874 {
875 pDrView->SdrEndTextEdit();
876 }
877
878 SdPage* pSelectedPage = nullptr;
879 model::PageEnumeration aSelectedPages (
882 if (aSelectedPages.HasMoreElements())
883 pSelectedPage = aSelectedPages.GetNextElement()->GetPage();
884 if (pSelectedPage == nullptr)
885 return;
886
887 // tdf#107183 Set different dialog titles when renaming
888 // master slides or normal ones
889 OUString aTitle;
890 if( rRequest.GetSlot() == SID_RENAME_MASTER_PAGE )
891 {
892 if (pDrView->GetDoc().GetDocumentType() == DocumentType::Draw)
893 aTitle = SdResId( STR_TITLE_RENAMEMASTERPAGE );
894 else
895 aTitle = SdResId( STR_TITLE_RENAMEMASTERSLIDE );
896 }
897 else
898 {
899 if (pDrView->GetDoc().GetDocumentType() == DocumentType::Draw)
900 aTitle = SdResId( STR_TITLE_RENAMEPAGE );
901 else
902 aTitle = SdResId( STR_TITLE_RENAMESLIDE );
903 }
904
905 OUString aDescr( SdResId( STR_DESC_RENAMESLIDE ) );
906 OUString aPageName = pSelectedPage->GetName();
907
908 if(rRequest.GetArgs())
909 {
910 OUString aName = rRequest.GetArgs()->GetItem<const SfxStringItem>(SID_RENAMEPAGE)->GetValue();
911
912 bool bResult = RenameSlideFromDrawViewShell(pSelectedPage->GetPageNum()/2, aName );
913 DBG_ASSERT( bResult, "Couldn't rename slide or page" );
914 }
915 else
916 {
920 pWin ? pWin->GetFrameWeld() : nullptr,
921 aPageName, aDescr));
922 OUString aOldName;
923 aNameDlg->GetName( aOldName );
924 aNameDlg->SetText( aTitle );
925 aNameDlg->SetCheckNameHdl( LINK( this, SlotManager, RenameSlideHdl ), true );
926 aNameDlg->SetCheckNameTooltipHdl( LINK( this, SlotManager, RenameSlideTooltipHdl ) );
927 aNameDlg->SetEditHelpId( HID_SD_NAMEDIALOG_PAGE );
928
929 if( aNameDlg->Execute() == RET_OK )
930 {
931 OUString aNewName;
932 aNameDlg->GetName( aNewName );
933 if (aNewName != aPageName)
934 {
935 bool bResult =
937 pSelectedPage->GetPageNum()/2, aNewName );
938 DBG_ASSERT( bResult, "Couldn't rename slide or page" );
939 }
940 }
941 OUString aNewName;
942 aNameDlg->GetName( aNewName );
943 collectUIInformation({{"OldName", aOldName}, {"NewName", aNewName}}, "RENAME");
944 aNameDlg.disposeAndClear();
945 }
946 // Tell the slide sorter about the name change (necessary for
947 // accessibility.)
949 (pSelectedPage->GetPageNum()-1)/2, aPageName);
950}
951
952IMPL_LINK(SlotManager, RenameSlideHdl, AbstractSvxNameDialog&, rDialog, bool)
953{
954 OUString aNewName;
955 rDialog.GetName( aNewName );
956
957 model::SharedPageDescriptor pDescriptor (
958 mrSlideSorter.GetController().GetCurrentSlideManager()->GetCurrentSlide());
959 SdPage* pCurrentPage = nullptr;
960 if (pDescriptor)
961 pCurrentPage = pDescriptor->GetPage();
962
963 return (pCurrentPage!=nullptr && aNewName == pCurrentPage->GetName())
964 || (mrSlideSorter.GetViewShell()
965 && mrSlideSorter.GetViewShell()->GetDocSh()->IsNewPageNameValid( aNewName ) );
966}
967
969{
970 return SdResId(STR_TOOLTIP_RENAME);
971}
972
973bool SlotManager::RenameSlideFromDrawViewShell( sal_uInt16 nPageId, const OUString & rName )
974{
975 bool bOutDummy;
977 if( pDocument->GetPageByName( rName, bOutDummy ) != SDRPAGE_NOTFOUND )
978 return false;
979
980 SdPage* pPageToRename = nullptr;
981
982 SfxUndoManager* pManager = pDocument->GetDocSh()->GetUndoManager();
983
985 {
986 model::SharedPageDescriptor pDescriptor (
987 mrSlideSorter.GetController().GetCurrentSlideManager()->GetCurrentSlide());
988 if (pDescriptor)
989 pPageToRename = pDescriptor->GetPage();
990
991 if (pPageToRename != nullptr)
992 {
993 // Undo
994 SdPage* pUndoPage = pPageToRename;
995 SdrLayerAdmin & rLayerAdmin = pDocument->GetLayerAdmin();
996 SdrLayerID nBackground = rLayerAdmin.GetLayerID(sUNO_LayerName_background);
998 SdrLayerIDSet aVisibleLayers = pPageToRename->TRG_GetMasterPageVisibleLayers();
999
1000 // (#67720#)
1001 pManager->AddUndoAction(
1002 std::make_unique<ModifyPageUndoAction>(
1003 pDocument, pUndoPage, rName, pUndoPage->GetAutoLayout(),
1004 aVisibleLayers.IsSet( nBackground ),
1005 aVisibleLayers.IsSet( nBgObj )));
1006
1007 // rename
1008 pPageToRename->SetName( rName );
1009
1010 // also rename notes-page
1011 SdPage* pNotesPage = pDocument->GetSdPage( nPageId, PageKind::Notes );
1012 if (pNotesPage != nullptr)
1013 pNotesPage->SetName (rName);
1014 }
1015 }
1016 else
1017 {
1018 // rename MasterPage -> rename LayoutTemplate
1019 pPageToRename = pDocument->GetMasterSdPage( nPageId, PageKind::Standard );
1020 if (pPageToRename != nullptr)
1021 {
1022 const OUString aOldLayoutName( pPageToRename->GetLayoutName() );
1023 pManager->AddUndoAction( std::make_unique<RenameLayoutTemplateUndoAction>( pDocument, aOldLayoutName, rName ) );
1024 pDocument->RenameLayoutTemplate( aOldLayoutName, rName );
1025 }
1026 }
1027
1028 bool bSuccess = pPageToRename!=nullptr && ( rName == pPageToRename->GetName() );
1029
1030 if( bSuccess )
1031 {
1032 // user edited page names may be changed by the page so update control
1033 // aTabControl.SetPageText( nPageId, rName );
1034
1035 // set document to modified state
1036 pDocument->SetChanged();
1037
1038 // inform navigator about change
1041 SID_NAVIGATOR_STATE, true);
1042 }
1043
1044 return bSuccess;
1045}
1046
1062{
1063 const sal_Int32 nInsertionIndex (GetInsertionPosition());
1064
1066
1067 SdPage* pNewPage = nullptr;
1069 {
1070 SlideSorterViewShell* pShell = dynamic_cast<SlideSorterViewShell*>(
1072 if (pShell != nullptr)
1073 {
1074 pNewPage = pShell->CreateOrDuplicatePage (
1075 rRequest,
1077 nInsertionIndex>=0
1078 ? mrSlideSorter.GetModel().GetPageDescriptor(nInsertionIndex)->GetPage()
1079 : nullptr);
1080 }
1081 }
1082 else
1083 {
1084 // Use the API to create a new page.
1086 Reference<drawing::XMasterPagesSupplier> xMasterPagesSupplier (
1087 pDocument->getUnoModel(), UNO_QUERY);
1088 if (xMasterPagesSupplier.is())
1089 {
1090 Reference<drawing::XDrawPages> xMasterPages (
1091 xMasterPagesSupplier->getMasterPages());
1092 if (xMasterPages.is())
1093 {
1094 xMasterPages->insertNewByIndex (nInsertionIndex+1);
1095
1096 // Create shapes for the default layout.
1097 pNewPage = pDocument->GetMasterSdPage(
1098 static_cast<sal_uInt16>(nInsertionIndex+1), PageKind::Standard);
1099 pNewPage->CreateTitleAndLayout (true,true);
1100 }
1101 }
1102 }
1103 if (pNewPage == nullptr)
1104 return;
1105
1106 // When a new page has been inserted then select it, make it the
1107 // current page, and focus it.
1112 collectUIInformation({{"POS", OUString::number(nInsertionIndex + 2)}}, "Insert_New_Page_or_Slide");
1113}
1114
1116{
1117 // Create a list of the pages that are to be duplicated. The process of
1118 // duplication alters the selection.
1119 sal_Int32 nInsertPosition (0);
1120 ::std::vector<SdPage*> aPagesToDuplicate;
1121 model::PageEnumeration aSelectedPages (
1123 while (aSelectedPages.HasMoreElements())
1124 {
1125 model::SharedPageDescriptor pDescriptor (aSelectedPages.GetNextElement());
1126 if (pDescriptor && pDescriptor->GetPage())
1127 {
1128 aPagesToDuplicate.push_back(pDescriptor->GetPage());
1129 nInsertPosition = pDescriptor->GetPage()->GetPageNum()+2;
1130 }
1131 }
1132
1133 // Duplicate the pages in aPagesToDuplicate and collect the newly
1134 // created pages in aPagesToSelect.
1135 const bool bUndo (aPagesToDuplicate.size()>1 && mrSlideSorter.GetView().IsUndoEnabled());
1136 if (bUndo)
1137 mrSlideSorter.GetView().BegUndo(SdResId(STR_INSERTPAGE));
1138
1139 ::std::vector<SdPage*> aPagesToSelect;
1140 for(const auto& rpPage : aPagesToDuplicate)
1141 {
1142 aPagesToSelect.push_back(
1144 rRequest, PageKind::Standard, rpPage, nInsertPosition));
1145 nInsertPosition += 2;
1146 }
1147 aPagesToDuplicate.clear();
1148
1149 if (bUndo)
1151
1152 // Set the selection to the pages in aPagesToSelect.
1154 rSelector.DeselectAllPages();
1155 for (auto const& it: aPagesToSelect)
1156 {
1157 rSelector.SelectPage(it);
1158 }
1159
1160 collectUIInformation({{"POS", OUString::number(nInsertPosition + 2)}}, "Duplicate");
1161}
1162
1164 const model::SharedPageDescriptor& rpDescriptor,
1165 const bool bExcludeSlide)
1166{
1168 SfxUndoManager* pManager = pDocument->GetDocSh()->GetUndoManager();
1169 if (rpDescriptor)
1170 {
1172 rpDescriptor,
1174 bExcludeSlide);
1175 pManager->AddUndoAction(std::make_unique<ChangeSlideExclusionStateUndoAction>(
1176 pDocument, rpDescriptor, model::PageDescriptor::ST_Excluded, !bExcludeSlide));
1177 }
1178 else
1179 {
1180 model::PageEnumeration aSelectedPages (
1183 std::unique_ptr<ChangeSlideExclusionStateUndoAction> pChangeSlideExclusionStateUndoAction(
1185 !bExcludeSlide));
1186 while (aSelectedPages.HasMoreElements())
1187 {
1188 model::SharedPageDescriptor pDescriptor (aSelectedPages.GetNextElement());
1190 pDescriptor,
1192 bExcludeSlide);
1193 pChangeSlideExclusionStateUndoAction->AddPageDescriptor(pDescriptor);
1194 }
1195 pManager->AddUndoAction(std::move(pChangeSlideExclusionStateUndoAction));
1196 }
1197
1199 rBindings.Invalidate(SID_PRESENTATION);
1200 rBindings.Invalidate(SID_REHEARSE_TIMINGS);
1201 rBindings.Invalidate(SID_HIDE_SLIDE);
1202 rBindings.Invalidate(SID_SHOW_SLIDE);
1204}
1205
1207{
1209
1210 // The insertion indicator is preferred. After all the user explicitly
1211 // used it to define the insertion position.
1213 {
1214 // Select the page before the insertion indicator.
1215 return mrSlideSorter.GetController().GetInsertionIndicatorHandler()->GetInsertionPageIndex()
1216 - 1;
1217 }
1218
1219 // Is there a stored insertion position?
1220 else if (mrSlideSorter.GetController().GetSelectionManager()->GetInsertionPosition() >= 0)
1221 {
1222 return mrSlideSorter.GetController().GetSelectionManager()->GetInsertionPosition() - 1;
1223 }
1224
1225 // Use the index of the last selected slide.
1226 else if (rSelector.GetSelectedPageCount() > 0)
1227 {
1228 for (int nIndex=rSelector.GetPageCount()-1; nIndex>=0; --nIndex)
1229 if (rSelector.IsPageSelected(nIndex))
1230 return nIndex;
1231
1232 // We should never get here.
1233 OSL_ASSERT(false);
1234 return rSelector.GetPageCount() - 1;
1235 }
1236
1237 // Select the last page when there is at least one page.
1238 else if (rSelector.GetPageCount() > 0)
1239 {
1240 return rSelector.GetPageCount() - 1;
1241 }
1242
1243 // Hope for the best that CreateOrDuplicatePage() can cope with an empty
1244 // selection.
1245 else
1246 {
1247 // We should never get here because there has to be at least one page.
1248 OSL_ASSERT(false);
1249 return -1;
1250 }
1251}
1252
1254{
1256 rBindings.Invalidate(SID_PRESENTATION);
1257 rBindings.Invalidate(SID_INSERTPAGE);
1258 rBindings.Invalidate(SID_DUPLICATE_PAGE);
1259}
1260
1261namespace {
1262
1263SlideExclusionState GetSlideExclusionState (model::PageEnumeration& rPageSet)
1264{
1265 SlideExclusionState eState (UNDEFINED);
1266
1267 // Get toggle state of the selected pages.
1268 while (rPageSet.HasMoreElements() && eState!=MIXED)
1269 {
1270 const bool bState = rPageSet.GetNextElement()->GetPage()->IsExcluded();
1271 switch (eState)
1272 {
1273 case UNDEFINED:
1274 // Use the first selected page to set the initial value.
1275 eState = bState ? EXCLUDED : INCLUDED;
1276 break;
1277
1278 case EXCLUDED:
1279 // The pages before where all not part of the show,
1280 // this one is.
1281 if ( ! bState)
1282 eState = MIXED;
1283 break;
1284
1285 case INCLUDED:
1286 // The pages before where all part of the show,
1287 // this one is not.
1288 if (bState)
1289 eState = MIXED;
1290 break;
1291
1292 default:
1293 // No need to change anything.
1294 break;
1295 }
1296 }
1297
1298 return eState;
1299}
1300
1301} // end of anonymous namespace
1302
1303} // end of namespace ::sd::slidesorter::controller
1304
1305/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SlideSorter & mrSlideSorter
sal_uInt16 nPageId
sal_uInt16 GetValue() const
sal_Int32 GetNumerator() const
sal_Int32 GetDenominator() const
virtual VclPtr< VclAbstractDialog > CreateRemoteDialog(weld::Window *pWindow)=0
virtual VclPtr< VclAbstractDialog > CreateSdPhotoAlbumDialog(weld::Window *pWindow, SdDrawDocument *pDoc)=0
static SD_DLLPUBLIC SdAbstractDialogFactory * Create()
Definition: sdabstdlg.cxx:38
SAL_DLLPRIVATE sal_uInt16 GetMasterPageUserCount(SdrPage const *pMaster) const
Definition: drawdoc4.cxx:694
sal_uInt16 GetActiveSdPageCount() const
Definition: drawdoc2.cxx:227
SdPage * GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const
Definition: drawdoc2.cxx:207
SAL_DLLPRIVATE sal_uInt16 GetPageByName(std::u16string_view rPgName, bool &rbIsMasterPage) const
Return the first page that has the given name.
Definition: drawdoc2.cxx:126
SAL_DLLPRIVATE void RenameLayoutTemplate(const OUString &rOldLayoutName, const OUString &rNewName)
Definition: drawdoc4.cxx:1018
SdPage * GetMasterSdPage(sal_uInt16 nPgNum, PageKind ePgKind)
Definition: drawdoc2.cxx:217
virtual SAL_DLLPRIVATE void SetChanged(bool bFlag=true) override
Definition: drawdoc.cxx:658
SAL_DLLPRIVATE::sd::DrawDocShell * GetDocSh() const
Definition: drawdoc.hxx:242
SAL_DLLPRIVATE DocumentType GetDocumentType() const
Definition: drawdoc.hxx:251
SdrObject * GetPresObj(PresObjKind eObjKind, int nIndex=1, bool bFuzzySearch=false)
returns the nIndex'th object from the given PresObjKind, index starts with 1
Definition: sdpage.cxx:203
void CreateTitleAndLayout(bool bInit=false, bool bCreate=false)
Definition: sdpage.cxx:793
bool IsExcluded() const
Definition: sdpage.hxx:223
virtual OUString GetLayoutName() const override
Definition: sdpage.hxx:255
const OUString & GetName() const
Definition: sdpage.cxx:2505
void SetName(const OUString &rName)
Set the name of the page and broadcast a model change.
Definition: sdpage.cxx:2703
AutoLayout GetAutoLayout() const
Definition: sdpage.hxx:190
const SfxObjectShellRef & GetDocShell() const
Definition: sdxfer.hxx:48
bool IsUndoEnabled() const
void BegUndo()
void EndTextEditAllViews() const
void EndUndo()
SdrLayerID GetLayerID(const OUString &rName) const
bool IsSet(SdrLayerID a) const
css::uno::Reference< css::uno::XInterface > const & getUnoModel()
const Fraction & GetUIScale() const
const SdrLayerAdmin & GetLayerAdmin() const
sal_uInt16 GetPageCount() const
virtual bool IsTextEdit() const final override
bool IsEmptyPresObj() const
sal_uInt16 GetPageNum() const
const SdrLayerIDSet & TRG_GetMasterPageVisibleLayers() const
bool CanCreateEditOutlinerParaObject() const
void Invalidate(sal_uInt16 nId)
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
sal_uInt16 GetSlotId(sal_uInt16 nWhich) const
static bool IsWhich(sal_uInt16 nId)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void DisableItem(sal_uInt16 nWhich)
bool isContentExtractionLocked() const
bool IsPreview() const
sal_uInt16 GetSlot() const
void Ignore()
const SfxItemSet * GetArgs() const
const T * GetArg(sal_uInt16 nSlotId) const
void Done(bool bRemove=false)
SfxItemPool & GetPool() const
const SfxPoolItem * ExecuteSlot(SfxRequest &rReq, const SfxInterface *pIF=nullptr)
virtual void AddUndoAction(std::unique_ptr< SfxUndoAction > pAction, bool bTryMerg=false)
SfxBindings & GetBindings()
SfxFrame & GetFrame() const
void ShowChildWindow(sal_uInt16, bool bVisible=true)
virtual SfxObjectShell * GetObjectShell() override
sal_uInt16 FirstWhich()
sal_uInt16 NextWhich()
virtual VclPtr< AbstractSvxNameDialog > CreateSvxNameDialog(weld::Window *pParent, const OUString &rName, const OUString &rDesc)=0
static SvxAbstractDialogFactory * Create()
sal_uInt32 GetFormatCount() const
static TransferableDataHelper CreateFromSystemClipboard(vcl::Window *pWindow)
static UITestLogger & getInstance()
void logEvent(const EventDescription &rDescription)
void disposeAndClear()
SdDrawDocument * GetDoc()
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fucushow.cxx:45
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fuexpand.cxx:60
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fusldlg.cxx:51
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fusumry.cxx:56
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.
Base class of the stacked shell hierarchy.
Definition: ViewShell.hxx:92
virtual void UpdatePreview(SdPage *pPage)
This method is still used by the OutlineViewShell to update the model according to the content of the...
Definition: viewshel.cxx:1087
bool IsMainViewShell() const
Return <TRUE> when the called view shell is the main sub shell of its ViewShellBase object,...
Definition: viewshel.cxx:1493
const rtl::Reference< FuPoor > & GetCurrentFunction() const
Definition: ViewShell.hxx:250
void ImpSidUndo(SfxRequest &rReq)
Definition: viewshel.cxx:1202
std::unique_ptr< Implementation, o3tl::default_delete< Implementation > > mpImpl
Definition: ViewShell.hxx:485
virtual SdPage * GetActualPage()=0
const rtl::Reference< FuPoor > & GetOldFunction() const
Definition: ViewShell.hxx:248
void SetOldFunction(const rtl::Reference< FuPoor > &xFunction)
Definition: viewshel.cxx:1430
void ImpSidRedo(SfxRequest &rReq)
Definition: viewshel.cxx:1270
void SetCurrentFunction(const rtl::Reference< FuPoor > &xFunction)
Definition: viewshel.cxx:1422
virtual SdPage * CreateOrDuplicatePage(SfxRequest &rRequest, PageKind ePageKind, SdPage *pPage, const sal_Int32 nInsertPosition=-1)
Depending on the given request create a new page or duplicate an existing one.
Definition: viewshe3.cxx:160
void Cancel()
this method deactivates the current function.
Definition: viewshel.cxx:1442
void ExecReq(SfxRequest &rReq)
Definition: viewshel.cxx:1339
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
Definition: viewshel.cxx:118
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false) override
ends current text editing
Definition: sdview.cxx:772
SdDrawDocument & GetDoc() const
Definition: View.hxx:293
static ::std::shared_ptr< FrameworkHelper > Instance(ViewShellBase &rBase)
Return the FrameworkHelper object that is associated with the given ViewShellBase.
virtual void ArrangeGUIElements() override
Place and size the controls and windows.
Show previews for all the slides in a document and allow the user to insert or delete slides and modi...
Definition: SlideSorter.hxx:62
SD_DLLPUBLIC controller::SlideSorterController & GetController() const
ViewShell * GetViewShell() const
Return the view shell that was given at construction.
ViewShellBase * GetViewShellBase() const
Return the ViewShellBase object.
const VclPtr< sd::Window > & GetContentWindow() const
Return the content window.
Definition: SlideSorter.hxx:99
model::SlideSorterModel & GetModel() const
view::SlideSorterView & GetView() const
void HandleSlotCall(SfxRequest &rRequest)
With the current implementation the forwarded calls to the current function will come back eventually...
Use the UpdateLock whenever you do a complex selection, i.e.
A sub-controller that handles page selection of the slide browser.
SD_DLLPUBLIC bool IsPageSelected(int nPageIndex)
Return whether the specified page is selected.
int GetPageCount() const
This convenience method returns the same number of pages that SlideSorterModel.GetPageCount() returns...
void SelectPage(int nPageIndex)
Select the specified descriptor.
static rtl::Reference< FuPoor > Create(SlideSorter &rSlideSorter, SfxRequest &rRequest)
void PageNameHasChanged(int nPageIndex, const OUString &rsOldName)
Call this method when the name of one of the pages has changed.
std::shared_ptr< CurrentSlideManager > const & GetCurrentSlideManager() const
std::shared_ptr< SelectionManager > const & GetSelectionManager() const
void Rearrange(bool bForce)
Determine which of the UI elements–the scroll bars, the scroll bar filler, the actual slide sorter vi...
void UpdateAllPages()
Update the display of all pages.
std::shared_ptr< InsertionIndicatorHandler > const & GetInsertionIndicatorHandler() const
SD_DLLPUBLIC controller::Clipboard & GetClipboard()
This manager takes over the work of handling slot calls from the controller of the slide sorter.
void NotifyEditModeChange()
Call this after a change from normal mode to master mode or back.
SlideSorter & mrSlideSorter
The controller for which we manage the slot calls.
void DuplicateSelectedSlides(SfxRequest &rRequest)
void InsertSlide(SfxRequest &rRequest)
Handle SID_INSERTPAGE slot calls.
void RenameSlide(const SfxRequest &rRequest)
The implementation is a copy of the code for SID_RENAMEPAGE in drviews2.cxx.
sal_Int32 GetInsertionPosition() const
Use one of several ways to determine where to insert a new page.
bool RenameSlideFromDrawViewShell(sal_uInt16 nPageId, const OUString &rName)
SlotManager(SlideSorter &rSlideSorter)
Create a new slot manager that handles slot calls for the controller of a slide sorter.
void FuPermanent(SfxRequest &rRequest)
void FuTemporary(SfxRequest &rRequest)
void ChangeSlideExclusionState(const model::SharedPageDescriptor &rpDescriptor, const bool bExcludeSlide)
Exclude or include one slide or all selected slides.
static PageEnumeration CreateAllPagesEnumeration(const SlideSorterModel &rModel)
The returned enumeration of slides iterates over all slides of the given model.
static PageEnumeration CreateSelectedPagesEnumeration(const SlideSorterModel &rModel)
The returned enumeration of slides iterates over the currently selected slides of the given model.
Public class of page enumerations that delegates its calls to an implementation object that can filte...
virtual SharedPageDescriptor GetNextElement() override
Return the next element of the enumeration.
virtual bool HasMoreElements() const override
Return <TRUE> when the enumeration has more elements, i.e.
SdDrawDocument * GetDocument()
This method is present to let the view create a ShowView for displaying slides.
sal_Int32 GetPageCount() const
Return the number of slides in the document regardless of whether they are visible or not or whether ...
SharedPageDescriptor GetPageDescriptor(const sal_Int32 nPageIndex, const bool bCreate=true) const
Return a page descriptor for the page with the specified index.
void SetColumnCount(sal_Int32 nMinimalColumnCount, sal_Int32 nMaximalColumnCount)
Set the interval of valid column counts.
sal_Int32 GetColumnCount() const
Return the number of columns.
bool SetState(const model::SharedPageDescriptor &rpDescriptor, const model::PageDescriptor::State eState, const bool bStateValue)
static void ShowPanel(std::u16string_view rsPanelId, const css::uno::Reference< css::frame::XFrame > &rxFrame, bool bFocus=false)
T * get() const
bool is() const
weld::Window * GetFrameWeld() const
#define DBG_ASSERT(sCon, aError)
MIXED
float u
UNDEFINED
constexpr OUStringLiteral SD_LT_SEPARATOR
Definition: glob.hxx:49
constexpr OUStringLiteral HID_SD_NAMEDIALOG_PAGE
Definition: helpids.h:41
sal_Int32 nIndex
OUString aName
sal_Int64 n
SD_DLLPUBLIC void ShowSlideShow(SfxRequest const &rReq, SdDrawDocument &rDoc)
Definition: drviewse.cxx:1656
IMPL_STATIC_LINK_NOARG(SlotManager, RenameSlideTooltipHdl, AbstractSvxNameDialog &, OUString)
IMPL_LINK(SlideSorterController, ApplicationEventHandler, VclSimpleEvent &, rEvent, void)
std::shared_ptr< PageDescriptor > SharedPageDescriptor
const char GetValue[]
EditMode
Definition: pres.hxx:53
OUString SdResId(TranslateId aId)
Definition: sdmod.cxx:83
#define SD_MOD()
Definition: sdmod.hxx:184
static SfxItemSet & rSet
std::map< OUString, OUString > aParameters
SfxStyleFamily
SVXCORE_DLLPUBLIC SdrTextObj * DynCastSdrTextObj(SdrObject *)
#define SDRPAGE_NOTFOUND
constexpr OUStringLiteral sUNO_LayerName_background_objects
Definition: unokywds.hxx:30
constexpr OUStringLiteral sUNO_LayerName_background
Definition: unokywds.hxx:29
RET_OK