Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include "PresentationViewShellBase.hxx"
30 : : #include "sdresid.hxx"
31 : : #include "DrawDocShell.hxx"
32 : : #include "strings.hrc"
33 : : #include "framework/FrameworkHelper.hxx"
34 : : #include "framework/PresentationModule.hxx"
35 : :
36 : : #include <sfx2/viewfrm.hxx>
37 : : #include <com/sun/star/beans/XPropertySet.hpp>
38 : : #include <com/sun/star/frame/XLayoutManager.hpp>
39 : :
40 : : using namespace ::com::sun::star;
41 : : using namespace ::com::sun::star::uno;
42 : :
43 : : namespace sd {
44 : :
45 : : class DrawDocShell;
46 : :
47 [ # # ][ # # ]: 0 : TYPEINIT1(PresentationViewShellBase, ViewShellBase);
48 : :
49 : : // We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
50 : : // new PresentationViewShellBase object has been constructed.
51 : :
52 : : SfxViewFactory* PresentationViewShellBase::pFactory;
53 : 0 : SfxViewShell* PresentationViewShellBase::CreateInstance (
54 : : SfxViewFrame *_pFrame, SfxViewShell *pOldView)
55 : : {
56 : : PresentationViewShellBase* pBase =
57 [ # # ]: 0 : new PresentationViewShellBase(_pFrame, pOldView);
58 : 0 : pBase->LateInit(framework::FrameworkHelper::msPresentationViewURL);
59 : 0 : return pBase;
60 : : }
61 : 22 : void PresentationViewShellBase::RegisterFactory( sal_uInt16 nPrio )
62 : : {
63 : : pFactory = new SfxViewFactory(
64 [ + - ]: 22 : &CreateInstance,nPrio,"FullScreenPresentation");
65 : 22 : InitFactory();
66 : 22 : }
67 : 22 : void PresentationViewShellBase::InitFactory()
68 : : {
69 : 22 : SFX_VIEW_REGISTRATION(DrawDocShell);
70 : 22 : }
71 : :
72 : :
73 : :
74 : :
75 : 0 : PresentationViewShellBase::PresentationViewShellBase (
76 : : SfxViewFrame* _pFrame,
77 : : SfxViewShell* pOldShell)
78 : 0 : : ViewShellBase (_pFrame, pOldShell)
79 : : {
80 : : // Hide the automatic (non-context sensitive) tool bars.
81 [ # # ]: 0 : if (_pFrame!=NULL)
82 : : {
83 : : Reference<beans::XPropertySet> xFrameSet (
84 [ # # ]: 0 : _pFrame->GetFrame().GetFrameInterface(),
85 [ # # ][ # # ]: 0 : UNO_QUERY);
86 [ # # ]: 0 : if (xFrameSet.is())
87 : : {
88 [ # # ][ # # ]: 0 : Reference<beans::XPropertySet> xLayouterSet(xFrameSet->getPropertyValue("LayoutManager"), UNO_QUERY);
[ # # ]
89 [ # # ]: 0 : if (xLayouterSet.is())
90 : : {
91 [ # # ][ # # ]: 0 : xLayouterSet->setPropertyValue("AutomaticToolbars", makeAny(sal_False));
[ # # ]
92 : 0 : }
93 : 0 : }
94 : : }
95 : 0 : }
96 : :
97 : :
98 : :
99 : :
100 : 0 : PresentationViewShellBase::~PresentationViewShellBase (void)
101 : : {
102 [ # # ]: 0 : }
103 : :
104 : :
105 : :
106 : 0 : void PresentationViewShellBase::InitializeFramework (void)
107 : : {
108 : : com::sun::star::uno::Reference<com::sun::star::frame::XController>
109 [ # # ]: 0 : xController (GetController());
110 [ # # ]: 0 : sd::framework::PresentationModule::Initialize(xController);
111 : 0 : }
112 : :
113 : : } // end of namespace sd
114 : :
115 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|