Line data Source code
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 :
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"
26 :
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>
31 :
32 : using namespace ::com::sun::star;
33 : using namespace ::com::sun::star::uno;
34 :
35 : namespace sd {
36 :
37 : class DrawDocShell;
38 :
39 0 : TYPEINIT1(PresentationViewShellBase, ViewShellBase);
40 :
41 : // We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
42 : // new PresentationViewShellBase object has been constructed.
43 :
44 : SfxViewFactory* PresentationViewShellBase::pFactory;
45 0 : SfxViewShell* PresentationViewShellBase::CreateInstance (
46 : SfxViewFrame *_pFrame, SfxViewShell *pOldView)
47 : {
48 : PresentationViewShellBase* pBase =
49 0 : new PresentationViewShellBase(_pFrame, pOldView);
50 0 : pBase->LateInit(framework::FrameworkHelper::msPresentationViewURL);
51 0 : return pBase;
52 : }
53 21 : void PresentationViewShellBase::RegisterFactory( sal_uInt16 nPrio )
54 : {
55 : pFactory = new SfxViewFactory(
56 21 : &CreateInstance,nPrio,"FullScreenPresentation");
57 21 : InitFactory();
58 21 : }
59 21 : void PresentationViewShellBase::InitFactory()
60 : {
61 21 : SFX_VIEW_REGISTRATION(DrawDocShell);
62 21 : }
63 :
64 0 : PresentationViewShellBase::PresentationViewShellBase (
65 : SfxViewFrame* _pFrame,
66 : SfxViewShell* pOldShell)
67 0 : : ViewShellBase (_pFrame, pOldShell)
68 : {
69 : // Hide the automatic (non-context sensitive) tool bars.
70 : Reference<beans::XPropertySet> xFrameSet (
71 0 : _pFrame->GetFrame().GetFrameInterface(),
72 0 : UNO_QUERY);
73 0 : if (xFrameSet.is())
74 : {
75 0 : Reference<beans::XPropertySet> xLayouterSet(xFrameSet->getPropertyValue("LayoutManager"), UNO_QUERY);
76 0 : if (xLayouterSet.is())
77 : {
78 0 : xLayouterSet->setPropertyValue("AutomaticToolbars", makeAny(sal_False));
79 0 : }
80 0 : }
81 0 : }
82 :
83 0 : PresentationViewShellBase::~PresentationViewShellBase()
84 : {
85 0 : }
86 :
87 0 : void PresentationViewShellBase::InitializeFramework()
88 : {
89 : com::sun::star::uno::Reference<com::sun::star::frame::XController>
90 0 : xController (GetController());
91 0 : sd::framework::PresentationModule::Initialize(xController);
92 0 : }
93 :
94 66 : } // end of namespace sd
95 :
96 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|