LibreOffice Module sd (master) 1
GraphicViewShellBase.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
22#include <GraphicDocShell.hxx>
23#include <DrawController.hxx>
24#include <app.hrc>
27#include <sfx2/request.hxx>
28#include <sfx2/viewfac.hxx>
29#include <sfx2/viewfrm.hxx>
30#include <sfx2/viewsh.hxx>
31
32namespace sd
33{
34// We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
35// new GraphicViewShellBase object has been constructed.
36
37SfxViewFactory* GraphicViewShellBase::s_pFactory;
38SfxViewShell* GraphicViewShellBase::CreateInstance(SfxViewFrame& rFrame, SfxViewShell* pOldView)
39{
40 GraphicViewShellBase* pBase = new GraphicViewShellBase(rFrame, pOldView);
42 return pBase;
43}
44void GraphicViewShellBase::RegisterFactory(SfxInterfaceId nPrio)
45{
46 s_pFactory = new SfxViewFactory(&CreateInstance, nPrio, "Default");
47 InitFactory();
48}
49void GraphicViewShellBase::InitFactory() { SFX_VIEW_REGISTRATION(GraphicDocShell); }
50
52 : ViewShellBase(_rFrame, pOldShell)
53{
54}
55
57
59{
60 sal_uInt16 nSlotId = rRequest.GetSlot();
61
62 switch (nSlotId)
63 {
64 case SID_NOTES_WINDOW:
65 case SID_SLIDE_SORTER_MULTI_PANE_GUI:
66 case SID_SLIDE_SORTER_MODE:
67 case SID_SLIDE_MASTER_MODE:
68 case SID_OUTLINE_MODE:
69 case SID_NOTES_MODE:
70 case SID_NOTES_MASTER_MODE:
71 case SID_HANDOUT_MASTER_MODE:
72 // Prevent some Impress-only slots from being executed.
73 rRequest.Cancel();
74 break;
75
76 case SID_SWITCH_SHELL:
77 case SID_LEFT_PANE_DRAW:
78 case SID_LEFT_PANE_IMPRESS:
79 default:
80 // The remaining requests are forwarded to our base class.
81 ViewShellBase::Execute(rRequest);
82 break;
83 }
84}
85
87{
90}
91
92} // end of namespace sd
93
94/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt16 GetSlot() const
void Cancel()
SfxViewFrame & rFrame
virtual void Execute(SfxRequest &rRequest) override
Callback function for general slot calls.
GraphicViewShellBase(SfxViewFrame &rFrame, SfxViewShell *pOldShell)
This constructor is used by the view factory of the SFX macros.
virtual ~GraphicViewShellBase() override
virtual void InitializeFramework() override
SfxViewShell descendant that the stacked Draw/Impress shells are based on.
DrawController * GetDrawController() const
virtual void Execute(SfxRequest &rRequest)
Callback function for general slot calls.
static void Initialize(rtl::Reference< sd::DrawController > const &rxController)
Definition: DrawModule.cxx:33
static const OUString msDrawViewURL
Reference< XController > xController
#define SFX_VIEW_REGISTRATION(DocClass)