2000-09-18 16:15:01 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 17:51:33 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 16:15:01 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2000-09-18 16:15:01 +00:00
|
|
|
*
|
2008-04-10 17:51:33 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 16:15:01 +00:00
|
|
|
*
|
2008-04-10 17:51:33 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 16:15:01 +00:00
|
|
|
*
|
2008-04-10 17:51:33 +00: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.
|
2000-09-18 16:15:01 +00:00
|
|
|
*
|
2008-04-10 17:51:33 +00: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).
|
2000-09-18 16:15:01 +00:00
|
|
|
*
|
2008-04-10 17:51:33 +00: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.
|
2000-09-18 16:15:01 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-16 21:49:23 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_sw.hxx"
|
|
|
|
|
2004-08-23 07:48:58 +00:00
|
|
|
#ifdef SW_DLLIMPLEMENTATION
|
|
|
|
#undef SW_DLLIMPLEMENTATION
|
|
|
|
#endif
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
#include "hintids.hxx"
|
|
|
|
|
|
|
|
#define _SVSTDARR_STRINGSDTOR
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/svstdarr.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
#include <svx/htmlmode.hxx>
|
|
|
|
#include <svx/svxids.hrc>
|
|
|
|
#include <sfx2/app.hxx>
|
|
|
|
#include <vcl/msgbox.hxx>
|
|
|
|
|
|
|
|
#include "swtypes.hxx"
|
|
|
|
#include "wrtsh.hxx"
|
|
|
|
#include "viewopt.hxx"
|
|
|
|
#include "macassgn.hxx"
|
|
|
|
#include "swevent.hxx"
|
|
|
|
#include "docsh.hxx"
|
|
|
|
#include "globals.hrc"
|
2009-05-06 10:59:57 +00:00
|
|
|
#include "view.hxx"
|
|
|
|
#include <sfx2/viewfrm.hxx>
|
|
|
|
|
|
|
|
#include <svx/svxdlg.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2008-09-30 12:22:37 +00:00
|
|
|
#include <doc.hxx>
|
|
|
|
|
|
|
|
using ::com::sun::star::uno::Reference;
|
|
|
|
using ::com::sun::star::frame::XFrame;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2009-05-06 10:59:57 +00:00
|
|
|
// SvStringsDtor* __EXPORT _GetRangeHdl( _SfxMacroTabPage*, const String& );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2009-05-06 10:59:57 +00:00
|
|
|
SfxEventNamesItem SwMacroAssignDlg::AddEvents( DlgEventType eType )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2009-05-06 10:59:57 +00:00
|
|
|
// const SfxItemSet& rSet = rPg.GetItemSet();
|
|
|
|
SfxEventNamesItem aItem(SID_EVENTCONFIG);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
BOOL bHtmlMode = FALSE;
|
|
|
|
USHORT nHtmlMode = ::GetHtmlMode((const SwDocShell*)SfxObjectShell::Current());
|
|
|
|
bHtmlMode = nHtmlMode & HTMLMODE_ON ? TRUE : FALSE;
|
|
|
|
|
|
|
|
switch( eType )
|
|
|
|
{
|
|
|
|
case MACASSGN_TEXTBAUST: // Textbausteine
|
2009-05-06 10:59:57 +00:00
|
|
|
// rPg.SetGetRangeLink( &_GetRangeHdl );
|
|
|
|
aItem.AddEvent( String( SW_RES(STR_EVENT_START_INS_GLOSSARY) ), String(),
|
2000-09-18 16:15:01 +00:00
|
|
|
SW_EVENT_START_INS_GLOSSARY );
|
2009-05-06 10:59:57 +00:00
|
|
|
aItem.AddEvent( String( SW_RES(STR_EVENT_END_INS_GLOSSARY) ), String(),
|
2000-09-18 16:15:01 +00:00
|
|
|
SW_EVENT_END_INS_GLOSSARY);
|
|
|
|
// damit der neue Handler aktiv wird!
|
2009-05-06 10:59:57 +00:00
|
|
|
// rPg.Reset( rSet );
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
|
|
|
case MACASSGN_ALLFRM:
|
|
|
|
case MACASSGN_GRAPHIC: // Grafiken
|
|
|
|
{
|
2009-05-06 10:59:57 +00:00
|
|
|
aItem.AddEvent( String( SW_RES(STR_EVENT_IMAGE_ERROR) ), String(),
|
2000-09-18 16:15:01 +00:00
|
|
|
SVX_EVENT_IMAGE_ERROR);
|
2009-05-06 10:59:57 +00:00
|
|
|
aItem.AddEvent( String( SW_RES(STR_EVENT_IMAGE_ABORT) ), String(),
|
2000-09-18 16:15:01 +00:00
|
|
|
SVX_EVENT_IMAGE_ABORT);
|
2009-05-06 10:59:57 +00:00
|
|
|
aItem.AddEvent( String( SW_RES(STR_EVENT_IMAGE_LOAD) ), String(),
|
2000-09-18 16:15:01 +00:00
|
|
|
SVX_EVENT_IMAGE_LOAD);
|
|
|
|
}
|
|
|
|
// kein break;
|
|
|
|
case MACASSGN_FRMURL: // Frm - URL-Attribute
|
|
|
|
{
|
|
|
|
if( !bHtmlMode &&
|
|
|
|
(MACASSGN_FRMURL == eType || MACASSGN_ALLFRM == eType))
|
|
|
|
{
|
2009-05-06 10:59:57 +00:00
|
|
|
aItem.AddEvent( String( SW_RES( STR_EVENT_FRM_KEYINPUT_A ) ), String(),
|
2000-09-18 16:15:01 +00:00
|
|
|
SW_EVENT_FRM_KEYINPUT_ALPHA );
|
2009-05-06 10:59:57 +00:00
|
|
|
aItem.AddEvent( String( SW_RES( STR_EVENT_FRM_KEYINPUT_NOA ) ), String(),
|
2000-09-18 16:15:01 +00:00
|
|
|
SW_EVENT_FRM_KEYINPUT_NOALPHA );
|
2009-05-06 10:59:57 +00:00
|
|
|
aItem.AddEvent( String( SW_RES( STR_EVENT_FRM_RESIZE ) ), String(),
|
2000-09-18 16:15:01 +00:00
|
|
|
SW_EVENT_FRM_RESIZE );
|
2009-05-06 10:59:57 +00:00
|
|
|
aItem.AddEvent( String( SW_RES( STR_EVENT_FRM_MOVE ) ), String(),
|
2000-09-18 16:15:01 +00:00
|
|
|
SW_EVENT_FRM_MOVE );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// kein break;
|
|
|
|
case MACASSGN_OLE: // OLE
|
|
|
|
{
|
|
|
|
if( !bHtmlMode )
|
2009-05-06 10:59:57 +00:00
|
|
|
aItem.AddEvent( String( SW_RES(STR_EVENT_OBJECT_SELECT) ), String(),
|
2000-09-18 16:15:01 +00:00
|
|
|
SW_EVENT_OBJECT_SELECT );
|
|
|
|
}
|
|
|
|
// kein break;
|
|
|
|
case MACASSGN_INETFMT: // INetFmt-Attribute
|
|
|
|
{
|
2009-05-06 10:59:57 +00:00
|
|
|
aItem.AddEvent( String( SW_RES(STR_EVENT_MOUSEOVER_OBJECT) ), String(),
|
2000-09-18 16:15:01 +00:00
|
|
|
SFX_EVENT_MOUSEOVER_OBJECT );
|
2009-05-06 10:59:57 +00:00
|
|
|
aItem.AddEvent( String( SW_RES(STR_EVENT_MOUSECLICK_OBJECT) ), String(),
|
2000-09-18 16:15:01 +00:00
|
|
|
SFX_EVENT_MOUSECLICK_OBJECT);
|
2009-05-06 10:59:57 +00:00
|
|
|
aItem.AddEvent( String( SW_RES(STR_EVENT_MOUSEOUT_OBJECT) ), String(),
|
2000-09-18 16:15:01 +00:00
|
|
|
SFX_EVENT_MOUSEOUT_OBJECT);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2009-05-06 10:59:57 +00:00
|
|
|
|
|
|
|
return aItem;
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
BOOL SwMacroAssignDlg::INetFmtDlg( Window* pParent, SwWrtShell& rSh,
|
|
|
|
SvxMacroItem*& rpINetItem )
|
|
|
|
{
|
|
|
|
BOOL bRet = FALSE;
|
2009-05-06 10:59:57 +00:00
|
|
|
SfxItemSet aSet( rSh.GetAttrPool(), RES_FRMMACRO, RES_FRMMACRO, SID_EVENTCONFIG, SID_EVENTCONFIG, 0 );
|
2007-05-10 15:15:42 +00:00
|
|
|
SvxMacroItem aItem( RES_FRMMACRO );
|
2000-09-18 16:15:01 +00:00
|
|
|
if( !rpINetItem )
|
2007-05-10 15:15:42 +00:00
|
|
|
rpINetItem = new SvxMacroItem( RES_FRMMACRO );
|
2000-09-18 16:15:01 +00:00
|
|
|
else
|
|
|
|
aItem.SetMacroTable( rpINetItem->GetMacroTable() );
|
|
|
|
|
|
|
|
aSet.Put( aItem );
|
2009-05-06 10:59:57 +00:00
|
|
|
aSet.Put( AddEvents( MACASSGN_INETFMT ) );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2009-05-06 10:59:57 +00:00
|
|
|
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
|
|
|
|
SfxAbstractDialog* pMacroDlg = pFact->CreateSfxDialog( pParent, aSet,
|
2009-12-15 23:07:57 +01:00
|
|
|
rSh.GetView().GetViewFrame()->GetFrame().GetFrameInterface(),
|
2009-05-06 10:59:57 +00:00
|
|
|
SID_EVENTCONFIG );
|
|
|
|
if ( pMacroDlg && pMacroDlg->Execute() == RET_OK )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2009-05-06 10:59:57 +00:00
|
|
|
const SfxItemSet* pOutSet = pMacroDlg->GetOutputItemSet();
|
2000-09-18 16:15:01 +00:00
|
|
|
const SfxPoolItem* pItem;
|
|
|
|
if( SFX_ITEM_SET == pOutSet->GetItemState( RES_FRMMACRO, FALSE, &pItem ))
|
|
|
|
{
|
|
|
|
rpINetItem->SetMacroTable( ((SvxMacroItem*)pItem)->GetMacroTable() );
|
|
|
|
bRet = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return bRet;
|
|
|
|
}
|
|
|
|
|