66#include <svx/svxids.hrc>
72#include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
73#include <com/sun/star/drawing/XDrawPages.hpp>
74#include <osl/diagnose.h>
94SlideExclusionState GetSlideExclusionState (model::PageEnumeration& rPageSet);
101void collectUIInformation(std::map<OUString, OUString>&& aParameters,
const OUString& rAction)
104 aDescription.
aID =
"impress_win_or_draw_win";
106 aDescription.
aAction = rAction;
107 aDescription.
aKeyWord =
"ImpressWindowUIObject";
108 aDescription.
aParent =
"MainWindow";
126 if (pShell ==
nullptr)
131 case SID_PRESENTATION:
132 case SID_PRESENTATION_CURRENT_SLIDE:
133 case SID_REHEARSE_TIMINGS:
147 case SID_PAGES_PER_ROW:
148 if (rRequest.
GetArgs() !=
nullptr)
151 if (pPagesPerRow !=
nullptr)
153 sal_Int32 nColumnCount = pPagesPerRow->
GetValue();
158 nColumnCount, nColumnCount);
175 case SID_SLIDE_TRANSITIONS_PANEL:
180 u"SdSlideTransitionPanel",
186 case SID_MASTER_SLIDES_PANEL:
191 u"SdAllMasterPagesPanel",
197 case SID_PRESENTATION_DLG:
206 case SID_CUSTOMSHOW_DLG:
215 case SID_EXPAND_PAGE:
224 case SID_SUMMARY_PAGE:
234 case SID_INSERT_MASTER_PAGE:
239 case SID_DUPLICATE_PAGE:
244 case SID_DELETE_PAGE:
245 case SID_DELETE_MASTER_PAGE:
258 case SID_RENAME_MASTER_PAGE:
263 case SID_ASSIGN_LAYOUT:
284#ifdef ENABLE_SDREMOTE
301 if (pShell ==
nullptr)
316 case SID_OBJECT_SELECT:
346 case SID_STYLE_FAMILY:
347 if (rRequest.
GetArgs() !=
nullptr)
351 if (pDocument !=
nullptr)
355 pDocument->
GetDocSh()->SetStyleFamily(
376 if (pBase !=
nullptr)
378 std::shared_ptr<DrawViewShell> pDrawViewShell (
380 if (pDrawViewShell !=
nullptr)
381 pDrawViewShell->FuSupport(rRequest);
393 case SID_DRAWINGMODE:
395 case SID_HANDOUT_MASTER_MODE:
396 case SID_SLIDE_SORTER_MODE:
397 case SID_OUTLINE_MODE:
400 if (pBase !=
nullptr)
413 if (pViewShell !=
nullptr)
424 if (pViewShell !=
nullptr)
439 sal_uInt16 nSlot = rRequest.
GetSlot();
448 if (pViewShell !=
nullptr)
455 case SID_OUTPUT_QUALITY_COLOR:
456 case SID_OUTPUT_QUALITY_GRAYSCALE:
457 case SID_OUTPUT_QUALITY_BLACKWHITE:
458 case SID_OUTPUT_QUALITY_CONTRAST:
461 if (pViewShell !=
nullptr)
462 pViewShell->
ExecReq (rRequest);
466 case SID_MAIL_SCROLLBODY_PAGEDOWN:
468 if (pViewShell !=
nullptr)
469 pViewShell->
ExecReq (rRequest);
473 case SID_OPT_LOCALE_CHANGED:
476 if (pViewShell !=
nullptr)
489 if (pViewShell !=
nullptr)
505 sal_uInt16 nSlotId (nWhich);
510 case SID_PAGES_PER_ROW:
549 bool bDisable =
true;
590 bool bDisable =
true;
616 bool bDisable =
true;
659 const SlideExclusionState eState (GetSlideExclusionState(aSelectedPages));
709 if( !pTransferDocShell ||
static_cast<DrawDocShell*
>(pTransferDocShell)->GetDoc()->GetPageCount() <= 1 )
711 bool bIsPastingSupported (
false);
716 if (pBase !=
nullptr)
718 std::shared_ptr<DrawViewShell> pDrawViewShell (
720 if (pDrawViewShell !=
nullptr)
724 pDrawViewShell->GetActiveWindow()));
726 bIsPastingSupported =
true;
730 if ( ! bIsPastingSupported)
781 bool bDisable =
false;
826 if (nSelectedPages > 0)
835 pPage = pDescriptor->GetPage();
836 sal_uInt16 nFirstPage = (pPage->
GetPageNum()/2) + 1;
841 aPageStr = (nPageCount == nActivePageCount) ?
SdResId(STR_SD_PAGE_COUNT_DRAW) :
SdResId(STR_SD_PAGE_COUNT_CUSTOM_DRAW);
843 aPageStr = (nPageCount == nActivePageCount) ?
SdResId(STR_SD_PAGE_COUNT) :
SdResId(STR_SD_PAGE_COUNT_CUSTOM);
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));
853 if (nSelectedPages == 1 && pPage !=
nullptr)
855 SdPage* pFirstPage = pPage;
859 aLayoutStr = aLayoutStr.copy(0,
nIndex);
864 OUString aString = OUString::number(aUIScale.
GetNumerator()) +
878 SdPage* pSelectedPage =
nullptr;
884 if (pSelectedPage ==
nullptr)
890 if( rRequest.
GetSlot() == SID_RENAME_MASTER_PAGE )
893 aTitle =
SdResId( STR_TITLE_RENAMEMASTERPAGE );
895 aTitle =
SdResId( STR_TITLE_RENAMEMASTERSLIDE );
900 aTitle =
SdResId( STR_TITLE_RENAMEPAGE );
902 aTitle =
SdResId( STR_TITLE_RENAMESLIDE );
905 OUString aDescr(
SdResId( STR_DESC_RENAMESLIDE ) );
906 OUString aPageName = pSelectedPage->
GetName();
913 DBG_ASSERT( bResult,
"Couldn't rename slide or page" );
923 aNameDlg->GetName( aOldName );
924 aNameDlg->SetText( aTitle );
925 aNameDlg->SetCheckNameHdl(
LINK(
this,
SlotManager, RenameSlideHdl ),
true );
926 aNameDlg->SetCheckNameTooltipHdl(
LINK(
this,
SlotManager, RenameSlideTooltipHdl ) );
929 if( aNameDlg->Execute() ==
RET_OK )
932 aNameDlg->GetName( aNewName );
933 if (aNewName != aPageName)
938 DBG_ASSERT( bResult,
"Couldn't rename slide or page" );
942 aNameDlg->GetName( aNewName );
943 collectUIInformation({{
"OldName", aOldName}, {
"NewName", aNewName}},
"RENAME");
949 (pSelectedPage->
GetPageNum()-1)/2, aPageName);
955 rDialog.GetName( aNewName );
958 mrSlideSorter.GetController().GetCurrentSlideManager()->GetCurrentSlide());
959 SdPage* pCurrentPage =
nullptr;
961 pCurrentPage = pDescriptor->GetPage();
963 return (pCurrentPage!=
nullptr && aNewName == pCurrentPage->
GetName())
965 &&
mrSlideSorter.GetViewShell()->GetDocSh()->IsNewPageNameValid( aNewName ) );
970 return SdResId(STR_TOOLTIP_RENAME);
980 SdPage* pPageToRename =
nullptr;
989 pPageToRename = pDescriptor->GetPage();
991 if (pPageToRename !=
nullptr)
994 SdPage* pUndoPage = pPageToRename;
1002 std::make_unique<ModifyPageUndoAction>(
1004 aVisibleLayers.
IsSet( nBackground ),
1005 aVisibleLayers.
IsSet( nBgObj )));
1008 pPageToRename->
SetName( rName );
1012 if (pNotesPage !=
nullptr)
1020 if (pPageToRename !=
nullptr)
1022 const OUString aOldLayoutName( pPageToRename->
GetLayoutName() );
1023 pManager->
AddUndoAction( std::make_unique<RenameLayoutTemplateUndoAction>( pDocument, aOldLayoutName, rName ) );
1028 bool bSuccess = pPageToRename!=
nullptr && ( rName == pPageToRename->
GetName() );
1041 SID_NAVIGATOR_STATE,
true);
1067 SdPage* pNewPage =
nullptr;
1072 if (pShell !=
nullptr)
1086 Reference<drawing::XMasterPagesSupplier> xMasterPagesSupplier (
1088 if (xMasterPagesSupplier.is())
1090 Reference<drawing::XDrawPages> xMasterPages (
1091 xMasterPagesSupplier->getMasterPages());
1092 if (xMasterPages.is())
1094 xMasterPages->insertNewByIndex (nInsertionIndex+1);
1103 if (pNewPage ==
nullptr)
1112 collectUIInformation({{
"POS", OUString::number(nInsertionIndex + 2)}},
"Insert_New_Page_or_Slide");
1119 sal_Int32 nInsertPosition (0);
1120 ::std::vector<SdPage*> aPagesToDuplicate;
1126 if (pDescriptor && pDescriptor->GetPage())
1128 aPagesToDuplicate.push_back(pDescriptor->GetPage());
1129 nInsertPosition = pDescriptor->GetPage()->GetPageNum()+2;
1139 ::std::vector<SdPage*> aPagesToSelect;
1140 for(
const auto& rpPage : aPagesToDuplicate)
1142 aPagesToSelect.push_back(
1145 nInsertPosition += 2;
1147 aPagesToDuplicate.clear();
1155 for (
auto const& it: aPagesToSelect)
1160 collectUIInformation({{
"POS", OUString::number(nInsertPosition + 2)}},
"Duplicate");
1165 const bool bExcludeSlide)
1175 pManager->
AddUndoAction(std::make_unique<ChangeSlideExclusionStateUndoAction>(
1183 std::unique_ptr<ChangeSlideExclusionStateUndoAction> pChangeSlideExclusionStateUndoAction(
1193 pChangeSlideExclusionStateUndoAction->AddPageDescriptor(pDescriptor);
1195 pManager->
AddUndoAction(std::move(pChangeSlideExclusionStateUndoAction));
1265 SlideExclusionState eState (UNDEFINED);
1270 const bool bState = rPageSet.
GetNextElement()->GetPage()->IsExcluded();
1275 eState = bState ?
EXCLUDED : INCLUDED;
SlideSorter & mrSlideSorter
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()
SAL_DLLPRIVATE sal_uInt16 GetMasterPageUserCount(SdrPage const *pMaster) const
sal_uInt16 GetActiveSdPageCount() const
SdPage * GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const
SAL_DLLPRIVATE sal_uInt16 GetPageByName(std::u16string_view rPgName, bool &rbIsMasterPage) const
Return the first page that has the given name.
SAL_DLLPRIVATE void RenameLayoutTemplate(const OUString &rOldLayoutName, const OUString &rNewName)
SdPage * GetMasterSdPage(sal_uInt16 nPgNum, PageKind ePgKind)
virtual SAL_DLLPRIVATE void SetChanged(bool bFlag=true) override
SAL_DLLPRIVATE::sd::DrawDocShell * GetDocSh() const
SAL_DLLPRIVATE DocumentType GetDocumentType() const
SdrObject * GetPresObj(PresObjKind eObjKind, int nIndex=1, bool bFuzzySearch=false)
returns the nIndex'th object from the given PresObjKind, index starts with 1
void CreateTitleAndLayout(bool bInit=false, bool bCreate=false)
virtual OUString GetLayoutName() const override
const OUString & GetName() const
void SetName(const OUString &rName)
Set the name of the page and broadcast a model change.
AutoLayout GetAutoLayout() const
const SfxObjectShellRef & GetDocShell() const
bool IsUndoEnabled() const
void EndTextEditAllViews() const
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
sal_uInt16 GetSlot() const
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
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)
SdDrawDocument * GetDoc()
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
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.
virtual void UpdatePreview(SdPage *pPage)
This method is still used by the OutlineViewShell to update the model according to the content of the...
bool IsMainViewShell() const
Return <TRUE> when the called view shell is the main sub shell of its ViewShellBase object,...
const rtl::Reference< FuPoor > & GetCurrentFunction() const
void ImpSidUndo(SfxRequest &rReq)
std::unique_ptr< Implementation, o3tl::default_delete< Implementation > > mpImpl
virtual SdPage * GetActualPage()=0
const rtl::Reference< FuPoor > & GetOldFunction() const
void SetOldFunction(const rtl::Reference< FuPoor > &xFunction)
void ImpSidRedo(SfxRequest &rReq)
void SetCurrentFunction(const rtl::Reference< FuPoor > &xFunction)
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.
void Cancel()
this method deactivates the current function.
void ExecReq(SfxRequest &rReq)
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false) override
ends current text editing
SdDrawDocument & GetDoc() const
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...
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.
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 void SelectAllPages()
int GetSelectedPageCount() const
SD_DLLPUBLIC bool IsPageSelected(int nPageIndex)
Return whether the specified page is selected.
SD_DLLPUBLIC void DeselectAllPages()
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
SD_DLLPUBLIC PageSelector & GetPageSelector()
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.
void FuSupport(SfxRequest &rRequest)
void GetClipboardState(SfxItemSet &rSet)
SlideSorter & mrSlideSorter
The controller for which we manage the slot calls.
void ExecCtrl(SfxRequest &rRequest)
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)
void GetAttrState(SfxItemSet &rSet)
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 GetMenuState(SfxItemSet &rSet)
void GetStatusBarState(SfxItemSet &rSet)
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 ...
EditMode GetEditMode() const
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.
view::Layouter & GetLayouter()
bool SetState(const model::SharedPageDescriptor &rpDescriptor, const model::PageDescriptor::State eState, const bool bStateValue)
weld::Window * GetFrameWeld() const
#define DBG_ASSERT(sCon, aError)
constexpr OUStringLiteral SD_LT_SEPARATOR
constexpr OUStringLiteral HID_SD_NAMEDIALOG_PAGE
#define LINK(Instance, Class, Member)
SD_DLLPUBLIC void ShowSlideShow(SfxRequest const &rReq, SdDrawDocument &rDoc)
IMPL_STATIC_LINK_NOARG(SlotManager, RenameSlideTooltipHdl, AbstractSvxNameDialog &, OUString)
IMPL_LINK(SlideSorterController, ApplicationEventHandler, VclSimpleEvent &, rEvent, void)
std::shared_ptr< PageDescriptor > SharedPageDescriptor
OUString SdResId(TranslateId aId)
std::map< OUString, OUString > aParameters
SVXCORE_DLLPUBLIC SdrTextObj * DynCastSdrTextObj(SdrObject *)
constexpr OUStringLiteral sUNO_LayerName_background_objects
constexpr OUStringLiteral sUNO_LayerName_background