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