2004-01-20 05:37:41 -06:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 16:56:30 -05:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2004-01-20 05:37:41 -06:00
|
|
|
*
|
2010-02-12 08:01:35 -06:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2004-01-20 05:37:41 -06:00
|
|
|
*
|
2008-04-10 16:56:30 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2004-01-20 05:37:41 -06:00
|
|
|
*
|
2008-04-10 16:56:30 -05:00
|
|
|
* This file is part of OpenOffice.org.
|
2004-01-20 05:37:41 -06:00
|
|
|
*
|
2008-04-10 16:56:30 -05:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2004-01-20 05:37:41 -06:00
|
|
|
*
|
2008-04-10 16:56:30 -05:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2004-01-20 05:37:41 -06:00
|
|
|
*
|
2008-04-10 16:56:30 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2004-01-20 05:37:41 -06:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-16 13:30:18 -05:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_sd.hxx"
|
|
|
|
|
2004-01-20 05:37:41 -06:00
|
|
|
#include "GraphicViewShellBase.hxx"
|
|
|
|
|
2007-04-03 10:26:05 -05:00
|
|
|
#include "GraphicDocShell.hxx"
|
2004-01-20 05:37:41 -06:00
|
|
|
#include "sdresid.hxx"
|
|
|
|
#include "strings.hrc"
|
2004-11-26 13:29:54 -06:00
|
|
|
#include "app.hrc"
|
2007-04-03 10:26:05 -05:00
|
|
|
#include "framework/DrawModule.hxx"
|
|
|
|
#include "framework/FrameworkHelper.hxx"
|
2004-11-26 13:29:54 -06:00
|
|
|
#include <sfx2/request.hxx>
|
2004-01-20 05:37:41 -06:00
|
|
|
|
|
|
|
namespace sd {
|
|
|
|
|
|
|
|
TYPEINIT1(GraphicViewShellBase, ViewShellBase);
|
|
|
|
|
2004-07-13 08:50:17 -05:00
|
|
|
// We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
|
|
|
|
// new GraphicViewShellBase object has been constructed.
|
|
|
|
|
|
|
|
/*
|
2004-01-20 05:37:41 -06:00
|
|
|
SFX_IMPL_VIEWFACTORY(GraphicViewShellBase, SdResId(STR_DEFAULTVIEW))
|
|
|
|
{
|
|
|
|
SFX_VIEW_REGISTRATION(GraphicDocShell);
|
|
|
|
}
|
2004-07-13 08:50:17 -05:00
|
|
|
*/
|
|
|
|
SfxViewFactory* GraphicViewShellBase::pFactory;
|
|
|
|
SfxViewShell* __EXPORT GraphicViewShellBase::CreateInstance (
|
|
|
|
SfxViewFrame *pFrame, SfxViewShell *pOldView)
|
|
|
|
{
|
|
|
|
GraphicViewShellBase* pBase = new GraphicViewShellBase(pFrame, pOldView);
|
2007-04-03 10:26:05 -05:00
|
|
|
pBase->LateInit(framework::FrameworkHelper::msDrawViewURL);
|
2004-07-13 08:50:17 -05:00
|
|
|
return pBase;
|
|
|
|
}
|
|
|
|
void GraphicViewShellBase::RegisterFactory( USHORT nPrio )
|
|
|
|
{
|
|
|
|
pFactory = new SfxViewFactory(
|
|
|
|
&CreateInstance,&InitFactory,nPrio,SdResId(STR_DEFAULTVIEW));
|
|
|
|
InitFactory();
|
|
|
|
}
|
|
|
|
void GraphicViewShellBase::InitFactory()
|
|
|
|
{
|
|
|
|
SFX_VIEW_REGISTRATION(GraphicDocShell);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2004-01-20 05:37:41 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GraphicViewShellBase::GraphicViewShellBase (
|
2006-12-12 12:04:47 -06:00
|
|
|
SfxViewFrame* _pFrame,
|
2004-01-20 05:37:41 -06:00
|
|
|
SfxViewShell* pOldShell)
|
2007-04-03 10:26:05 -05:00
|
|
|
: ViewShellBase (_pFrame, pOldShell)
|
2004-07-13 08:50:17 -05:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2004-01-20 05:37:41 -06:00
|
|
|
GraphicViewShellBase::~GraphicViewShellBase (void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2004-11-26 13:29:54 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void GraphicViewShellBase::Execute (SfxRequest& rRequest)
|
|
|
|
{
|
|
|
|
USHORT nSlotId = rRequest.GetSlot();
|
|
|
|
|
|
|
|
switch (nSlotId)
|
|
|
|
{
|
2006-03-21 10:37:04 -06:00
|
|
|
case SID_NOTES_WINDOW:
|
|
|
|
case SID_SLIDE_SORTER_MULTI_PANE_GUI:
|
|
|
|
case SID_DIAMODE:
|
|
|
|
case SID_OUTLINEMODE:
|
|
|
|
case SID_NOTESMODE:
|
|
|
|
case SID_HANDOUTMODE:
|
2010-04-16 08:14:15 -05:00
|
|
|
case SID_SHOW_TOOL_PANEL:
|
2006-03-21 10:37:04 -06:00
|
|
|
// Prevent some Impress-only slots from being executed.
|
2004-11-26 13:29:54 -06:00
|
|
|
rRequest.Cancel();
|
|
|
|
break;
|
|
|
|
|
2010-04-16 08:14:15 -05:00
|
|
|
case SID_TASKPANE:
|
2006-03-21 10:37:04 -06:00
|
|
|
case SID_SWITCH_SHELL:
|
|
|
|
case SID_LEFT_PANE_DRAW:
|
2006-07-13 04:31:01 -05:00
|
|
|
case SID_LEFT_PANE_IMPRESS:
|
2004-11-26 13:29:54 -06:00
|
|
|
default:
|
2007-04-03 10:26:05 -05:00
|
|
|
// The remaining requests are forwarded to our base class.
|
2004-11-26 13:29:54 -06:00
|
|
|
ViewShellBase::Execute (rRequest);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-04-03 10:26:05 -05:00
|
|
|
|
|
|
|
|
|
|
|
void GraphicViewShellBase::InitializeFramework (void)
|
|
|
|
{
|
|
|
|
com::sun::star::uno::Reference<com::sun::star::frame::XController>
|
|
|
|
xController (GetController());
|
|
|
|
sd::framework::DrawModule::Initialize(xController);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-01-20 05:37:41 -06:00
|
|
|
} // end of namespace sd
|
|
|
|
|