fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / sd / source / ui / view / ImpressViewShellBase.cxx
blob7e281440a96c8b6842830495381bb35dad96686c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #include "ImpressViewShellBase.hxx"
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>
32 namespace sd {
34 TYPEINIT1(ImpressViewShellBase, ViewShellBase);
36 // We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
37 // new ImpressViewShellBase object has been constructed.
39 SfxViewFactory* ImpressViewShellBase::pFactory;
40 SfxViewShell* ImpressViewShellBase::CreateInstance (
41 SfxViewFrame *pFrame, SfxViewShell *pOldView)
43 ImpressViewShellBase* pBase = new ImpressViewShellBase(pFrame, pOldView);
44 pBase->LateInit("");
45 return pBase;
47 void ImpressViewShellBase::RegisterFactory( sal_uInt16 nPrio )
49 pFactory = new SfxViewFactory(&CreateInstance,nPrio,"Default");
50 InitFactory();
52 void ImpressViewShellBase::InitFactory()
54 SFX_VIEW_REGISTRATION(DrawDocShell);
64 ImpressViewShellBase::ImpressViewShellBase (
65 SfxViewFrame* _pFrame,
66 SfxViewShell* pOldShell)
67 : ViewShellBase (_pFrame, pOldShell)
69 MasterPageObserver::Instance().RegisterDocument (*GetDocShell()->GetDoc());
75 ImpressViewShellBase::~ImpressViewShellBase (void)
77 MasterPageObserver::Instance().UnregisterDocument (*GetDocShell()->GetDoc());
83 void ImpressViewShellBase::Execute (SfxRequest& rRequest)
85 sal_uInt16 nSlotId = rRequest.GetSlot();
87 switch (nSlotId)
89 case SID_LEFT_PANE_DRAW:
90 // Prevent a Draw-only slots from being executed.
91 rRequest.Cancel();
92 break;
94 default:
95 // The remaining requests are forwarded to our base class.
96 ViewShellBase::Execute(rRequest);
97 break;
104 void ImpressViewShellBase::InitializeFramework (void)
106 ::com::sun::star::uno::Reference<com::sun::star::frame::XController>
107 xController (GetController());
108 sd::framework::ImpressModule::Initialize(xController);
111 } // end of namespace sd
113 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */