Update ooo320-m1
[ooovba.git] / sd / source / ui / view / drviews6.cxx
blob5f8e75d2d838ef2fd7bf8e2c4e2cfa5625d56526
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: drviews6.cxx,v $
10 * $Revision: 1.29 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sd.hxx"
34 #include "DrawViewShell.hxx"
35 #include <vcl/metaact.hxx>
36 #include <sfx2/request.hxx>
37 #include <sfx2/dispatch.hxx>
38 #include <vcl/msgbox.hxx>
39 #include <sfx2/viewfrm.hxx>
40 #include <svx/svdograf.hxx>
41 #ifndef _SVXIDS_HXX
42 #include <svx/svxids.hrc>
43 #endif
44 #ifndef _FONTWORK_HXX
45 #include <svx/fontwork.hxx>
46 #endif
47 #ifndef _BMPMASK_HXX
48 #include <svx/bmpmask.hxx>
49 #endif
50 #ifndef _SVX_GALBRWS_HXX
51 #include <svx/galbrws.hxx>
52 #endif
53 #ifndef _IMAPDLG_HXX
54 #include <svx/imapdlg.hxx>
55 #endif
56 #include <svx/xftsfit.hxx>
57 #include <svx/colrctrl.hxx>
58 #include <svx/f3dchild.hxx>
59 #include "optsitem.hxx"
60 #include <svx/extrusionbar.hxx>
61 #include <svx/fontworkbar.hxx>
62 #include <svx/tbxcustomshapes.hxx>
63 #ifndef _AVMEDIA_MEDIAPLAYER_HXX
64 #include <avmedia/mediaplayer.hxx>
65 #endif
67 #include "app.hrc"
68 #include "strings.hrc"
69 #include "glob.hrc"
71 #include "app.hxx"
72 #include "animobjs.hxx"
73 #include "AnimationChildWindow.hxx"
74 #include "NavigatorChildWindow.hxx"
75 #include "LayerDialogChildWindow.hxx"
76 #include "sdresid.hxx"
77 #include "fupoor.hxx"
78 #include "fusldlg.hxx"
79 #include "drawdoc.hxx"
80 #include "fuexpand.hxx"
81 #include "fusumry.hxx"
82 #include "fucushow.hxx"
83 #include "drawview.hxx"
84 #ifndef SD_FRAME_VIEW
85 #include "FrameView.hxx"
86 #endif
87 #include "Window.hxx"
88 #include "fuformatpaintbrush.hxx"
89 #include "formatclipboard.hxx"
90 #include "DrawDocShell.hxx"
91 #include "TaskPaneViewShell.hxx"
92 #include "framework/FrameworkHelper.hxx"
94 namespace sd {
96 /*************************************************************************
98 |* SfxRequests fuer FontWork bearbeiten
100 \************************************************************************/
102 void DrawViewShell::ExecFormText(SfxRequest& rReq)
104 // waehrend einer Diashow wird nichts ausgefuehrt!
105 if(HasCurrentFunction(SID_PRESENTATION))
106 return;
108 CheckLineTo (rReq);
110 const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
112 if ( rMarkList.GetMarkCount() == 1 && rReq.GetArgs() &&
113 mpDrawView && !mpDrawView->IsPresObjSelected() )
115 const SfxItemSet& rSet = *rReq.GetArgs();
116 const SfxPoolItem* pItem;
118 if ( mpDrawView->IsTextEdit() )
119 mpDrawView->SdrEndTextEdit();
121 if ( rSet.GetItemState(XATTR_FORMTXTSTDFORM, TRUE, &pItem) ==
122 SFX_ITEM_SET &&
123 ((const XFormTextStdFormItem*) pItem)->GetValue() != XFTFORM_NONE )
126 USHORT nId = SvxFontWorkChildWindow::GetChildWindowId();
128 SvxFontWorkDialog* pDlg = (SvxFontWorkDialog*)GetViewFrame()->
129 GetChildWindow(nId)->GetWindow();
131 pDlg->CreateStdFormObj(*mpDrawView, *mpDrawView->GetSdrPageView(),
132 rSet, *rMarkList.GetMark(0)->GetMarkedSdrObj(),
133 ((const XFormTextStdFormItem*) pItem)->
134 GetValue());
136 if(HasCurrentFunction(SID_BEZIER_EDIT))
137 { // ggf. die richtige Editfunktion aktivieren
138 GetViewFrame()->GetDispatcher()->Execute(SID_SWITCH_POINTEDIT,
139 SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
142 else
143 mpDrawView->SetAttributes(rSet);
147 /*************************************************************************
149 |* Statuswerte fuer FontWork zurueckgeben
151 \************************************************************************/
153 void DrawViewShell::GetFormTextState(SfxItemSet& rSet)
155 const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
156 const SdrObject* pObj = NULL;
157 SvxFontWorkDialog* pDlg = NULL;
159 USHORT nId = SvxFontWorkChildWindow::GetChildWindowId();
161 if ( GetViewFrame()->HasChildWindow(nId) )
162 pDlg = (SvxFontWorkDialog*)(GetViewFrame()->GetChildWindow(nId)->GetWindow());
164 if ( rMarkList.GetMarkCount() == 1 )
165 pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
167 if ( pObj == NULL || !pObj->ISA(SdrTextObj) ||
168 !((SdrTextObj*) pObj)->HasText() )
170 // automatisches Auf/Zuklappen des FontWork-Dialog; erstmal deaktiviert
171 // if ( pDlg )
172 // pDlg->SetActive(FALSE);
174 rSet.DisableItem(XATTR_FORMTXTSTYLE);
175 rSet.DisableItem(XATTR_FORMTXTADJUST);
176 rSet.DisableItem(XATTR_FORMTXTDISTANCE);
177 rSet.DisableItem(XATTR_FORMTXTSTART);
178 rSet.DisableItem(XATTR_FORMTXTMIRROR);
179 rSet.DisableItem(XATTR_FORMTXTSTDFORM);
180 rSet.DisableItem(XATTR_FORMTXTHIDEFORM);
181 rSet.DisableItem(XATTR_FORMTXTOUTLINE);
182 rSet.DisableItem(XATTR_FORMTXTSHADOW);
183 rSet.DisableItem(XATTR_FORMTXTSHDWCOLOR);
184 rSet.DisableItem(XATTR_FORMTXTSHDWXVAL);
185 rSet.DisableItem(XATTR_FORMTXTSHDWYVAL);
187 else
189 if ( pDlg )
191 // pDlg->SetActive();
192 pDlg->SetColorTable(GetDoc()->GetColorTable());
195 SfxItemSet aSet( GetDoc()->GetPool() );
196 mpDrawView->GetAttributes( aSet );
197 rSet.Set( aSet );
201 /*************************************************************************
203 |* SfxRequests fuer Objektpalette bearbeiten
205 \************************************************************************/
207 void DrawViewShell::ExecObjPalette( SfxRequest& )
209 // Diese Methode muss erhalten bleiben, bis
210 // der/die Slots entfernt wurden;
211 // ==> Voll-Update
214 /*************************************************************************
216 |* Statuswerte fuer Objektpalette zurueckgeben
218 \************************************************************************/
220 void DrawViewShell::GetObjPaletteState(SfxItemSet& )
222 // Diese Methode muss erhalten bleiben, bis
223 // der/die Slots entfernt wurden;
224 // ==> Voll-Update
227 /*************************************************************************
229 |* SfxRequests fuer Animator bearbeiten
231 \************************************************************************/
233 void DrawViewShell::ExecAnimationWin( SfxRequest& rReq )
235 // waehrend einer Diashow wird nichts ausgefuehrt!
236 if (HasCurrentFunction(SID_PRESENTATION))
237 return;
239 CheckLineTo (rReq);
241 USHORT nSId = rReq.GetSlot();
243 switch( nSId )
245 case SID_ANIMATOR_INIT:
246 case SID_ANIMATOR_ADD:
247 case SID_ANIMATOR_CREATE:
249 AnimationWindow* pAnimWin;
250 USHORT nId = AnimationChildWindow::GetChildWindowId();
251 //((const SfxUInt16Item&)(rReq.GetArgs()->Get(nSId))).GetValue();
253 pAnimWin = static_cast<AnimationWindow*>(
254 GetViewFrame()->GetChildWindow(nId)->GetWindow());
256 if ( pAnimWin )
258 if( nSId == SID_ANIMATOR_ADD )
259 pAnimWin->AddObj( *mpDrawView );
260 else if( nSId == SID_ANIMATOR_CREATE )
261 pAnimWin->CreateAnimObj( *mpDrawView );
264 break;
266 default:
267 break;
271 /*************************************************************************
273 |* Statuswerte fuer Animator zurueckgeben
275 |* nValue == 0 -> Kein Button
276 |* nValue == 1 -> Button 'uebernehmen'
277 |* nValue == 2 -> Button 'einzeln uebernehmen'
278 |* nValue == 3 -> Buttons 'uebernehmen' und 'einzeln uebernehmen'
280 \************************************************************************/
282 void DrawViewShell::GetAnimationWinState( SfxItemSet& rSet )
284 // Hier koennten Buttons etc. disabled werden
285 UINT16 nValue;
287 const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
288 ULONG nMarkCount = rMarkList.GetMarkCount();
290 if( nMarkCount == 0 )
291 nValue = 0;
292 else if( nMarkCount > 1 )
293 nValue = 3;
294 else // 1 Objekt
296 const SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
297 UINT32 nInv = pObj->GetObjInventor();
298 UINT16 nId = pObj->GetObjIdentifier();
299 // 1 selektiertes Gruppenobjekt
300 if( nInv == SdrInventor && nId == OBJ_GRUP )
301 nValue = 3;
302 else if( nInv == SdrInventor && nId == OBJ_GRAF ) // Anim. GIF ?
304 USHORT nCount = 0;
306 if( ( (SdrGrafObj*) pObj )->IsAnimated() )
307 nCount = ( (SdrGrafObj*) pObj )->GetGraphic().GetAnimation().Count();
308 if( nCount > 0 )
309 nValue = 2;
310 else
311 nValue = 1;
313 else
314 nValue = 1;
316 rSet.Put( SfxUInt16Item( SID_ANIMATOR_STATE, nValue ) );
319 /*************************************************************************
321 |* Statuswerte fuer SfxChildWindows setzen
323 \************************************************************************/
325 void DrawViewShell::SetChildWindowState( SfxItemSet& rSet )
327 // Stati der SfxChild-Windows (Animator, Fontwork etc.)
328 if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_FONTWORK ) )
330 USHORT nId = SvxFontWorkChildWindow::GetChildWindowId();
331 rSet.Put(SfxBoolItem(SID_FONTWORK, GetViewFrame()->HasChildWindow(nId)));
333 if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_COLOR_CONTROL ) )
335 USHORT nId = SvxColorChildWindow::GetChildWindowId();
336 rSet.Put(SfxBoolItem(SID_COLOR_CONTROL, GetViewFrame()->HasChildWindow(nId)));
338 if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_ANIMATION_OBJECTS ) )
340 USHORT nId = AnimationChildWindow::GetChildWindowId();
341 rSet.Put( SfxBoolItem( SID_ANIMATION_OBJECTS, GetViewFrame()->HasChildWindow( nId ) ) );
343 if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_NAVIGATOR ) )
345 USHORT nId = SID_NAVIGATOR;
346 rSet.Put( SfxBoolItem( SID_NAVIGATOR, GetViewFrame()->HasChildWindow( nId ) ) );
348 if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_BMPMASK ) )
350 USHORT nId = SvxBmpMaskChildWindow::GetChildWindowId();
351 rSet.Put( SfxBoolItem( SID_BMPMASK, GetViewFrame()->HasChildWindow( nId ) ) );
353 if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_GALLERY ) )
355 USHORT nId = GalleryChildWindow::GetChildWindowId();
356 rSet.Put( SfxBoolItem( SID_GALLERY, GetViewFrame()->HasChildWindow( nId ) ) );
358 if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_IMAP ) )
360 USHORT nId = SvxIMapDlgChildWindow::GetChildWindowId();
361 rSet.Put( SfxBoolItem( SID_IMAP, GetViewFrame()->HasChildWindow( nId ) ) );
363 if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_LAYER_DIALOG_WIN ) )
365 USHORT nId = LayerDialogChildWindow::GetChildWindowId();
366 rSet.Put( SfxBoolItem( SID_LAYER_DIALOG_WIN, GetViewFrame()->HasChildWindow( nId ) ) );
368 if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_3D_WIN ) )
370 USHORT nId = Svx3DChildWindow::GetChildWindowId();
371 rSet.Put( SfxBoolItem( SID_3D_WIN, GetViewFrame()->HasChildWindow( nId ) ) );
373 if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_AVMEDIA_PLAYER ) )
375 USHORT nId = ::avmedia::MediaPlayer::GetChildWindowId();
376 rSet.Put( SfxBoolItem( SID_AVMEDIA_PLAYER, GetViewFrame()->HasChildWindow( nId ) ) );
381 /*************************************************************************
383 |* SfxRequests fuer Pipette bearbeiten
385 \************************************************************************/
387 void DrawViewShell::ExecBmpMask( SfxRequest& rReq )
389 // waehrend einer Diashow wird nichts ausgefuehrt!
390 if (HasCurrentFunction(SID_PRESENTATION))
391 return;
393 switch ( rReq.GetSlot() )
395 case ( SID_BMPMASK_PIPETTE ) :
397 mbPipette = ( (const SfxBoolItem&) ( rReq.GetArgs()->
398 Get( SID_BMPMASK_PIPETTE ) ) ).GetValue();
400 break;
402 case ( SID_BMPMASK_EXEC ) :
404 SdrGrafObj* pObj = 0;
405 if( mpDrawView && mpDrawView->GetMarkedObjectList().GetMarkCount() )
406 pObj = dynamic_cast< SdrGrafObj* >( mpDrawView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj() );
408 if ( pObj && !mpDrawView->IsTextEdit() )
410 SdrGrafObj* pNewObj = (SdrGrafObj*) pObj->Clone();
411 BOOL bCont = TRUE;
413 if( pNewObj->IsLinkedGraphic() )
415 QueryBox aQBox( (Window*) GetActiveWindow(), WB_YES_NO | WB_DEF_YES,
416 String( SdResId( STR_RELEASE_GRAPHICLINK ) ) );
418 if( RET_YES == aQBox.Execute() )
419 pNewObj->ReleaseGraphicLink();
420 else
422 delete pNewObj;
423 bCont = FALSE;
427 if( bCont )
429 const Graphic& rOldGraphic = pNewObj->GetGraphic();
430 const Graphic aNewGraphic( ( (SvxBmpMask*) GetViewFrame()->GetChildWindow(
431 SvxBmpMaskChildWindow::GetChildWindowId() )->GetWindow() )->
432 Mask( rOldGraphic ) );
434 if( aNewGraphic != rOldGraphic )
436 SdrPageView* pPV = mpDrawView->GetSdrPageView();
438 pNewObj->SetEmptyPresObj( FALSE );
439 pNewObj->SetGraphic( ( (SvxBmpMask*) GetViewFrame()->GetChildWindow(
440 SvxBmpMaskChildWindow::GetChildWindowId() )->GetWindow() )->
441 Mask( pNewObj->GetGraphic() ) );
443 String aStr( mpDrawView->GetDescriptionOfMarkedObjects() );
444 aStr += (sal_Unicode)( ' ' ), aStr += String( SdResId( STR_EYEDROPPER ) );
446 mpDrawView->BegUndo( aStr );
447 mpDrawView->ReplaceObjectAtView( pObj, *pPV, pNewObj );
448 mpDrawView->EndUndo();
453 break;
455 default:
456 break;
460 /*************************************************************************
464 \************************************************************************/
466 void DrawViewShell::GetBmpMaskState( SfxItemSet& rSet )
468 const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
469 const SdrObject* pObj = NULL;
470 USHORT nId = SvxBmpMaskChildWindow::GetChildWindowId();
471 SvxBmpMask* pDlg = NULL;
472 BOOL bEnable = FALSE;
474 if ( GetViewFrame()->HasChildWindow( nId ) )
476 pDlg = (SvxBmpMask*) ( GetViewFrame()->GetChildWindow( nId )->GetWindow() );
478 if ( pDlg->NeedsColorTable() )
479 pDlg->SetColorTable( GetDoc()->GetColorTable() );
482 if ( rMarkList.GetMarkCount() == 1 )
483 pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
485 // valid graphic object?
486 if( pObj && pObj->ISA( SdrGrafObj ) && !( (SdrGrafObj*) pObj )->IsEPS() && !mpDrawView->IsTextEdit() )
487 bEnable = TRUE;
489 // put value
490 rSet.Put( SfxBoolItem( SID_BMPMASK_EXEC, bEnable ) );
493 /*************************************************************************
495 |* SfxRequests fuer temporaere Funktionen
497 \************************************************************************/
499 void DrawViewShell::FuTemp04(SfxRequest& rReq)
501 USHORT nSId = rReq.GetSlot();
502 switch( nSId )
504 case SID_FORMATPAINTBRUSH:
506 SdFormatClipboard* pFormatClipboard = GetDocSh()->mpFormatClipboard;
507 if(pFormatClipboard)
509 if( pFormatClipboard->HasContent() )
511 pFormatClipboard->Erase();
512 GetViewFrame()->GetBindings().Invalidate(SID_FORMATPAINTBRUSH);
513 Cancel();
514 rReq.Ignore ();
516 else
518 bool bPersistentCopy = false;
519 const SfxItemSet *pArgs = rReq.GetArgs();
520 if( pArgs && pArgs->Count() >= 1 )
522 bPersistentCopy = static_cast<bool>(((SfxBoolItem &)pArgs->Get(
523 SID_FORMATPAINTBRUSH)).GetValue());
526 pFormatClipboard->Copy( *mpDrawView, bPersistentCopy );
527 SetCurrentFunction( FuFormatPaintBrush::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
528 GetViewFrame()->GetBindings().Invalidate(SID_FORMATPAINTBRUSH);
532 break;
533 case SID_FONTWORK:
535 if ( rReq.GetArgs() )
537 GetViewFrame()->SetChildWindow(SvxFontWorkChildWindow::GetChildWindowId(),
538 ((const SfxBoolItem&) (rReq.GetArgs()->
539 Get(SID_FONTWORK))).GetValue());
541 else
543 GetViewFrame()->ToggleChildWindow( SvxFontWorkChildWindow::GetChildWindowId() );
546 GetViewFrame()->GetBindings().Invalidate(SID_FONTWORK);
547 Cancel();
548 rReq.Ignore ();
550 break;
552 case SID_COLOR_CONTROL:
554 if ( rReq.GetArgs() )
555 GetViewFrame()->SetChildWindow(SvxColorChildWindow::GetChildWindowId(),
556 ((const SfxBoolItem&) (rReq.GetArgs()->
557 Get(SID_COLOR_CONTROL))).GetValue());
558 else
559 GetViewFrame()->ToggleChildWindow(SvxColorChildWindow::GetChildWindowId() );
561 GetViewFrame()->GetBindings().Invalidate(SID_COLOR_CONTROL);
562 Cancel();
563 rReq.Ignore ();
565 break;
567 case SID_EXTRUSION_TOOGLE:
568 case SID_EXTRUSION_TILT_DOWN:
569 case SID_EXTRUSION_TILT_UP:
570 case SID_EXTRUSION_TILT_LEFT:
571 case SID_EXTRUSION_TILT_RIGHT:
572 case SID_EXTRUSION_3D_COLOR:
573 case SID_EXTRUSION_DEPTH:
574 case SID_EXTRUSION_DIRECTION:
575 case SID_EXTRUSION_PROJECTION:
576 case SID_EXTRUSION_LIGHTING_DIRECTION:
577 case SID_EXTRUSION_LIGHTING_INTENSITY:
578 case SID_EXTRUSION_SURFACE:
579 case SID_EXTRUSION_DEPTH_FLOATER:
580 case SID_EXTRUSION_DIRECTION_FLOATER:
581 case SID_EXTRUSION_LIGHTING_FLOATER:
582 case SID_EXTRUSION_SURFACE_FLOATER:
583 case SID_EXTRUSION_DEPTH_DIALOG:
584 svx::ExtrusionBar::execute( mpDrawView, rReq, GetViewFrame()->GetBindings() );
585 Cancel();
586 rReq.Ignore ();
587 break;
589 case SID_FONTWORK_SHAPE:
590 case SID_FONTWORK_SHAPE_TYPE:
591 case SID_FONTWORK_ALIGNMENT:
592 case SID_FONTWORK_SAME_LETTER_HEIGHTS:
593 case SID_FONTWORK_CHARACTER_SPACING:
594 case SID_FONTWORK_KERN_CHARACTER_PAIRS:
595 case SID_FONTWORK_GALLERY_FLOATER:
596 case SID_FONTWORK_CHARACTER_SPACING_FLOATER:
597 case SID_FONTWORK_ALIGNMENT_FLOATER:
598 case SID_FONTWORK_CHARACTER_SPACING_DIALOG:
599 svx::FontworkBar::execute( mpDrawView, rReq, GetViewFrame()->GetBindings() );
600 Cancel();
601 rReq.Ignore ();
602 break;
604 case SID_BMPMASK:
606 GetViewFrame()->ToggleChildWindow( SvxBmpMaskChildWindow::GetChildWindowId() );
607 GetViewFrame()->GetBindings().Invalidate( SID_BMPMASK );
609 Cancel();
610 rReq.Ignore ();
612 break;
614 case SID_GALLERY:
616 GetViewFrame()->ToggleChildWindow( GalleryChildWindow::GetChildWindowId() );
617 GetViewFrame()->GetBindings().Invalidate( SID_GALLERY );
619 Cancel();
620 rReq.Ignore ();
622 break;
624 case SID_NAVIGATOR:
626 if ( rReq.GetArgs() )
627 GetViewFrame()->SetChildWindow(SID_NAVIGATOR,
628 ((const SfxBoolItem&) (rReq.GetArgs()->
629 Get(SID_NAVIGATOR))).GetValue());
630 else
631 GetViewFrame()->ToggleChildWindow( SID_NAVIGATOR );
633 GetViewFrame()->GetBindings().Invalidate(SID_NAVIGATOR);
634 Cancel();
635 rReq.Ignore ();
637 break;
639 case SID_ANIMATION_OBJECTS:
641 if ( rReq.GetArgs() )
642 GetViewFrame()->SetChildWindow(
643 AnimationChildWindow::GetChildWindowId(),
644 ((const SfxBoolItem&) (rReq.GetArgs()->
645 Get(SID_ANIMATION_OBJECTS))).GetValue());
646 else
647 GetViewFrame()->ToggleChildWindow(
648 AnimationChildWindow::GetChildWindowId() );
650 GetViewFrame()->GetBindings().Invalidate(SID_ANIMATION_OBJECTS);
651 Cancel();
652 rReq.Ignore ();
654 break;
656 case SID_CUSTOM_ANIMATION_PANEL:
658 // Make the slide transition panel visible (expand it) in the
659 // tool pane.
660 framework::FrameworkHelper::Instance(GetViewShellBase())->RequestTaskPanel(
661 framework::FrameworkHelper::msCustomAnimationTaskPanelURL);
663 Cancel();
664 rReq.Done ();
666 break;
668 case SID_SLIDE_TRANSITIONS_PANEL:
670 // Make the slide transition panel visible (expand it) in the
671 // tool pane.
672 framework::FrameworkHelper::Instance(GetViewShellBase())->RequestTaskPanel(
673 framework::FrameworkHelper::msSlideTransitionTaskPanelURL);
675 Cancel();
676 rReq.Done ();
678 break;
680 case SID_3D_WIN:
682 if ( rReq.GetArgs() )
683 GetViewFrame()->SetChildWindow( Svx3DChildWindow::GetChildWindowId(),
684 ((const SfxBoolItem&) (rReq.GetArgs()->
685 Get( SID_3D_WIN ))).GetValue());
686 else
687 GetViewFrame()->ToggleChildWindow( Svx3DChildWindow::GetChildWindowId() );
689 GetViewFrame()->GetBindings().Invalidate( SID_3D_WIN );
690 Cancel();
691 rReq.Ignore ();
693 break;
695 case SID_CONVERT_TO_3D_LATHE_FAST:
697 // Der Aufruf ist ausreichend. Die Initialisierung per Start3DCreation und CreateMirrorPolygons
698 // ist nicht mehr noetig, falls der Parameter TRUE uebergeben wird. Dann wird sofort und
699 // ohne Benutzereingriff ein gekippter Rotationskoerper mit einer Achse links neben dem
700 // Umschliessenden Rechteck der slektierten Objekte gezeichnet.
701 mpDrawView->SdrEndTextEdit();
702 if(GetActiveWindow())
703 GetActiveWindow()->EnterWait();
704 mpDrawView->End3DCreation(TRUE);
705 Cancel();
706 rReq.Ignore();
707 if(GetActiveWindow())
708 GetActiveWindow()->LeaveWait();
710 break;
712 case SID_PRESENTATION_DLG:
714 SetCurrentFunction( FuSlideShowDlg::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
715 Cancel();
717 break;
719 case SID_CUSTOMSHOW_DLG:
721 SetCurrentFunction( FuCustomShowDlg::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
722 Cancel();
724 break;
726 case SID_EXPAND_PAGE:
728 SetCurrentFunction( FuExpandPage::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
729 Cancel();
731 break;
733 case SID_SUMMARY_PAGE:
735 mpDrawView->SdrEndTextEdit();
736 SetCurrentFunction( FuSummaryPage::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
737 Cancel();
739 break;
741 case SID_AVMEDIA_PLAYER:
743 GetViewFrame()->ToggleChildWindow( ::avmedia::MediaPlayer::GetChildWindowId() );
744 GetViewFrame()->GetBindings().Invalidate( SID_AVMEDIA_PLAYER );
745 Cancel();
746 rReq.Ignore ();
748 break;
750 case SID_LAYER_DIALOG_WIN:
752 if ( rReq.GetArgs() )
754 GetViewFrame()->SetChildWindow(
755 LayerDialogChildWindow::GetChildWindowId(),
756 ((const SfxBoolItem&) (rReq.GetArgs()->
757 Get(SID_LAYER_DIALOG_WIN))).GetValue());
759 else
761 GetViewFrame()->ToggleChildWindow(
762 LayerDialogChildWindow::GetChildWindowId());
765 GetViewFrame()->GetBindings().Invalidate(SID_LAYER_DIALOG_WIN);
766 Cancel();
767 rReq.Ignore ();
769 break;
771 case SID_DISPLAY_MASTER_BACKGROUND:
772 case SID_DISPLAY_MASTER_OBJECTS:
774 // Determine current page and toggle visibility of layers
775 // associated with master page background or master page shapes.
776 SdPage* pPage = GetActualPage();
777 if (pPage != NULL
778 && GetDoc() != NULL)
780 SetOfByte aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers();
781 SdrLayerAdmin& rLayerAdmin = GetDoc()->GetLayerAdmin();
782 BYTE aLayerId;
783 if (nSId == SID_DISPLAY_MASTER_BACKGROUND)
784 aLayerId = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), FALSE);
785 else
786 aLayerId = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), FALSE);
787 aVisibleLayers.Set(aLayerId, !aVisibleLayers.IsSet(aLayerId));
788 pPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers);
790 Cancel();
791 rReq.Ignore ();
793 break;
795 default:
797 DBG_ASSERT( 0, "Slot ohne Funktion" );
798 Cancel();
799 rReq.Ignore ();
801 break;
805 } // end of namespace sd