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