bump product version to 5.0.4.1
[LibreOffice.git] / sd / source / ui / view / GraphicViewShellBase.cxx
blob02dee459801b303a7fb18ebff61367e2b3b3adc8
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "GraphicViewShellBase.hxx"
22 #include "GraphicDocShell.hxx"
23 #include "sdresid.hxx"
24 #include "strings.hrc"
25 #include "app.hrc"
26 #include "framework/DrawModule.hxx"
27 #include "framework/FrameworkHelper.hxx"
28 #include <sfx2/request.hxx>
29 #include <sfx2/viewfrm.hxx>
30 #include <sfx2/viewsh.hxx>
32 namespace sd {
34 TYPEINIT1(GraphicViewShellBase, ViewShellBase);
36 // We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
37 // new GraphicViewShellBase object has been constructed.
39 SfxViewFactory* GraphicViewShellBase::pFactory;
40 SfxViewShell* GraphicViewShellBase::CreateInstance (
41 SfxViewFrame *pFrame, SfxViewShell *pOldView)
43 GraphicViewShellBase* pBase = new GraphicViewShellBase(pFrame, pOldView);
44 pBase->LateInit(framework::FrameworkHelper::msDrawViewURL);
45 return pBase;
47 void GraphicViewShellBase::RegisterFactory( sal_uInt16 nPrio )
49 pFactory = new SfxViewFactory(&CreateInstance,nPrio,"Default");
50 InitFactory();
52 void GraphicViewShellBase::InitFactory()
54 SFX_VIEW_REGISTRATION(GraphicDocShell);
57 GraphicViewShellBase::GraphicViewShellBase (
58 SfxViewFrame* _pFrame,
59 SfxViewShell* pOldShell)
60 : ViewShellBase (_pFrame, pOldShell)
64 GraphicViewShellBase::~GraphicViewShellBase()
68 void GraphicViewShellBase::Execute (SfxRequest& rRequest)
70 sal_uInt16 nSlotId = rRequest.GetSlot();
72 switch (nSlotId)
74 case SID_NOTES_WINDOW:
75 case SID_SLIDE_SORTER_MULTI_PANE_GUI:
76 case SID_DIAMODE:
77 case SID_OUTLINEMODE:
78 case SID_NOTESMODE:
79 case SID_HANDOUTMODE:
80 // Prevent some Impress-only slots from being executed.
81 rRequest.Cancel();
82 break;
84 case SID_TASKPANE:
85 case SID_SWITCH_SHELL:
86 case SID_LEFT_PANE_DRAW:
87 case SID_LEFT_PANE_IMPRESS:
88 default:
89 // The remaining requests are forwarded to our base class.
90 ViewShellBase::Execute (rRequest);
91 break;
96 void GraphicViewShellBase::InitializeFramework()
98 com::sun::star::uno::Reference<com::sun::star::frame::XController>
99 xController (GetController());
100 sd::framework::DrawModule::Initialize(xController);
103 } // end of namespace sd
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */