LibreOffice Module sd (master) 1
PresentationViewShellBase.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
21#include <DrawDocShell.hxx>
22#include <DrawController.hxx>
25
26#include <sfx2/viewfac.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/XFrame.hpp>
31
32using namespace ::com::sun::star;
33using namespace ::com::sun::star::uno;
34
35namespace sd {
36
37class DrawDocShell;
38
39
40// We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
41// new PresentationViewShellBase object has been constructed.
42
43SfxViewFactory* PresentationViewShellBase::s_pFactory;
44SfxViewShell* PresentationViewShellBase::CreateInstance (
45 SfxViewFrame& _rFrame, SfxViewShell *pOldView)
46{
48 new PresentationViewShellBase(_rFrame, pOldView);
50 return pBase;
51}
52void PresentationViewShellBase::RegisterFactory( SfxInterfaceId nPrio )
53{
54 s_pFactory = new SfxViewFactory(
55 &CreateInstance,nPrio,"FullScreenPresentation");
56 InitFactory();
57}
58void PresentationViewShellBase::InitFactory()
59{
60 SFX_VIEW_REGISTRATION(DrawDocShell);
61}
62
64 SfxViewFrame& _rFrame,
65 SfxViewShell* pOldShell)
66 : ViewShellBase (_rFrame, pOldShell)
67{
68 // Hide the automatic (non-context sensitive) tool bars.
69 Reference<beans::XPropertySet> xFrameSet (
70 _rFrame.GetFrame().GetFrameInterface(),
71 UNO_QUERY);
72 if (xFrameSet.is())
73 {
74 Reference<beans::XPropertySet> xLayouterSet(xFrameSet->getPropertyValue("LayoutManager"), UNO_QUERY);
75 if (xLayouterSet.is())
76 {
77 xLayouterSet->setPropertyValue("AutomaticToolbars", Any(false));
78 }
79 }
80}
81
83{
84}
85
87{
90}
91
92} // end of namespace sd
93
94/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
SfxFrame & GetFrame() const
virtual void InitializeFramework() override
PresentationViewShellBase(SfxViewFrame &rFrame, SfxViewShell *pOldShell)
This constructor is used by the view factory of the SFX macros.
SfxViewShell descendant that the stacked Draw/Impress shells are based on.
DrawController * GetDrawController() const
static const OUString msPresentationViewURL
static void Initialize(rtl::Reference< sd::DrawController > const &rxController)
Reference< XController > xController
#define SFX_VIEW_REGISTRATION(DocClass)