/************************************************************************* * * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: mediash.cxx,v $ * * $Revision: 1.5 $ * * last change: $Author: rt $ $Date: 2005-09-09 10:52:03 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. * * * GNU Lesser General Public License Version 2.1 * ============================================= * Copyright 2005 by Sun Microsystems, Inc. * 901 San Antonio Road, Palo Alto, CA 94303, USA * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library 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 for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * ************************************************************************/ #pragma hdrstop #ifndef _CMDID_H #include #endif #ifndef _HINTIDS_HXX #include #endif #ifndef _UIPARAM_HXX #include #endif #ifndef _URLOBJ_HXX //autogen #include #endif #ifndef _MSGBOX_HXX //autogen #include #endif #ifndef _SFXSTRITEM_HXX //autogen #include #endif #ifndef _SFX_WHITER_HXX //autogen #include #endif #ifndef SVTOOLS_URIHELPER_HXX #include #endif #ifndef _SFXDISPATCH_HXX //autogen #include #endif #ifndef _SVX_SIZEITEM_HXX //autogen #include #endif #ifndef _SVX_PROTITEM_HXX //autogen #include #endif #ifndef _SFXREQUEST_HXX //autogen #include #endif #ifndef _SVX_SRCHITEM_HXX #include #endif #ifndef _SVX_HTMLMODE_HXX //autogen #include #endif #ifndef _SDGLUITM_HXX #include #endif #ifndef _SDGCOITM_HXX #include #endif #ifndef _SDGGAITM_HXX #include #endif #ifndef _SDGTRITM_HXX #include #endif #ifndef _SDGINITM_HXX #include #endif #ifndef _SDGMOITM_HXX #include #endif #ifndef _SVX_BRSHITEM_HXX //autogen #include #endif #ifndef _SVX_GRFFLT_HXX //autogen #include #endif #ifndef _FMTURL_HXX //autogen #include #endif #ifndef _VIEW_HXX #include #endif #ifndef _WRTSH_HXX #include #endif #ifndef _VIEWOPT_HXX #include #endif #ifndef _SWMODULE_HXX #include #endif #ifndef _FRMATR_HXX #include #endif #ifndef _SWUNDO_HXX #include #endif #ifndef _UITOOL_HXX #include #endif #ifndef _DOCSH_HXX #include #endif #ifndef _MEDIASH_HXX #include #endif #ifndef _FRMMGR_HXX #include #endif #ifndef _FRMDLG_HXX #include #endif #ifndef _FRMFMT_HXX #include #endif #ifndef _GRFATR_HXX #include #endif #ifndef _USRPREF_HXX #include #endif #ifndef _EDTWIN_HXX #include #endif #ifndef _SWWAIT_HXX #include #endif #ifndef _SHELLS_HRC #include #endif #ifndef _POPUP_HRC #include #endif #include #include #include #include #define SwMediaShell #include "itemdef.hxx" #include "swslots.hxx" #include "swabstdlg.hxx" //CHINA001 SFX_IMPL_INTERFACE(SwMediaShell, SwBaseShell, SW_RES(STR_SHELLNAME_MEDIA)) { SFX_POPUPMENU_REGISTRATION(SW_RES(MN_MEDIA_POPUPMENU)); SFX_OBJECTBAR_REGISTRATION(SFX_OBJECTBAR_OBJECT, SW_RES(RID_MEDIA_TOOLBOX)); //SFX_OBJECTMENU_REGISTRATION(SID_OBJECTMENU0, SW_RES(MN_OBJECTMENU_GRAFIK)); } // ------------------------------------------------------------------------------ void SwMediaShell::ExecMedia(SfxRequest &rReq) { SwWrtShell* pSh = &GetShell(); SdrView* pSdrView = pSh->GetDrawView(); if( pSdrView ) { const SfxItemSet* pArgs = rReq.GetArgs(); USHORT nSlotId = rReq.GetSlot(); BOOL bChanged = pSdrView->GetModel()->IsChanged(); pSdrView->GetModel()->SetChanged( FALSE ); switch( nSlotId ) { case SID_DELETE: { if( pSh->IsObjSelected() ) { pSh->SetModified(); pSh->DelSelectedObj(); if( pSh->IsSelFrmMode() ) pSh->LeaveSelFrmMode(); GetView().AttrChangedNotify( pSh ); } } break; case( SID_AVMEDIA_TOOLBOX ): { if( pSh->IsObjSelected() ) { const SfxPoolItem* pItem; USHORT nSlot = rReq.GetSlot(); if( !pArgs || ( SFX_ITEM_SET != pArgs->GetItemState( SID_AVMEDIA_TOOLBOX, FALSE, &pItem ) ) ) pItem = NULL; if( pItem ) { SdrMarkList* pMarkList = new SdrMarkList( pSdrView->GetMarkedObjectList() ); if( 1 == pMarkList->GetMarkCount() ) { SdrObject* pObj = pMarkList->GetMark( 0 )->GetObj(); if( pObj && pObj->ISA( SdrMediaObj ) ) { static_cast< sdr::contact::ViewContactOfSdrMediaObj& >( pObj->GetViewContact() ).executeMediaItem( static_cast< const ::avmedia::MediaItem& >( *pItem ) ); } } delete pMarkList; } } } break; default: break; } if( pSdrView->GetModel()->IsChanged() ) GetShell().SetModified(); else if( bChanged ) pSdrView->GetModel()->SetChanged(TRUE); } } // ------------------------------------------------------------------------------ void SwMediaShell::GetMediaState(SfxItemSet &rSet) { SfxWhichIter aIter( rSet ); USHORT nWhich = aIter.FirstWhich(); while( nWhich ) { if( SID_AVMEDIA_TOOLBOX == nWhich ) { SwWrtShell& rSh = GetShell(); SdrView* pView = rSh.GetDrawView(); bool bDisable = true; if( pView ) { SdrMarkList* pMarkList = new SdrMarkList( pView->GetMarkedObjectList() ); if( 1 == pMarkList->GetMarkCount() ) { SdrObject* pObj = pMarkList->GetMark( 0 )->GetObj(); if( pObj && pObj->ISA( SdrMediaObj ) ) { ::avmedia::MediaItem aItem( SID_AVMEDIA_TOOLBOX ); static_cast< sdr::contact::ViewContactOfSdrMediaObj& >( pObj->GetViewContact() ).updateMediaItem( aItem ); rSet.Put( aItem ); bDisable = false; } } if( bDisable ) rSet.DisableItem( SID_AVMEDIA_TOOLBOX ); delete pMarkList; } } nWhich = aIter.NextWhich(); } } // ------------------------------------------------------------------------------ SwMediaShell::SwMediaShell(SwView &rView) : SwBaseShell(rView) { SetName(String::CreateFromAscii("Media Playback")); SetHelpId(SW_MEDIASHELL); } ion> LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
F&id=aedaee97a7e4ae9b0c00163c5767ae6ebc937ead'>root/officecfg/registry/data/org/openoffice/Office/Logging.xcu
AgeCommit message (Expand)Author
AgeCommit message (Expand)Author