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 : :
30 : : #include "GraphicViewShellBase.hxx"
31 : :
32 : : #include "GraphicDocShell.hxx"
33 : : #include "sdresid.hxx"
34 : : #include "strings.hrc"
35 : : #include "app.hrc"
36 : : #include "framework/DrawModule.hxx"
37 : : #include "framework/FrameworkHelper.hxx"
38 : : #include <sfx2/request.hxx>
39 : :
40 : : namespace sd {
41 : :
42 [ - + ][ + + ]: 5421 : TYPEINIT1(GraphicViewShellBase, ViewShellBase);
43 : :
44 : : // We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
45 : : // new GraphicViewShellBase object has been constructed.
46 : :
47 : : SfxViewFactory* GraphicViewShellBase::pFactory;
48 : 104 : SfxViewShell* GraphicViewShellBase::CreateInstance (
49 : : SfxViewFrame *pFrame, SfxViewShell *pOldView)
50 : : {
51 [ + - ]: 104 : GraphicViewShellBase* pBase = new GraphicViewShellBase(pFrame, pOldView);
52 : 104 : pBase->LateInit(framework::FrameworkHelper::msDrawViewURL);
53 : 104 : return pBase;
54 : : }
55 : 22 : void GraphicViewShellBase::RegisterFactory( sal_uInt16 nPrio )
56 : : {
57 [ + - ]: 22 : pFactory = new SfxViewFactory(&CreateInstance,nPrio,"Default");
58 : 22 : InitFactory();
59 : 22 : }
60 : 22 : void GraphicViewShellBase::InitFactory()
61 : : {
62 : 22 : SFX_VIEW_REGISTRATION(GraphicDocShell);
63 : 22 : }
64 : :
65 : :
66 : :
67 : :
68 : :
69 : :
70 : :
71 : :
72 : 104 : GraphicViewShellBase::GraphicViewShellBase (
73 : : SfxViewFrame* _pFrame,
74 : : SfxViewShell* pOldShell)
75 : 104 : : ViewShellBase (_pFrame, pOldShell)
76 : : {
77 : 104 : }
78 : :
79 : :
80 : :
81 : :
82 : 104 : GraphicViewShellBase::~GraphicViewShellBase (void)
83 : : {
84 [ - + ]: 208 : }
85 : :
86 : :
87 : :
88 : :
89 : 0 : void GraphicViewShellBase::Execute (SfxRequest& rRequest)
90 : : {
91 : 0 : sal_uInt16 nSlotId = rRequest.GetSlot();
92 : :
93 [ # # ]: 0 : switch (nSlotId)
94 : : {
95 : : case SID_NOTES_WINDOW:
96 : : case SID_SLIDE_SORTER_MULTI_PANE_GUI:
97 : : case SID_DIAMODE:
98 : : case SID_OUTLINEMODE:
99 : : case SID_NOTESMODE:
100 : : case SID_HANDOUTMODE:
101 : : case SID_SHOW_TOOL_PANEL:
102 : : // Prevent some Impress-only slots from being executed.
103 : 0 : rRequest.Cancel();
104 : 0 : break;
105 : :
106 : : case SID_TASKPANE:
107 : : case SID_SWITCH_SHELL:
108 : : case SID_LEFT_PANE_DRAW:
109 : : case SID_LEFT_PANE_IMPRESS:
110 : : default:
111 : : // The remaining requests are forwarded to our base class.
112 : 0 : ViewShellBase::Execute (rRequest);
113 : 0 : break;
114 : : }
115 : :
116 : 0 : }
117 : :
118 : :
119 : :
120 : :
121 : 104 : void GraphicViewShellBase::InitializeFramework (void)
122 : : {
123 : : com::sun::star::uno::Reference<com::sun::star::frame::XController>
124 [ + - ]: 104 : xController (GetController());
125 [ + - ]: 104 : sd::framework::DrawModule::Initialize(xController);
126 : 104 : }
127 : :
128 : :
129 : : } // end of namespace sd
130 : :
131 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|