LibreOffice Module sd (master) 1
ImpressViewShellBase.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 <DrawDocShell.hxx>
23#include <DrawController.hxx>
24#include <app.hrc>
28#include <sfx2/request.hxx>
29#include <sfx2/viewfac.hxx>
30#include <sfx2/viewfrm.hxx>
31#include <sfx2/viewsh.hxx>
32#include <comphelper/lok.hxx>
33
34namespace sd {
35
36
37// We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
38// new ImpressViewShellBase object has been constructed.
39
40SfxViewFactory* ImpressViewShellBase::s_pFactory;
41SfxViewShell* ImpressViewShellBase::CreateInstance (
42 SfxViewFrame& rFrame, SfxViewShell *pOldView)
43{
44 ImpressViewShellBase* pBase = new ImpressViewShellBase(rFrame, pOldView);
46 return pBase;
47}
48void ImpressViewShellBase::RegisterFactory( SfxInterfaceId nPrio )
49{
50 s_pFactory = new SfxViewFactory(&CreateInstance,nPrio,"Default");
51 InitFactory();
52}
53void ImpressViewShellBase::InitFactory()
54{
55 SFX_VIEW_REGISTRATION(DrawDocShell);
56}
57
59 SfxViewFrame& _rFrame,
60 SfxViewShell* pOldShell)
61 : ViewShellBase (_rFrame, pOldShell)
62{
64}
65
67{
69}
70
72{
73 sal_uInt16 nSlotId = rRequest.GetSlot();
74
75 switch (nSlotId)
76 {
77 case SID_LEFT_PANE_DRAW:
78 // Prevent a Draw-only slots from being executed.
79 rRequest.Cancel();
80 break;
81
82 default:
83 // The remaining requests are forwarded to our base class.
84 ViewShellBase::Execute(rRequest);
85 break;
86 }
87}
88
90{
93}
94
95} // end of namespace sd
96
97/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt16 GetSlot() const
void Cancel()
SfxViewFrame & rFrame
ImpressViewShellBase(SfxViewFrame &rFrame, SfxViewShell *pOldShell)
This constructor is used by the view factory of the SFX macros.
virtual void InitializeFramework() override
virtual void Execute(SfxRequest &rRequest) override
Callback function for general slot calls.
virtual ~ImpressViewShellBase() override
void UnregisterDocument(SdDrawDocument &rDocument)
The master page observer will stop to listen to events of this document.
static MasterPageObserver & Instance()
Return the single instance of this class.
void RegisterDocument(SdDrawDocument &rDocument)
The master page observer will listen to events of this document and detect changes of the use of mast...
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.
DrawDocShell * GetDocShell() const
static const OUString msImpressViewURL
static void Initialize(rtl::Reference< sd::DrawController > const &rxController)
Reference< XController > xController
#define SFX_VIEW_REGISTRATION(DocClass)