dba33i: #i111146# migrated all SFX-based applications to use named views
[LibreOffice.git] / sd / source / ui / view / GraphicViewShellBase.cxx
blob99e45a0d05d62a4bc2409f3961de532f48e17d06
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_sd.hxx"
31 #include "GraphicViewShellBase.hxx"
33 #include "GraphicDocShell.hxx"
34 #include "sdresid.hxx"
35 #include "strings.hrc"
36 #include "app.hrc"
37 #include "framework/DrawModule.hxx"
38 #include "framework/FrameworkHelper.hxx"
39 #include <sfx2/request.hxx>
41 namespace sd {
43 TYPEINIT1(GraphicViewShellBase, ViewShellBase);
45 // We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
46 // new GraphicViewShellBase object has been constructed.
49 SFX_IMPL_VIEWFACTORY(GraphicViewShellBase, SdResId(STR_DEFAULTVIEW))
51 SFX_VIEW_REGISTRATION(GraphicDocShell);
54 SfxViewFactory* GraphicViewShellBase::pFactory;
55 SfxViewShell* __EXPORT GraphicViewShellBase::CreateInstance (
56 SfxViewFrame *pFrame, SfxViewShell *pOldView)
58 GraphicViewShellBase* pBase = new GraphicViewShellBase(pFrame, pOldView);
59 pBase->LateInit(framework::FrameworkHelper::msDrawViewURL);
60 return pBase;
62 void GraphicViewShellBase::RegisterFactory( USHORT nPrio )
64 pFactory = new SfxViewFactory(
65 &CreateInstance,&InitFactory,nPrio,"Default");
66 InitFactory();
68 void GraphicViewShellBase::InitFactory()
70 SFX_VIEW_REGISTRATION(GraphicDocShell);
80 GraphicViewShellBase::GraphicViewShellBase (
81 SfxViewFrame* _pFrame,
82 SfxViewShell* pOldShell)
83 : ViewShellBase (_pFrame, pOldShell)
90 GraphicViewShellBase::~GraphicViewShellBase (void)
97 void GraphicViewShellBase::Execute (SfxRequest& rRequest)
99 USHORT nSlotId = rRequest.GetSlot();
101 switch (nSlotId)
103 case SID_NOTES_WINDOW:
104 case SID_SLIDE_SORTER_MULTI_PANE_GUI:
105 case SID_DIAMODE:
106 case SID_OUTLINEMODE:
107 case SID_NOTESMODE:
108 case SID_HANDOUTMODE:
109 case SID_SHOW_TOOL_PANEL:
110 // Prevent some Impress-only slots from being executed.
111 rRequest.Cancel();
112 break;
114 case SID_TASKPANE:
115 case SID_SWITCH_SHELL:
116 case SID_LEFT_PANE_DRAW:
117 case SID_LEFT_PANE_IMPRESS:
118 default:
119 // The remaining requests are forwarded to our base class.
120 ViewShellBase::Execute (rRequest);
121 break;
129 void GraphicViewShellBase::InitializeFramework (void)
131 com::sun::star::uno::Reference<com::sun::star::frame::XController>
132 xController (GetController());
133 sd::framework::DrawModule::Initialize(xController);
137 } // end of namespace sd