update dev300-m58
[ooovba.git] / sd / source / ui / view / GraphicViewShellBase.cxx
blobf0f541d2de1403591ec5c93db71b85fe1881bb02
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: GraphicViewShellBase.cxx,v $
10 * $Revision: 1.11 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sd.hxx"
34 #include "GraphicViewShellBase.hxx"
36 #include "GraphicDocShell.hxx"
37 #include "sdresid.hxx"
38 #include "strings.hrc"
39 #include "app.hrc"
40 #include "framework/DrawModule.hxx"
41 #include "framework/FrameworkHelper.hxx"
42 #include <sfx2/request.hxx>
44 namespace sd {
46 TYPEINIT1(GraphicViewShellBase, ViewShellBase);
48 // We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
49 // new GraphicViewShellBase object has been constructed.
52 SFX_IMPL_VIEWFACTORY(GraphicViewShellBase, SdResId(STR_DEFAULTVIEW))
54 SFX_VIEW_REGISTRATION(GraphicDocShell);
57 SfxViewFactory* GraphicViewShellBase::pFactory;
58 SfxViewShell* __EXPORT GraphicViewShellBase::CreateInstance (
59 SfxViewFrame *pFrame, SfxViewShell *pOldView)
61 GraphicViewShellBase* pBase = new GraphicViewShellBase(pFrame, pOldView);
62 pBase->LateInit(framework::FrameworkHelper::msDrawViewURL);
63 return pBase;
65 void GraphicViewShellBase::RegisterFactory( USHORT nPrio )
67 pFactory = new SfxViewFactory(
68 &CreateInstance,&InitFactory,nPrio,SdResId(STR_DEFAULTVIEW));
69 InitFactory();
71 void GraphicViewShellBase::InitFactory()
73 SFX_VIEW_REGISTRATION(GraphicDocShell);
83 GraphicViewShellBase::GraphicViewShellBase (
84 SfxViewFrame* _pFrame,
85 SfxViewShell* pOldShell)
86 : ViewShellBase (_pFrame, pOldShell)
93 GraphicViewShellBase::~GraphicViewShellBase (void)
100 void GraphicViewShellBase::Execute (SfxRequest& rRequest)
102 USHORT nSlotId = rRequest.GetSlot();
104 switch (nSlotId)
106 case SID_RIGHT_PANE:
107 case SID_NOTES_WINDOW:
108 case SID_SLIDE_SORTER_MULTI_PANE_GUI:
109 case SID_DIAMODE:
110 case SID_OUTLINEMODE:
111 case SID_NOTESMODE:
112 case SID_HANDOUTMODE:
113 case SID_TASK_PANE:
114 // Prevent some Impress-only slots from being executed.
115 rRequest.Cancel();
116 break;
118 case SID_SWITCH_SHELL:
119 case SID_LEFT_PANE_DRAW:
120 case SID_LEFT_PANE_IMPRESS:
121 default:
122 // The remaining requests are forwarded to our base class.
123 ViewShellBase::Execute (rRequest);
124 break;
132 void GraphicViewShellBase::InitializeFramework (void)
134 com::sun::star::uno::Reference<com::sun::star::frame::XController>
135 xController (GetController());
136 sd::framework::DrawModule::Initialize(xController);
140 } // end of namespace sd