bump product version to 5.0.4.1
[LibreOffice.git] / sd / source / ui / view / PresentationViewShellBase.cxx
bloba5173da3a559e9eb7d66ab2c6ebf85385aa18892
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "PresentationViewShellBase.hxx"
21 #include "sdresid.hxx"
22 #include "DrawDocShell.hxx"
23 #include "strings.hrc"
24 #include "framework/FrameworkHelper.hxx"
25 #include "framework/PresentationModule.hxx"
27 #include <sfx2/viewfrm.hxx>
28 #include <sfx2/viewsh.hxx>
29 #include <com/sun/star/beans/XPropertySet.hpp>
30 #include <com/sun/star/frame/XLayoutManager.hpp>
32 using namespace ::com::sun::star;
33 using namespace ::com::sun::star::uno;
35 namespace sd {
37 class DrawDocShell;
39 TYPEINIT1(PresentationViewShellBase, ViewShellBase);
41 // We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
42 // new PresentationViewShellBase object has been constructed.
44 SfxViewFactory* PresentationViewShellBase::pFactory;
45 SfxViewShell* PresentationViewShellBase::CreateInstance (
46 SfxViewFrame *_pFrame, SfxViewShell *pOldView)
48 PresentationViewShellBase* pBase =
49 new PresentationViewShellBase(_pFrame, pOldView);
50 pBase->LateInit(framework::FrameworkHelper::msPresentationViewURL);
51 return pBase;
53 void PresentationViewShellBase::RegisterFactory( sal_uInt16 nPrio )
55 pFactory = new SfxViewFactory(
56 &CreateInstance,nPrio,"FullScreenPresentation");
57 InitFactory();
59 void PresentationViewShellBase::InitFactory()
61 SFX_VIEW_REGISTRATION(DrawDocShell);
64 PresentationViewShellBase::PresentationViewShellBase (
65 SfxViewFrame* _pFrame,
66 SfxViewShell* pOldShell)
67 : ViewShellBase (_pFrame, pOldShell)
69 // Hide the automatic (non-context sensitive) tool bars.
70 Reference<beans::XPropertySet> xFrameSet (
71 _pFrame->GetFrame().GetFrameInterface(),
72 UNO_QUERY);
73 if (xFrameSet.is())
75 Reference<beans::XPropertySet> xLayouterSet(xFrameSet->getPropertyValue("LayoutManager"), UNO_QUERY);
76 if (xLayouterSet.is())
78 xLayouterSet->setPropertyValue("AutomaticToolbars", makeAny(sal_False));
83 PresentationViewShellBase::~PresentationViewShellBase()
87 void PresentationViewShellBase::InitializeFramework()
89 com::sun::star::uno::Reference<com::sun::star::frame::XController>
90 xController (GetController());
91 sd::framework::PresentationModule::Initialize(xController);
94 } // end of namespace sd
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */