1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ImpressViewShellBase.cxx,v $
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 #include "precompiled_sd.hxx"
33 #include "ImpressViewShellBase.hxx"
35 #include "DrawDocShell.hxx"
36 #include "sdresid.hxx"
37 #include "strings.hrc"
39 #include "framework/FrameworkHelper.hxx"
40 #include "framework/ImpressModule.hxx"
41 #include "MasterPageObserver.hxx"
42 #include <sfx2/request.hxx>
46 TYPEINIT1(ImpressViewShellBase
, ViewShellBase
);
48 // We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
49 // new ImpressViewShellBase object has been constructed.
52 SFX_IMPL_VIEWFACTORY(ImpressViewShellBase, SdResId(STR_DEFAULTVIEW))
54 SFX_VIEW_REGISTRATION(DrawDocShell);
57 SfxViewFactory
* ImpressViewShellBase::pFactory
;
58 SfxViewShell
* __EXPORT
ImpressViewShellBase::CreateInstance (
59 SfxViewFrame
*pFrame
, SfxViewShell
*pOldView
)
61 ImpressViewShellBase
* pBase
= new ImpressViewShellBase(pFrame
, pOldView
);
62 pBase
->LateInit(::rtl::OUString());
65 void ImpressViewShellBase::RegisterFactory( USHORT nPrio
)
67 pFactory
= new SfxViewFactory(
68 &CreateInstance
,&InitFactory
,nPrio
,SdResId(STR_DEFAULTVIEW
));
71 void ImpressViewShellBase::InitFactory()
73 SFX_VIEW_REGISTRATION(DrawDocShell
);
83 ImpressViewShellBase::ImpressViewShellBase (
84 SfxViewFrame
* _pFrame
,
85 SfxViewShell
* pOldShell
)
86 : ViewShellBase (_pFrame
, pOldShell
)
88 MasterPageObserver::Instance().RegisterDocument (*GetDocShell()->GetDoc());
94 ImpressViewShellBase::~ImpressViewShellBase (void)
96 MasterPageObserver::Instance().UnregisterDocument (*GetDocShell()->GetDoc());
102 void ImpressViewShellBase::Execute (SfxRequest
& rRequest
)
104 USHORT nSlotId
= rRequest
.GetSlot();
108 case SID_LEFT_PANE_DRAW
:
109 // Prevent a Draw-only slots from being executed.
114 // The remaining requests are forwarded to our base class.
115 ViewShellBase::Execute(rRequest
);
123 void ImpressViewShellBase::InitializeFramework (void)
125 ::com::sun::star::uno::Reference
<com::sun::star::frame::XController
>
126 xController (GetController());
127 sd::framework::ImpressModule::Initialize(xController
);
130 } // end of namespace sd