LibreOffice Module sd (master) 1
fucushow.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 <fucushow.hxx>
21
22#include <svx/svxids.hrc>
23
24#include <ViewShell.hxx>
25#include <Window.hxx>
26#include <drawdoc.hxx>
27#include <sfx2/dispatch.hxx>
28#include <sfx2/viewfrm.hxx>
29
30#include <sdabstdlg.hxx>
31
32namespace sd {
33
34
36 ViewShell* pViewSh,
37 ::sd::Window* pWin,
38 ::sd::View* pView,
39 SdDrawDocument* pDoc,
40 SfxRequest& rReq)
41 : FuPoor( pViewSh, pWin, pView, pDoc, rReq )
42{
43}
44
46{
47 rtl::Reference<FuPoor> xFunc( new FuCustomShowDlg( pViewSh, pWin, pView, pDoc, rReq ) );
48 xFunc->DoExecute(rReq);
49 return xFunc;
50}
51
53{
56 ScopedVclPtr<AbstractSdCustomShowDlg> pDlg( pFact->CreateSdCustomShowDlg(pWin ? pWin->GetFrameWeld() : nullptr, *mpDoc) );
57 sal_uInt16 nRet = pDlg->Execute();
60
61 if( nRet == RET_YES )
62 {
63 // If the custom show is not set by default
64 if (!rSettings.mbCustomShow)
65 {
66 rSettings.mbStartCustomShow = true;
67 rSettings.mbCustomShow = pDlg->IsCustomShow();
68 }
69
71
72 mpViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_PRESENTATION,
73 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD );
74 }
75 if (nRet == RET_OK)
76 {
78 {
79 if (!pDlg->IsCustomShow())
80 {
81 rSettings.mbCustomShow = false;
82 rSettings.mbAll = true;
83 }
84 }
85 }
86 pDlg.disposeAndClear();
87}
88
89} // end of namespace
90
91/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual VclPtr< AbstractSdCustomShowDlg > CreateSdCustomShowDlg(weld::Window *pWindow, SdDrawDocument &rDrawDoc)=0
static SD_DLLPUBLIC SdAbstractDialogFactory * Create()
Definition: sdabstdlg.cxx:38
SAL_DLLPRIVATE const sd::PresentationSettings & getPresentationSettings() const
Definition: drawdoc.hxx:400
SdCustomShowList * GetCustomShowList(bool bCreate=false)
Definition: drawdoc3.cxx:1161
virtual SAL_DLLPRIVATE void SetChanged(bool bFlag=true) override
Definition: drawdoc.cxx:658
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
SfxDispatcher * GetDispatcher()
void disposeAndClear()
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fucushow.cxx:45
FuCustomShowDlg(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fucushow.cxx:35
virtual void DoExecute(SfxRequest &rReq) override
Definition: fucushow.cxx:52
Base class for all functions.
Definition: fupoor.hxx:48
SdDrawDocument * mpDoc
Definition: fupoor.hxx:148
ViewShell * mpViewShell
Definition: fupoor.hxx:145
Base class of the stacked shell hierarchy.
Definition: ViewShell.hxx:92
::sd::Window * GetActiveWindow() const
The active window is usually the mpContentWindow.
Definition: ViewShell.hxx:155
void SetStartShowWithDialog(bool bIn)
Definition: ViewShell.hxx:263
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
Definition: viewshel.cxx:118
An SdWindow contains the actual working area of ViewShell.
Definition: Window.hxx:45
weld::Window * GetFrameWeld() const
RET_OK
RET_YES