update dev300-m58
[ooovba.git] / sd / source / ui / view / PresentationViewShellBase.cxx
blob29bd28fa4cb39c19431608c9ad1e8389c23b2e86
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: PresentationViewShellBase.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 "PresentationViewShellBase.hxx"
35 #include "sdresid.hxx"
36 #include "DrawDocShell.hxx"
37 #include "strings.hrc"
38 #include "UpdateLockManager.hxx"
39 #include "framework/FrameworkHelper.hxx"
40 #include "framework/PresentationModule.hxx"
42 #include <sfx2/viewfrm.hxx>
43 #include <com/sun/star/beans/XPropertySet.hpp>
44 #include <com/sun/star/frame/XLayoutManager.hpp>
46 using namespace ::com::sun::star;
47 using namespace ::com::sun::star::uno;
49 namespace sd {
51 class DrawDocShell;
53 TYPEINIT1(PresentationViewShellBase, ViewShellBase);
55 // We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
56 // new PresentationViewShellBase object has been constructed.
59 SFX_IMPL_VIEWFACTORY(PresentationViewShellBase, SdResId(STR_DEFAULTVIEW))
61 SFX_VIEW_REGISTRATION(DrawDocShell);
64 SfxViewFactory* PresentationViewShellBase::pFactory;
65 SfxViewShell* __EXPORT PresentationViewShellBase::CreateInstance (
66 SfxViewFrame *_pFrame, SfxViewShell *pOldView)
68 PresentationViewShellBase* pBase =
69 new PresentationViewShellBase(_pFrame, pOldView);
70 pBase->LateInit(framework::FrameworkHelper::msPresentationViewURL);
71 return pBase;
73 void PresentationViewShellBase::RegisterFactory( USHORT nPrio )
75 pFactory = new SfxViewFactory(
76 &CreateInstance,&InitFactory,nPrio,SdResId(STR_DEFAULTVIEW));
77 InitFactory();
79 void PresentationViewShellBase::InitFactory()
81 SFX_VIEW_REGISTRATION(DrawDocShell);
87 PresentationViewShellBase::PresentationViewShellBase (
88 SfxViewFrame* _pFrame,
89 SfxViewShell* pOldShell)
90 : ViewShellBase (_pFrame, pOldShell)
92 GetUpdateLockManager()->Disable();
94 // Hide the automatic (non-context sensitive) tool bars.
95 if (_pFrame!=NULL && _pFrame->GetFrame()!=NULL)
97 Reference<beans::XPropertySet> xFrameSet (
98 _pFrame->GetFrame()->GetFrameInterface(),
99 UNO_QUERY);
100 if (xFrameSet.is())
102 Reference<beans::XPropertySet> xLayouterSet (
103 xFrameSet->getPropertyValue(::rtl::OUString::createFromAscii("LayoutManager")),
104 UNO_QUERY);
105 if (xLayouterSet.is())
107 xLayouterSet->setPropertyValue(
108 ::rtl::OUString::createFromAscii("AutomaticToolbars"),
109 makeAny(sal_False));
118 PresentationViewShellBase::~PresentationViewShellBase (void)
125 void PresentationViewShellBase::InitializeFramework (void)
127 com::sun::star::uno::Reference<com::sun::star::frame::XController>
128 xController (GetController());
129 sd::framework::PresentationModule::Initialize(xController);
132 } // end of namespace sd