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