xref: /trunk/main/sd/source/ui/view/drviews6.cxx (revision 5b190011)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sd.hxx"
26 
27 #include "DrawViewShell.hxx"
28 #include <vcl/metaact.hxx>
29 #include <sfx2/request.hxx>
30 #include <sfx2/dispatch.hxx>
31 #include <vcl/msgbox.hxx>
32 #include <sfx2/viewfrm.hxx>
33 #include <svx/svdograf.hxx>
34 #ifndef _SVXIDS_HXX
35 #include <svx/svxids.hrc>
36 #endif
37 #ifndef _FONTWORK_HXX
38 #include <svx/fontwork.hxx>
39 #endif
40 #ifndef _BMPMASK_HXX
41 #include <svx/bmpmask.hxx>
42 #endif
43 #ifndef _SVX_GALBRWS_HXX
44 #include <svx/galbrws.hxx>
45 #endif
46 #ifndef _IMAPDLG_HXX
47 #include <svx/imapdlg.hxx>
48 #endif
49 #include <svx/xftsfit.hxx>
50 #include <svx/colrctrl.hxx>
51 #include <svx/f3dchild.hxx>
52 #include "optsitem.hxx"
53 #include <svx/extrusionbar.hxx>
54 #include <svx/fontworkbar.hxx>
55 #include <svx/tbxcustomshapes.hxx>
56 #ifndef _AVMEDIA_MEDIAPLAYER_HXX
57 #include <avmedia/mediaplayer.hxx>
58 #endif
59 
60 #include "app.hrc"
61 #include "strings.hrc"
62 #include "glob.hrc"
63 
64 #include "app.hxx"
65 #include "animobjs.hxx"
66 #include "AnimationChildWindow.hxx"
67 #include "NavigatorChildWindow.hxx"
68 #include "LayerDialogChildWindow.hxx"
69 #include "sdresid.hxx"
70 #include "fupoor.hxx"
71 #include "fusldlg.hxx"
72 #include "drawdoc.hxx"
73 #include "fuexpand.hxx"
74 #include "fusumry.hxx"
75 #include "fucushow.hxx"
76 #include "drawview.hxx"
77 #include "FrameView.hxx"
78 #include "Window.hxx"
79 #include "DrawDocShell.hxx"
80 #include "framework/FrameworkHelper.hxx"
81 
82 namespace sd {
83 
84 /*************************************************************************
85 |*
86 |* SfxRequests fuer FontWork bearbeiten
87 |*
88 \************************************************************************/
89 
90 void DrawViewShell::ExecFormText(SfxRequest& rReq)
91 {
92 	// waehrend einer Diashow wird nichts ausgefuehrt!
93 	if(HasCurrentFunction(SID_PRESENTATION))
94 		return;
95 
96 	CheckLineTo (rReq);
97 
98 	const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
99 
100 	if ( rMarkList.GetMarkCount() == 1 && rReq.GetArgs() &&
101 		 mpDrawView && !mpDrawView->IsPresObjSelected() )
102 	{
103 		const SfxItemSet& rSet = *rReq.GetArgs();
104 		const SfxPoolItem* pItem;
105 
106 		if ( mpDrawView->IsTextEdit() )
107 			mpDrawView->SdrEndTextEdit();
108 
109 		if ( rSet.GetItemState(XATTR_FORMTXTSTDFORM, sal_True, &pItem) ==
110 			 SFX_ITEM_SET &&
111 			((const XFormTextStdFormItem*) pItem)->GetValue() != XFTFORM_NONE )
112 		{
113 
114 			sal_uInt16 nId = SvxFontWorkChildWindow::GetChildWindowId();
115 
116 			SvxFontWorkDialog* pDlg = (SvxFontWorkDialog*)GetViewFrame()->
117 										GetChildWindow(nId)->GetWindow();
118 
119 			pDlg->CreateStdFormObj(*mpDrawView, *mpDrawView->GetSdrPageView(),
120 									rSet, *rMarkList.GetMark(0)->GetMarkedSdrObj(),
121 								   ((const XFormTextStdFormItem*) pItem)->
122 								   GetValue());
123 
124 			if(HasCurrentFunction(SID_BEZIER_EDIT))
125 			{	// ggf. die richtige Editfunktion aktivieren
126 				GetViewFrame()->GetDispatcher()->Execute(SID_SWITCH_POINTEDIT,
127 									SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
128 			}
129 		}
130 		else
131 			mpDrawView->SetAttributes(rSet);
132 	}
133 }
134 
135 /*************************************************************************
136 |*
137 |* Statuswerte fuer FontWork zurueckgeben
138 |*
139 \************************************************************************/
140 
141 void DrawViewShell::GetFormTextState(SfxItemSet& rSet)
142 {
143 	const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
144 	const SdrObject* pObj = NULL;
145 	SvxFontWorkDialog* pDlg = NULL;
146 
147 	sal_uInt16 nId = SvxFontWorkChildWindow::GetChildWindowId();
148 
149 	if ( GetViewFrame()->HasChildWindow(nId) )
150 		pDlg = (SvxFontWorkDialog*)(GetViewFrame()->GetChildWindow(nId)->GetWindow());
151 
152 	if ( rMarkList.GetMarkCount() == 1 )
153 		pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
154 
155 	if ( pObj == NULL || !pObj->ISA(SdrTextObj) ||
156 		!((SdrTextObj*) pObj)->HasText() )
157 	{
158 // automatisches Auf/Zuklappen des FontWork-Dialog; erstmal deaktiviert
159 //		if ( pDlg )
160 //			pDlg->SetActive(sal_False);
161 
162 		rSet.DisableItem(XATTR_FORMTXTSTYLE);
163 		rSet.DisableItem(XATTR_FORMTXTADJUST);
164 		rSet.DisableItem(XATTR_FORMTXTDISTANCE);
165 		rSet.DisableItem(XATTR_FORMTXTSTART);
166 		rSet.DisableItem(XATTR_FORMTXTMIRROR);
167 		rSet.DisableItem(XATTR_FORMTXTSTDFORM);
168 		rSet.DisableItem(XATTR_FORMTXTHIDEFORM);
169 		rSet.DisableItem(XATTR_FORMTXTOUTLINE);
170 		rSet.DisableItem(XATTR_FORMTXTSHADOW);
171 		rSet.DisableItem(XATTR_FORMTXTSHDWCOLOR);
172 		rSet.DisableItem(XATTR_FORMTXTSHDWXVAL);
173 		rSet.DisableItem(XATTR_FORMTXTSHDWYVAL);
174 	}
175 	else
176 	{
177 		if ( pDlg )
178 		{
179 //			pDlg->SetActive();
180 			pDlg->SetColorTable(GetDoc()->GetColorTable());
181 		}
182 
183 		SfxItemSet aSet( GetDoc()->GetPool() );
184 		mpDrawView->GetAttributes( aSet );
185 		rSet.Set( aSet );
186 	}
187 }
188 
189 /*************************************************************************
190 |*
191 |* SfxRequests fuer Animator bearbeiten
192 |*
193 \************************************************************************/
194 
195 void DrawViewShell::ExecAnimationWin( SfxRequest& rReq )
196 {
197 	// waehrend einer Diashow wird nichts ausgefuehrt!
198 	if (HasCurrentFunction(SID_PRESENTATION))
199 		return;
200 
201 	CheckLineTo (rReq);
202 
203 	sal_uInt16 nSId = rReq.GetSlot();
204 
205 	switch( nSId )
206 	{
207 		case SID_ANIMATOR_INIT:
208 		case SID_ANIMATOR_ADD:
209 		case SID_ANIMATOR_CREATE:
210 		{
211 			AnimationWindow* pAnimWin;
212 			sal_uInt16 nId = AnimationChildWindow::GetChildWindowId();
213 			//((const SfxUInt16Item&)(rReq.GetArgs()->Get(nSId))).GetValue();
214 
215 			pAnimWin = static_cast<AnimationWindow*>(
216                 GetViewFrame()->GetChildWindow(nId)->GetWindow());
217 
218 			if ( pAnimWin )
219 			{
220                 if( nSId == SID_ANIMATOR_ADD )
221 					pAnimWin->AddObj( *mpDrawView );
222 				else if( nSId == SID_ANIMATOR_CREATE )
223 					pAnimWin->CreateAnimObj( *mpDrawView );
224 			}
225 		}
226 		break;
227 
228 		default:
229 		break;
230 	}
231 }
232 
233 /*************************************************************************
234 |*
235 |* Statuswerte fuer Animator zurueckgeben
236 |*
237 |* nValue == 0 -> Kein Button
238 |* nValue == 1 -> Button 'uebernehmen'
239 |* nValue == 2 -> Button 'einzeln uebernehmen'
240 |* nValue == 3 -> Buttons 'uebernehmen' und 'einzeln uebernehmen'
241 |*
242 \************************************************************************/
243 
244 void DrawViewShell::GetAnimationWinState( SfxItemSet& rSet )
245 {
246 	// Hier koennten Buttons etc. disabled werden
247 	sal_uInt16 nValue;
248 
249 	const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
250 	sal_uLong nMarkCount = rMarkList.GetMarkCount();
251 
252 	if( nMarkCount == 0 )
253 		nValue = 0;
254 	else if( nMarkCount > 1 )
255 		nValue = 3;
256 	else // 1 Objekt
257 	{
258 		const SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
259 		sal_uInt32 nInv = pObj->GetObjInventor();
260 		sal_uInt16 nId	= pObj->GetObjIdentifier();
261 		// 1 selektiertes Gruppenobjekt
262 		if( nInv == SdrInventor && nId == OBJ_GRUP )
263 			nValue = 3;
264 		else if( nInv == SdrInventor && nId == OBJ_GRAF ) // Anim. GIF ?
265 		{
266 			sal_uInt16 nCount = 0;
267 
268 			if( ( (SdrGrafObj*) pObj )->IsAnimated() )
269 				nCount = ( (SdrGrafObj*) pObj )->GetGraphic().GetAnimation().Count();
270 			if( nCount > 0 )
271 				nValue = 2;
272 			else
273 				nValue = 1;
274 		}
275 		else
276 			nValue = 1;
277 	}
278 	rSet.Put( SfxUInt16Item( SID_ANIMATOR_STATE, nValue ) );
279 }
280 
281 /*************************************************************************
282 |*
283 |* Statuswerte fuer SfxChildWindows setzen
284 |*
285 \************************************************************************/
286 
287 void DrawViewShell::SetChildWindowState( SfxItemSet& rSet )
288 {
289 	// Stati der SfxChild-Windows (Animator, Fontwork etc.)
290 	if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_FONTWORK ) )
291 	{
292 		sal_uInt16 nId = SvxFontWorkChildWindow::GetChildWindowId();
293 		rSet.Put(SfxBoolItem(SID_FONTWORK, GetViewFrame()->HasChildWindow(nId)));
294 	}
295 	if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_COLOR_CONTROL ) )
296 	{
297 		sal_uInt16 nId = SvxColorChildWindow::GetChildWindowId();
298 		rSet.Put(SfxBoolItem(SID_COLOR_CONTROL, GetViewFrame()->HasChildWindow(nId)));
299 	}
300 	if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_ANIMATION_OBJECTS ) )
301 	{
302 		sal_uInt16 nId = AnimationChildWindow::GetChildWindowId();
303 		rSet.Put( SfxBoolItem( SID_ANIMATION_OBJECTS, GetViewFrame()->HasChildWindow( nId ) ) );
304 	}
305 	if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_NAVIGATOR ) )
306 	{
307 		sal_uInt16 nId = SID_NAVIGATOR;
308 		rSet.Put( SfxBoolItem( SID_NAVIGATOR, GetViewFrame()->HasChildWindow( nId ) ) );
309 	}
310 	if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_BMPMASK ) )
311 	{
312 		sal_uInt16 nId = SvxBmpMaskChildWindow::GetChildWindowId();
313 		rSet.Put( SfxBoolItem( SID_BMPMASK, GetViewFrame()->HasChildWindow( nId ) ) );
314 	}
315 	if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_GALLERY ) )
316 	{
317 		sal_uInt16 nId = GalleryChildWindow::GetChildWindowId();
318 		rSet.Put( SfxBoolItem( SID_GALLERY, GetViewFrame()->HasChildWindow( nId ) ) );
319 	}
320 	if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_IMAP ) )
321 	{
322 		sal_uInt16 nId = SvxIMapDlgChildWindow::GetChildWindowId();
323 		rSet.Put( SfxBoolItem( SID_IMAP, GetViewFrame()->HasChildWindow( nId ) ) );
324 	}
325 	if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_LAYER_DIALOG_WIN ) )
326 	{
327 		sal_uInt16 nId = LayerDialogChildWindow::GetChildWindowId();
328 		rSet.Put( SfxBoolItem( SID_LAYER_DIALOG_WIN, GetViewFrame()->HasChildWindow( nId ) ) );
329 	}
330 	if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_3D_WIN ) )
331 	{
332 		sal_uInt16 nId = Svx3DChildWindow::GetChildWindowId();
333 		rSet.Put( SfxBoolItem( SID_3D_WIN, GetViewFrame()->HasChildWindow( nId ) ) );
334 	}
335 	if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_AVMEDIA_PLAYER ) )
336 	{
337 		sal_uInt16 nId = ::avmedia::MediaPlayer::GetChildWindowId();
338 		rSet.Put( SfxBoolItem( SID_AVMEDIA_PLAYER, GetViewFrame()->HasChildWindow( nId ) ) );
339 	}
340 }
341 
342 
343 /*************************************************************************
344 |*
345 |* SfxRequests fuer Pipette bearbeiten
346 |*
347 \************************************************************************/
348 
349 void DrawViewShell::ExecBmpMask( SfxRequest& rReq )
350 {
351 	// waehrend einer Diashow wird nichts ausgefuehrt!
352 	if (HasCurrentFunction(SID_PRESENTATION))
353 		return;
354 
355 	switch ( rReq.GetSlot() )
356 	{
357 		case ( SID_BMPMASK_PIPETTE ) :
358 		{
359 			mbPipette = ( (const SfxBoolItem&) ( rReq.GetArgs()->
360 					   Get( SID_BMPMASK_PIPETTE ) ) ).GetValue();
361 		}
362 		break;
363 
364 		case ( SID_BMPMASK_EXEC ) :
365 		{
366 			SdrGrafObj* pObj = 0;
367 			if( mpDrawView && mpDrawView->GetMarkedObjectList().GetMarkCount() )
368 				pObj = dynamic_cast< SdrGrafObj* >( mpDrawView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj() );
369 
370 			if ( pObj && !mpDrawView->IsTextEdit() )
371 			{
372 				SdrGrafObj*	pNewObj = (SdrGrafObj*) pObj->Clone();
373 				sal_Bool		bCont = sal_True;
374 
375 				if( pNewObj->IsLinkedGraphic() )
376 				{
377 					QueryBox aQBox( (Window*) GetActiveWindow(), WB_YES_NO | WB_DEF_YES,
378 									String( SdResId( STR_RELEASE_GRAPHICLINK ) ) );
379 
380 					if( RET_YES == aQBox.Execute() )
381 						pNewObj->ReleaseGraphicLink();
382 					else
383 					{
384 						delete pNewObj;
385 						bCont = sal_False;
386 					}
387 				}
388 
389 				if( bCont )
390 				{
391 					const Graphic&	rOldGraphic = pNewObj->GetGraphic();
392 					const Graphic	aNewGraphic( ( (SvxBmpMask*) GetViewFrame()->GetChildWindow(
393 												 SvxBmpMaskChildWindow::GetChildWindowId() )->GetWindow() )->
394 												 Mask( rOldGraphic ) );
395 
396 					if( aNewGraphic != rOldGraphic )
397 					{
398 						SdrPageView* pPV = mpDrawView->GetSdrPageView();
399 
400 						pNewObj->SetEmptyPresObj( sal_False );
401 						pNewObj->SetGraphic( ( (SvxBmpMask*) GetViewFrame()->GetChildWindow(
402 											 SvxBmpMaskChildWindow::GetChildWindowId() )->GetWindow() )->
403 											 Mask( pNewObj->GetGraphic() ) );
404 
405 						String aStr( mpDrawView->GetDescriptionOfMarkedObjects() );
406 						aStr += (sal_Unicode)( ' ' ), aStr += String( SdResId( STR_EYEDROPPER ) );
407 
408 						mpDrawView->BegUndo( aStr );
409 						mpDrawView->ReplaceObjectAtView( pObj, *pPV, pNewObj );
410 						mpDrawView->EndUndo();
411 					}
412 				}
413 			}
414 		}
415 		break;
416 
417 		default:
418 		break;
419 	}
420 }
421 
422 /*************************************************************************
423 |*
424 |*
425 |*
426 \************************************************************************/
427 
428 void DrawViewShell::GetBmpMaskState( SfxItemSet& rSet )
429 {
430 	const SdrMarkList&	rMarkList = mpDrawView->GetMarkedObjectList();
431 	const SdrObject*	pObj = NULL;
432 	sal_uInt16				nId = SvxBmpMaskChildWindow::GetChildWindowId();
433 	SvxBmpMask* 		pDlg = NULL;
434 	sal_Bool				bEnable = sal_False;
435 
436 	if ( GetViewFrame()->HasChildWindow( nId ) )
437 	{
438 		pDlg = (SvxBmpMask*) ( GetViewFrame()->GetChildWindow( nId )->GetWindow() );
439 
440 		if ( pDlg->NeedsColorTable() )
441 			pDlg->SetColorTable( GetDoc()->GetColorTable() );
442 	}
443 
444 	if ( rMarkList.GetMarkCount() == 1 )
445 		pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
446 
447 	// valid graphic object?
448 	if( pObj && pObj->ISA( SdrGrafObj ) &&
449         !( ((SdrGrafObj*) pObj)->IsEPS() || ((SdrGrafObj*) pObj)->IsRenderGraphic() ) &&
450         !mpDrawView->IsTextEdit() )
451     {
452 		bEnable = sal_True;
453     }
454 
455 	// put value
456 	rSet.Put( SfxBoolItem( SID_BMPMASK_EXEC, bEnable ) );
457 }
458 
459 /*************************************************************************
460 |*
461 |* SfxRequests fuer temporaere Funktionen
462 |*
463 \************************************************************************/
464 
465 void DrawViewShell::FuTemp04(SfxRequest& rReq)
466 {
467 	sal_uInt16 nSId = rReq.GetSlot();
468 	switch( nSId )
469 	{
470 		case SID_FONTWORK:
471 		{
472 			if ( rReq.GetArgs() )
473 			{
474 				GetViewFrame()->SetChildWindow(SvxFontWorkChildWindow::GetChildWindowId(),
475 										((const SfxBoolItem&) (rReq.GetArgs()->
476 										Get(SID_FONTWORK))).GetValue());
477 			}
478 			else
479 			{
480 				GetViewFrame()->ToggleChildWindow( SvxFontWorkChildWindow::GetChildWindowId() );
481 			}
482 
483 			GetViewFrame()->GetBindings().Invalidate(SID_FONTWORK);
484 			Cancel();
485 			rReq.Ignore ();
486 		}
487 		break;
488 
489 		case SID_COLOR_CONTROL:
490 		{
491 			if ( rReq.GetArgs() )
492 				GetViewFrame()->SetChildWindow(SvxColorChildWindow::GetChildWindowId(),
493 										((const SfxBoolItem&) (rReq.GetArgs()->
494 										Get(SID_COLOR_CONTROL))).GetValue());
495 			else
496 				GetViewFrame()->ToggleChildWindow(SvxColorChildWindow::GetChildWindowId() );
497 
498 			GetViewFrame()->GetBindings().Invalidate(SID_COLOR_CONTROL);
499 			Cancel();
500 			rReq.Ignore ();
501 		}
502 		break;
503 
504 		case SID_EXTRUSION_TOOGLE:
505 		case SID_EXTRUSION_TILT_DOWN:
506 		case SID_EXTRUSION_TILT_UP:
507 		case SID_EXTRUSION_TILT_LEFT:
508 		case SID_EXTRUSION_TILT_RIGHT:
509 		case SID_EXTRUSION_3D_COLOR:
510 		case SID_EXTRUSION_DEPTH:
511 		case SID_EXTRUSION_DIRECTION:
512 		case SID_EXTRUSION_PROJECTION:
513 		case SID_EXTRUSION_LIGHTING_DIRECTION:
514 		case SID_EXTRUSION_LIGHTING_INTENSITY:
515 		case SID_EXTRUSION_SURFACE:
516 		case SID_EXTRUSION_DEPTH_FLOATER:
517 		case SID_EXTRUSION_DIRECTION_FLOATER:
518 		case SID_EXTRUSION_LIGHTING_FLOATER:
519 		case SID_EXTRUSION_SURFACE_FLOATER:
520 		case SID_EXTRUSION_DEPTH_DIALOG:
521 			svx::ExtrusionBar::execute( mpDrawView, rReq, GetViewFrame()->GetBindings() );
522 			Cancel();
523 			rReq.Ignore ();
524 			break;
525 
526 		case SID_FONTWORK_SHAPE:
527 		case SID_FONTWORK_SHAPE_TYPE:
528 		case SID_FONTWORK_ALIGNMENT:
529 		case SID_FONTWORK_SAME_LETTER_HEIGHTS:
530 		case SID_FONTWORK_CHARACTER_SPACING:
531 		case SID_FONTWORK_KERN_CHARACTER_PAIRS:
532 		case SID_FONTWORK_GALLERY_FLOATER:
533 		case SID_FONTWORK_CHARACTER_SPACING_FLOATER:
534 		case SID_FONTWORK_ALIGNMENT_FLOATER:
535 		case SID_FONTWORK_CHARACTER_SPACING_DIALOG:
536 			svx::FontworkBar::execute( mpDrawView, rReq, GetViewFrame()->GetBindings() );
537 			Cancel();
538 			rReq.Ignore ();
539 			break;
540 
541 		case SID_BMPMASK:
542 		{
543 			GetViewFrame()->ToggleChildWindow( SvxBmpMaskChildWindow::GetChildWindowId() );
544 			GetViewFrame()->GetBindings().Invalidate( SID_BMPMASK );
545 
546 			Cancel();
547 			rReq.Ignore ();
548 		}
549 		break;
550 
551 		case SID_GALLERY:
552 		{
553 			GetViewFrame()->ToggleChildWindow( GalleryChildWindow::GetChildWindowId() );
554 			GetViewFrame()->GetBindings().Invalidate( SID_GALLERY );
555 
556 			Cancel();
557 			rReq.Ignore ();
558 		}
559 		break;
560 
561 		case SID_NAVIGATOR:
562 		{
563 			if ( rReq.GetArgs() )
564 				GetViewFrame()->SetChildWindow(SID_NAVIGATOR,
565 										((const SfxBoolItem&) (rReq.GetArgs()->
566 										Get(SID_NAVIGATOR))).GetValue());
567 			else
568 				GetViewFrame()->ToggleChildWindow( SID_NAVIGATOR );
569 
570 			GetViewFrame()->GetBindings().Invalidate(SID_NAVIGATOR);
571 			Cancel();
572 			rReq.Ignore ();
573 		}
574 		break;
575 
576 		case SID_ANIMATION_OBJECTS:
577 		{
578 			if ( rReq.GetArgs() )
579 				GetViewFrame()->SetChildWindow(
580                     AnimationChildWindow::GetChildWindowId(),
581                     ((const SfxBoolItem&) (rReq.GetArgs()->
582                         Get(SID_ANIMATION_OBJECTS))).GetValue());
583 			else
584 				GetViewFrame()->ToggleChildWindow(
585                     AnimationChildWindow::GetChildWindowId() );
586 
587 			GetViewFrame()->GetBindings().Invalidate(SID_ANIMATION_OBJECTS);
588 			Cancel();
589 			rReq.Ignore ();
590 		}
591 		break;
592 
593 		case SID_CUSTOM_ANIMATION_PANEL:
594 		{
595             // Make the slide transition panel visible (expand it) in the
596             // tool pane.
597             framework::FrameworkHelper::Instance(GetViewShellBase())->RequestTaskPanel(
598                 framework::FrameworkHelper::msCustomAnimationTaskPanelURL);
599 
600 			Cancel();
601 			rReq.Done ();
602 		}
603 		break;
604 
605 		case SID_SLIDE_TRANSITIONS_PANEL:
606 		{
607             // Make the slide transition panel visible (expand it) in the
608             // tool pane.
609             framework::FrameworkHelper::Instance(GetViewShellBase())->RequestTaskPanel(
610                 framework::FrameworkHelper::msSlideTransitionTaskPanelURL);
611 
612 			Cancel();
613 			rReq.Done ();
614 		}
615 		break;
616 
617 		case SID_3D_WIN:
618 		{
619 			if ( rReq.GetArgs() )
620 				GetViewFrame()->SetChildWindow( Svx3DChildWindow::GetChildWindowId(),
621 										((const SfxBoolItem&) (rReq.GetArgs()->
622 										Get( SID_3D_WIN ))).GetValue());
623 			else
624 				GetViewFrame()->ToggleChildWindow( Svx3DChildWindow::GetChildWindowId() );
625 
626 			GetViewFrame()->GetBindings().Invalidate( SID_3D_WIN );
627 			Cancel();
628 			rReq.Ignore ();
629 		}
630 		break;
631 
632 		case SID_CONVERT_TO_3D_LATHE_FAST:
633 		{
634 			// Der Aufruf ist ausreichend. Die Initialisierung per Start3DCreation und CreateMirrorPolygons
635 			// ist nicht mehr noetig, falls der Parameter sal_True uebergeben wird. Dann wird sofort und
636 			// ohne Benutzereingriff ein gekippter Rotationskoerper mit einer Achse links neben dem
637 			// Umschliessenden Rechteck der slektierten Objekte gezeichnet.
638 			mpDrawView->SdrEndTextEdit();
639 			if(GetActiveWindow())
640 				GetActiveWindow()->EnterWait();
641 			mpDrawView->End3DCreation(sal_True);
642 			Cancel();
643 			rReq.Ignore();
644 			if(GetActiveWindow())
645 				GetActiveWindow()->LeaveWait();
646 		}
647 		break;
648 
649 		case SID_PRESENTATION_DLG:
650 		{
651 			SetCurrentFunction( FuSlideShowDlg::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
652 			Cancel();
653 		}
654 		break;
655 
656 		case SID_CUSTOMSHOW_DLG:
657 		{
658 			SetCurrentFunction( FuCustomShowDlg::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
659 			Cancel();
660 		}
661 		break;
662 
663 		case SID_EXPAND_PAGE:
664 		{
665 			SetCurrentFunction( FuExpandPage::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
666 			Cancel();
667 		}
668 		break;
669 
670 		case SID_SUMMARY_PAGE:
671 		{
672 			mpDrawView->SdrEndTextEdit();
673 			SetCurrentFunction( FuSummaryPage::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
674 			Cancel();
675 		}
676 		break;
677 
678 		case SID_AVMEDIA_PLAYER:
679 		{
680 			GetViewFrame()->ToggleChildWindow( ::avmedia::MediaPlayer::GetChildWindowId() );
681 			GetViewFrame()->GetBindings().Invalidate( SID_AVMEDIA_PLAYER );
682 			Cancel();
683 			rReq.Ignore ();
684 		}
685 		break;
686 
687 		case SID_LAYER_DIALOG_WIN:
688 		{
689 			if ( rReq.GetArgs() )
690 			{
691 				GetViewFrame()->SetChildWindow(
692                     LayerDialogChildWindow::GetChildWindowId(),
693                     ((const SfxBoolItem&) (rReq.GetArgs()->
694                         Get(SID_LAYER_DIALOG_WIN))).GetValue());
695 			}
696 			else
697 			{
698 				GetViewFrame()->ToggleChildWindow(
699                     LayerDialogChildWindow::GetChildWindowId());
700 			}
701 
702 			GetViewFrame()->GetBindings().Invalidate(SID_LAYER_DIALOG_WIN);
703 			Cancel();
704 			rReq.Ignore ();
705 		}
706 		break;
707 
708         case SID_DISPLAY_MASTER_BACKGROUND:
709         case SID_DISPLAY_MASTER_OBJECTS:
710         {
711             // Determine current page and toggle visibility of layers
712             // associated with master page background or master page shapes.
713             SdPage* pPage = GetActualPage();
714             if (pPage != NULL
715                 && GetDoc() != NULL)
716             {
717                 SetOfByte aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers();
718                 SdrLayerAdmin& rLayerAdmin = GetDoc()->GetLayerAdmin();
719                 sal_uInt8 aLayerId;
720                 if (nSId == SID_DISPLAY_MASTER_BACKGROUND)
721                     aLayerId = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), sal_False);
722                 else
723                     aLayerId = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), sal_False);
724                 aVisibleLayers.Set(aLayerId, !aVisibleLayers.IsSet(aLayerId));
725                 pPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers);
726             }
727             Cancel();
728             rReq.Ignore ();
729         }
730         break;
731 
732 		default:
733 		{
734 			DBG_ASSERT( 0, "Slot ohne Funktion" );
735 			Cancel();
736 			rReq.Ignore ();
737 		}
738 		break;
739 	}
740 }
741 
742 } // end of namespace sd
743