1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 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. 14 * 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). 20 * 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. 25 * 26 ************************************************************************/ 27 28 // MARKER(update_precomp.py): autogen include statement, do not remove 29 #include "precompiled_sd.hxx" 30 31 #include "GraphicViewShellBase.hxx" 32 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> 40 41 namespace sd { 42 43 TYPEINIT1(GraphicViewShellBase, ViewShellBase); 44 45 // We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a 46 // new GraphicViewShellBase object has been constructed. 47 48 SfxViewFactory* GraphicViewShellBase::pFactory; 49 SfxViewShell* __EXPORT GraphicViewShellBase::CreateInstance ( 50 SfxViewFrame *pFrame, SfxViewShell *pOldView) 51 { 52 GraphicViewShellBase* pBase = new GraphicViewShellBase(pFrame, pOldView); 53 pBase->LateInit(framework::FrameworkHelper::msDrawViewURL); 54 return pBase; 55 } 56 void GraphicViewShellBase::RegisterFactory( sal_uInt16 nPrio ) 57 { 58 pFactory = new SfxViewFactory( 59 &CreateInstance,&InitFactory,nPrio,"Default"); 60 InitFactory(); 61 } 62 void GraphicViewShellBase::InitFactory() 63 { 64 SFX_VIEW_REGISTRATION(GraphicDocShell); 65 } 66 67 68 69 70 71 72 73 74 GraphicViewShellBase::GraphicViewShellBase ( 75 SfxViewFrame* _pFrame, 76 SfxViewShell* pOldShell) 77 : ViewShellBase (_pFrame, pOldShell) 78 { 79 } 80 81 82 83 84 GraphicViewShellBase::~GraphicViewShellBase (void) 85 { 86 } 87 88 89 90 91 void GraphicViewShellBase::Execute (SfxRequest& rRequest) 92 { 93 sal_uInt16 nSlotId = rRequest.GetSlot(); 94 95 switch (nSlotId) 96 { 97 case SID_NOTES_WINDOW: 98 case SID_SLIDE_SORTER_MULTI_PANE_GUI: 99 case SID_DIAMODE: 100 case SID_OUTLINEMODE: 101 case SID_NOTESMODE: 102 case SID_HANDOUTMODE: 103 case SID_SHOW_TOOL_PANEL: 104 // Prevent some Impress-only slots from being executed. 105 rRequest.Cancel(); 106 break; 107 108 case SID_TASKPANE: 109 case SID_SWITCH_SHELL: 110 case SID_LEFT_PANE_DRAW: 111 case SID_LEFT_PANE_IMPRESS: 112 default: 113 // The remaining requests are forwarded to our base class. 114 ViewShellBase::Execute (rRequest); 115 break; 116 } 117 118 } 119 120 121 122 123 void GraphicViewShellBase::InitializeFramework (void) 124 { 125 com::sun::star::uno::Reference<com::sun::star::frame::XController> 126 xController (GetController()); 127 sd::framework::DrawModule::Initialize(xController); 128 } 129 130 131 } // end of namespace sd 132 133