1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sd.hxx"
26 
27 #include "GraphicViewShellBase.hxx"
28 
29 #include "GraphicDocShell.hxx"
30 #include "sdresid.hxx"
31 #include "strings.hrc"
32 #include "app.hrc"
33 #include "framework/DrawModule.hxx"
34 #include "framework/FrameworkHelper.hxx"
35 #include <sfx2/request.hxx>
36 
37 namespace sd {
38 
39 TYPEINIT1(GraphicViewShellBase, ViewShellBase);
40 
41 // We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
42 // new GraphicViewShellBase object has been constructed.
43 
44 SfxViewFactory* GraphicViewShellBase::pFactory;
45 SfxViewShell* __EXPORT GraphicViewShellBase::CreateInstance (
46     SfxViewFrame *pFrame, SfxViewShell *pOldView)
47 {
48     GraphicViewShellBase* pBase = new GraphicViewShellBase(pFrame, pOldView);
49     pBase->LateInit(framework::FrameworkHelper::msDrawViewURL);
50     return pBase;
51 }
52 void GraphicViewShellBase::RegisterFactory( sal_uInt16 nPrio )
53 {
54     pFactory = new SfxViewFactory(
55         &CreateInstance,&InitFactory,nPrio,"Default");
56     InitFactory();
57 }
58 void GraphicViewShellBase::InitFactory()
59 {
60 	SFX_VIEW_REGISTRATION(GraphicDocShell);
61 }
62 
63 
64 
65 
66 
67 
68 
69 
70 GraphicViewShellBase::GraphicViewShellBase (
71     SfxViewFrame* _pFrame,
72     SfxViewShell* pOldShell)
73     : ViewShellBase (_pFrame, pOldShell)
74 {
75 }
76 
77 
78 
79 
80 GraphicViewShellBase::~GraphicViewShellBase (void)
81 {
82 }
83 
84 
85 
86 
87 void GraphicViewShellBase::Execute (SfxRequest& rRequest)
88 {
89 	sal_uInt16 nSlotId = rRequest.GetSlot();
90 
91 	switch (nSlotId)
92     {
93         case SID_NOTES_WINDOW:
94         case SID_SLIDE_SORTER_MULTI_PANE_GUI:
95         case SID_DIAMODE:
96         case SID_OUTLINEMODE:
97         case SID_NOTESMODE:
98         case SID_HANDOUTMODE:
99         case SID_SHOW_TOOL_PANEL:
100             // Prevent some Impress-only slots from being executed.
101             rRequest.Cancel();
102             break;
103 
104         case SID_TASKPANE:
105         case SID_SWITCH_SHELL:
106         case SID_LEFT_PANE_DRAW:
107         case SID_LEFT_PANE_IMPRESS:
108         default:
109             // The remaining requests are forwarded to our base class.
110             ViewShellBase::Execute (rRequest);
111             break;
112     }
113 
114 }
115 
116 
117 
118 
119 void GraphicViewShellBase::InitializeFramework (void)
120 {
121     com::sun::star::uno::Reference<com::sun::star::frame::XController>
122         xController (GetController());
123     sd::framework::DrawModule::Initialize(xController);
124 }
125 
126 
127 } // end of namespace sd
128 
129