fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / sd / source / ui / view / PresentationViewShellBase.cxx
blob05d5228a478c5a3b7be1fde88ab663ad4260c122
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 <com/sun/star/beans/XPropertySet.hpp>
29 #include <com/sun/star/frame/XLayoutManager.hpp>
31 using namespace ::com::sun::star;
32 using namespace ::com::sun::star::uno;
34 namespace sd {
36 class DrawDocShell;
38 TYPEINIT1(PresentationViewShellBase, ViewShellBase);
40 // We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
41 // new PresentationViewShellBase object has been constructed.
43 SfxViewFactory* PresentationViewShellBase::pFactory;
44 SfxViewShell* PresentationViewShellBase::CreateInstance (
45 SfxViewFrame *_pFrame, SfxViewShell *pOldView)
47 PresentationViewShellBase* pBase =
48 new PresentationViewShellBase(_pFrame, pOldView);
49 pBase->LateInit(framework::FrameworkHelper::msPresentationViewURL);
50 return pBase;
52 void PresentationViewShellBase::RegisterFactory( sal_uInt16 nPrio )
54 pFactory = new SfxViewFactory(
55 &CreateInstance,nPrio,"FullScreenPresentation");
56 InitFactory();
58 void PresentationViewShellBase::InitFactory()
60 SFX_VIEW_REGISTRATION(DrawDocShell);
66 PresentationViewShellBase::PresentationViewShellBase (
67 SfxViewFrame* _pFrame,
68 SfxViewShell* pOldShell)
69 : ViewShellBase (_pFrame, pOldShell)
71 // Hide the automatic (non-context sensitive) tool bars.
72 if (_pFrame!=NULL)
74 Reference<beans::XPropertySet> xFrameSet (
75 _pFrame->GetFrame().GetFrameInterface(),
76 UNO_QUERY);
77 if (xFrameSet.is())
79 Reference<beans::XPropertySet> xLayouterSet(xFrameSet->getPropertyValue("LayoutManager"), UNO_QUERY);
80 if (xLayouterSet.is())
82 xLayouterSet->setPropertyValue("AutomaticToolbars", makeAny(sal_False));
91 PresentationViewShellBase::~PresentationViewShellBase (void)
97 void PresentationViewShellBase::InitializeFramework (void)
99 com::sun::star::uno::Reference<com::sun::star::frame::XController>
100 xController (GetController());
101 sd::framework::PresentationModule::Initialize(xController);
104 } // end of namespace sd
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */