1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: SlideTransitionPane.cxx,v $
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"
33 #include <com/sun/star/animations/XAnimationNode.hpp>
35 #include "SlideTransitionPane.hxx"
36 #include "SlideTransitionPane.hrc"
37 #include "CustomAnimation.hrc"
39 #include "TransitionPreset.hxx"
40 #include "sdresid.hxx"
41 #include "ViewShellBase.hxx"
42 #include "DrawDocShell.hxx"
43 #include "SlideSorterViewShell.hxx"
44 #include "drawdoc.hxx"
45 #include "filedlg.hxx"
46 #include "strings.hrc"
47 #include "DrawController.hxx"
48 #include <com/sun/star/beans/XPropertySet.hpp>
50 #ifndef _SVT_CONTROLDIMS_HRC_
51 #include <svtools/controldims.hrc>
53 #include <svx/gallery.hxx>
54 #include <svtools/pathoptions.hxx>
55 #include <vcl/msgbox.hxx>
56 #include <tools/urlobj.hxx>
57 #include "DrawViewShell.hxx"
58 #include "slideshow.hxx"
59 #include "drawview.hxx"
60 #include "sdundogr.hxx"
61 #include "undoanim.hxx"
62 #include "optsitem.hxx"
64 #include "framework/FrameworkHelper.hxx"
66 #include "DialogListBox.hxx"
72 using namespace ::com::sun::star
;
74 using ::com::sun::star::uno::Reference
;
75 using ::com::sun::star::uno::Sequence
;
76 using ::rtl::OUString
;
77 using ::com::sun::star::uno::RuntimeException
;
79 using ::sd::framework::FrameworkHelper
;
81 // ____________________________
83 // ::sd::impl::TransitionEffect
84 // ____________________________
90 struct TransitionEffect
95 mbDirection( sal_True
),
100 explicit TransitionEffect( const ::sd::TransitionPreset
& rPreset
) :
101 mnType( rPreset
.getTransition()),
102 mnSubType( rPreset
.getSubtype()),
103 mbDirection( rPreset
.getDirection()),
104 mnFadeColor( rPreset
.getFadeColor())
108 explicit TransitionEffect( sal_Int16 nType
, sal_Int16 nSubType
,
109 sal_Bool bDirection
, sal_Int32 nFadeColor
) :
111 mnSubType( nSubType
),
112 mbDirection( bDirection
),
113 mnFadeColor( nFadeColor
)
117 explicit TransitionEffect( const SdPage
& rPage
) :
118 mnType( rPage
.getTransitionType() ),
119 mnSubType( rPage
.getTransitionSubtype() ),
120 mbDirection( rPage
.getTransitionDirection() ),
121 mnFadeColor( rPage
.getTransitionFadeColor() )
125 mfDuration
= rPage
.getTransitionDuration();
126 mnTime
= rPage
.GetTime();
127 mePresChange
= rPage
.GetPresChange();
128 mbSoundOn
= rPage
.IsSoundOn();
129 maSound
= rPage
.GetSoundFile();
130 mbLoopSound
= rPage
.IsLoopSound();
131 mbStopSound
= rPage
.IsStopSound();
138 mePresChange
= PRESCHANGE_MANUAL
;
143 mbEffectAmbiguous
= false;
144 mbDurationAmbiguous
= false;
145 mbTimeAmbiguous
= false;
146 mbPresChangeAmbiguous
= false;
147 mbSoundAmbiguous
= false;
148 mbLoopSoundAmbiguous
= false;
151 void setAllAmbiguous()
153 mbEffectAmbiguous
= true;
154 mbDurationAmbiguous
= true;
155 mbTimeAmbiguous
= true;
156 mbPresChangeAmbiguous
= true;
157 mbSoundAmbiguous
= true;
158 mbLoopSoundAmbiguous
= true;
161 bool operator == ( const ::sd::TransitionPreset
& rPreset
) const
164 (mnType
== rPreset
.getTransition()) &&
165 (mnSubType
== rPreset
.getSubtype()) &&
166 (mbDirection
== rPreset
.getDirection()) &&
167 (mnFadeColor
== rPreset
.getFadeColor());
170 void applyTo( SdPage
& rOutPage
) const
172 if( ! mbEffectAmbiguous
)
174 rOutPage
.setTransitionType( mnType
);
175 rOutPage
.setTransitionSubtype( mnSubType
);
176 rOutPage
.setTransitionDirection( mbDirection
);
177 rOutPage
.setTransitionFadeColor( mnFadeColor
);
180 if( ! mbDurationAmbiguous
)
181 rOutPage
.setTransitionDuration( mfDuration
);
182 if( ! mbTimeAmbiguous
)
183 rOutPage
.SetTime( mnTime
);
184 if( ! mbPresChangeAmbiguous
)
185 rOutPage
.SetPresChange( mePresChange
);
186 if( ! mbSoundAmbiguous
)
190 rOutPage
.SetStopSound( TRUE
);
191 rOutPage
.SetSound( FALSE
);
195 rOutPage
.SetStopSound( FALSE
);
196 rOutPage
.SetSound( mbSoundOn
);
197 rOutPage
.SetSoundFile( maSound
);
200 if( ! mbLoopSoundAmbiguous
)
201 rOutPage
.SetLoopSound( mbLoopSound
);
204 void compareWith( const SdPage
& rPage
)
206 TransitionEffect
aOtherEffect( rPage
);
207 mbEffectAmbiguous
= mbEffectAmbiguous
|| aOtherEffect
.mbEffectAmbiguous
208 || (mnType
!= aOtherEffect
.mnType
)
209 || (mnSubType
!= aOtherEffect
.mnSubType
)
210 || (mbDirection
!= aOtherEffect
.mbDirection
)
211 || (mnFadeColor
!= aOtherEffect
.mnFadeColor
);
213 mbDurationAmbiguous
= mbDurationAmbiguous
|| aOtherEffect
.mbDurationAmbiguous
|| mfDuration
!= aOtherEffect
.mfDuration
;
214 mbTimeAmbiguous
= mbTimeAmbiguous
|| aOtherEffect
.mbTimeAmbiguous
|| mnTime
!= aOtherEffect
.mnTime
;
215 mbPresChangeAmbiguous
= mbPresChangeAmbiguous
|| aOtherEffect
.mbPresChangeAmbiguous
|| mePresChange
!= aOtherEffect
.mePresChange
;
216 mbSoundAmbiguous
= mbSoundAmbiguous
|| aOtherEffect
.mbSoundAmbiguous
|| mbSoundOn
!= aOtherEffect
.mbSoundOn
;
217 (!mbStopSound
&& !aOtherEffect
.mbStopSound
&& maSound
!= aOtherEffect
.maSound
) || (mbStopSound
!= aOtherEffect
.mbStopSound
);
218 mbLoopSoundAmbiguous
= mbLoopSoundAmbiguous
|| aOtherEffect
.mbLoopSoundAmbiguous
|| mbLoopSound
!= aOtherEffect
.mbLoopSound
;
224 sal_Bool mbDirection
;
225 sal_Int32 mnFadeColor
;
230 PresChange mePresChange
;
236 bool mbEffectAmbiguous
;
237 bool mbDurationAmbiguous
;
238 bool mbTimeAmbiguous
;
239 bool mbPresChangeAmbiguous
;
240 bool mbSoundAmbiguous
;
241 bool mbLoopSoundAmbiguous
;
247 // ______________________
249 // Local Helper Functions
250 // ______________________
255 void lcl_ApplyToPages(
256 const ::sd::slidesorter::SharedPageSelection
& rpPages
,
257 const ::sd::impl::TransitionEffect
& rEffect
)
259 ::std::vector
< SdPage
* >::const_iterator
aIt( rpPages
->begin());
260 const ::std::vector
< SdPage
* >::const_iterator
aEndIt( rpPages
->end());
261 for( ; aIt
!= aEndIt
; ++aIt
)
263 rEffect
.applyTo( *(*aIt
) );
267 void lcl_CreateUndoForPages(
268 const ::sd::slidesorter::SharedPageSelection
& rpPages
,
269 ::sd::ViewShellBase
& rBase
)
271 ::sd::DrawDocShell
* pDocSh
= rBase
.GetDocShell();
272 SfxUndoManager
* pManager
= pDocSh
->GetUndoManager();
273 SdDrawDocument
* pDoc
= pDocSh
->GetDoc();
274 if( pManager
&& pDocSh
&& pDoc
)
276 String
aComment( SdResId(STR_UNDO_SLIDE_PARAMS
) );
277 pManager
->EnterListAction(aComment
, aComment
);
278 SdUndoGroup
* pUndoGroup
= new SdUndoGroup( pDoc
);
279 pUndoGroup
->SetComment( aComment
);
281 ::std::vector
< SdPage
* >::const_iterator
aIt( rpPages
->begin());
282 const ::std::vector
< SdPage
* >::const_iterator
aEndIt( rpPages
->end());
283 for( ; aIt
!= aEndIt
; ++aIt
)
285 pUndoGroup
->AddAction( new sd::UndoTransition( pDoc
, (*aIt
) ) );
288 pManager
->AddUndoAction( pUndoGroup
);
289 pManager
->LeaveListAction();
293 sal_uInt16
lcl_getTransitionEffectIndex(
294 SdDrawDocument
* pDoc
,
295 const ::sd::impl::TransitionEffect
& rTransition
)
297 // first entry: "<none>"
298 sal_uInt16 nResultIndex
= LISTBOX_ENTRY_NOTFOUND
;
302 sal_uInt16 nCurrentIndex
= 0;
303 const ::sd::TransitionPresetList
& rPresetList
= ::sd::TransitionPreset::getTransitionPresetList();
304 ::sd::TransitionPresetList::const_iterator
aIt( rPresetList
.begin());
305 const ::sd::TransitionPresetList::const_iterator
aEndIt( rPresetList
.end());
306 for( ; aIt
!= aEndIt
; ++aIt
, ++nCurrentIndex
)
308 if( rTransition
.operator==( *(*aIt
) ))
310 nResultIndex
= nCurrentIndex
;
319 ::sd::TransitionPresetPtr
lcl_getTransitionPresetByUIName(
320 SdDrawDocument
* pDoc
,
321 const OUString
& rUIName
)
323 ::sd::TransitionPresetPtr pResult
;
326 const ::sd::TransitionPresetList
& rPresetList
= ::sd::TransitionPreset::getTransitionPresetList();
327 ::sd::TransitionPresetList::const_iterator
aIter( rPresetList
.begin() );
328 const ::sd::TransitionPresetList::const_iterator
aEnd( rPresetList
.end() );
329 for( ; aIter
!= aEnd
; ++aIter
)
331 if( (*aIter
)->getUIName().equals( rUIName
))
342 struct lcl_EqualsSoundFileName
: public ::std::unary_function
< String
, bool >
344 explicit lcl_EqualsSoundFileName( const String
& rStr
) :
348 bool operator() ( const String
& rStr
) const
350 // note: formerly this was a case insensitive search for all
351 // platforms. It seems more sensible to do this platform-dependent
352 #if defined( WIN ) || defined( WNT )
353 return maStr
.EqualsIgnoreCaseAscii( rStr
);
355 return maStr
.Equals( rStr
);
363 // returns -1 if no object was found
364 bool lcl_findSoundInList( const ::std::vector
< String
> & rSoundList
,
365 const String
& rFileName
,
366 ::std::vector
< String
>::size_type
& rOutPosition
)
368 ::std::vector
< String
>::const_iterator aIt
=
369 ::std::find_if( rSoundList
.begin(), rSoundList
.end(),
370 lcl_EqualsSoundFileName( rFileName
));
371 if( aIt
!= rSoundList
.end())
373 rOutPosition
= ::std::distance( rSoundList
.begin(), aIt
);
380 String
lcl_getSoundFileURL(
381 const ::std::vector
< String
> & rSoundList
,
382 const ListBox
& rListBox
)
386 if( rListBox
.GetSelectEntryCount() > 0 )
388 sal_uInt16 nPos
= rListBox
.GetSelectEntryPos();
389 // the first three entries are no actual sounds
392 DBG_ASSERT( (sal_uInt32
)(rListBox
.GetEntryCount() - 3) == rSoundList
.size(),
393 "Sound list-box is not synchronized to sound list" );
395 if( rSoundList
.size() > nPos
)
396 aResult
= rSoundList
[ nPos
];
403 struct lcl_AppendSoundToListBox
: public ::std::unary_function
< String
, void >
405 lcl_AppendSoundToListBox( ListBox
& rListBox
) :
406 mrListBox( rListBox
)
409 void operator() ( const String
& rString
) const
411 INetURLObject
aURL( rString
);
412 mrListBox
.InsertEntry( aURL
.GetBase(), LISTBOX_APPEND
);
419 void lcl_FillSoundListBox(
420 const ::std::vector
< String
> & rSoundList
,
421 ListBox
& rOutListBox
)
423 sal_uInt16 nCount
= rOutListBox
.GetEntryCount();
425 // keep first three entries
426 for( sal_uInt16 i
=nCount
- 1; i
>=3; --i
)
427 rOutListBox
.RemoveEntry( i
);
429 ::std::for_each( rSoundList
.begin(), rSoundList
.end(),
430 lcl_AppendSoundToListBox( rOutListBox
));
433 } // anonymous namespace
438 // ___________________
440 // SlideTransitionPane
441 // ___________________
443 SlideTransitionPane::SlideTransitionPane(
445 ViewShellBase
& rBase
,
446 const Size
& rMinSize
,
447 SdDrawDocument
* pDoc
) :
448 Control( pParent
, SdResId( DLG_SLIDE_TRANSITION_PANE
) ),
452 maMinSize( rMinSize
),
453 maFL_APPLY_TRANSITION( this, SdResId( FL_APPLY_TRANSITION
) ),
454 maLB_SLIDE_TRANSITIONS( this, SdResId( LB_SLIDE_TRANSITIONS
) ),
455 maFL_MODIFY_TRANSITION( this, SdResId( FL_MODIFY_TRANSITION
) ),
456 maFT_SPEED( this, SdResId( FT_SPEED
) ),
457 maLB_SPEED( this, SdResId( LB_SPEED
) ),
458 maFT_SOUND( this, SdResId( FT_SOUND
) ),
459 maLB_SOUND( this, SdResId( LB_SOUND
) ),
460 maCB_LOOP_SOUND( this, SdResId( CB_LOOP_SOUND
) ),
461 maFL_ADVANCE_SLIDE( this, SdResId( FL_ADVANCE_SLIDE
) ),
462 maRB_ADVANCE_ON_MOUSE( this, SdResId( RB_ADVANCE_ON_MOUSE
) ),
463 maRB_ADVANCE_AUTO( this, SdResId( RB_ADVANCE_AUTO
) ),
464 maMF_ADVANCE_AUTO_AFTER( this, SdResId( MF_ADVANCE_AUTO_AFTER
) ),
465 maFL_EMPTY1( this, SdResId( FL_EMPTY1
) ),
466 maPB_APPLY_TO_ALL( this, SdResId( PB_APPLY_TO_ALL
) ),
467 maPB_PLAY( this, SdResId( PB_PLAY
) ),
468 maPB_SLIDE_SHOW( this, SdResId( PB_SLIDE_SHOW
) ),
469 maFL_EMPTY2( this, SdResId( FL_EMPTY2
) ),
470 maCB_AUTO_PREVIEW( this, SdResId( CB_AUTO_PREVIEW
) ),
472 maSTR_NO_TRANSITION( SdResId( STR_NO_TRANSITION
) ),
473 mbHasSelection( false ),
474 mbUpdatingControls( false ),
475 mbIsMainViewChangePending( false ),
478 // use no resource ids from here on
481 // use bold font for group headings (same font for all fixed lines):
482 Font
font( maFL_APPLY_TRANSITION
.GetFont() );
483 font
.SetWeight( WEIGHT_BOLD
);
484 maFL_APPLY_TRANSITION
.SetFont( font
);
485 maFL_MODIFY_TRANSITION
.SetFont( font
);
486 maFL_ADVANCE_SLIDE
.SetFont( font
);
489 mxModel
.set( pDoc
->getUnoModel(), uno::UNO_QUERY
);
490 // TODO: get correct view
492 mxView
.set( mxModel
->getCurrentController(), uno::UNO_QUERY
);
494 // fill list box of slide transitions
495 maLB_SLIDE_TRANSITIONS
.InsertEntry( maSTR_NO_TRANSITION
);
498 maCB_AUTO_PREVIEW
.Check(); // automatic preview on
500 // update control states before adding handlers
502 // updateSoundList();
506 maPB_APPLY_TO_ALL
.SetClickHdl( LINK( this, SlideTransitionPane
, ApplyToAllButtonClicked
));
507 maPB_PLAY
.SetClickHdl( LINK( this, SlideTransitionPane
, PlayButtonClicked
));
508 maPB_SLIDE_SHOW
.SetClickHdl( LINK( this, SlideTransitionPane
, SlideShowButtonClicked
));
510 maLB_SLIDE_TRANSITIONS
.SetSelectHdl( LINK( this, SlideTransitionPane
, TransitionSelected
));
512 maLB_SPEED
.SetSelectHdl( LINK( this, SlideTransitionPane
, SpeedListBoxSelected
));
513 maLB_SOUND
.SetSelectHdl( LINK( this, SlideTransitionPane
, SoundListBoxSelected
));
514 maCB_LOOP_SOUND
.SetClickHdl( LINK( this, SlideTransitionPane
, LoopSoundBoxChecked
));
516 maRB_ADVANCE_ON_MOUSE
.SetToggleHdl( LINK( this, SlideTransitionPane
, AdvanceSlideRadioButtonToggled
));
517 maRB_ADVANCE_AUTO
.SetToggleHdl( LINK( this, SlideTransitionPane
, AdvanceSlideRadioButtonToggled
));
518 maMF_ADVANCE_AUTO_AFTER
.SetModifyHdl( LINK( this, SlideTransitionPane
, AdvanceTimeModified
));
519 maCB_AUTO_PREVIEW
.SetClickHdl( LINK( this, SlideTransitionPane
, AutoPreviewClicked
));
522 maLateInitTimer
.SetTimeout(200);
523 maLateInitTimer
.SetTimeoutHdl(LINK(this, SlideTransitionPane
, LateInitCallback
));
524 maLateInitTimer
.Start();
527 SlideTransitionPane::~SlideTransitionPane()
529 maLateInitTimer
.Stop();
533 void SlideTransitionPane::Resize()
538 void SlideTransitionPane::onSelectionChanged()
543 void SlideTransitionPane::onChangeCurrentPage()
548 ::sd::slidesorter::SharedPageSelection
SlideTransitionPane::getSelectedPages (void) const
550 ::sd::slidesorter::SlideSorterViewShell
* pSlideSorterViewShell
551 = ::sd::slidesorter::SlideSorterViewShell::GetSlideSorter(mrBase
);
552 // DBG_ASSERT( pSlideSorterViewShell, "No Slide-Sorter available" );
553 ::boost::shared_ptr
<sd::slidesorter::SlideSorterViewShell::PageSelection
> pSelection
;
555 if( pSlideSorterViewShell
)
557 pSelection
= pSlideSorterViewShell
->GetPageSelection();
561 pSelection
.reset(new sd::slidesorter::SlideSorterViewShell::PageSelection());
564 SdPage
* pPage
= SdPage::getImplementation( mxView
->getCurrentPage() );
566 pSelection
->push_back(pPage
);
573 void SlideTransitionPane::updateLayout()
575 ::Size
aPaneSize( GetSizePixel() );
576 if( aPaneSize
.Width() < maMinSize
.Width() )
577 aPaneSize
.Width() = maMinSize
.Width();
579 if( aPaneSize
.Height() < maMinSize
.Height() )
580 aPaneSize
.Height() = maMinSize
.Height();
582 // start layouting elements from bottom to top. The remaining space is used
583 // for the topmost list box
584 ::Point
aOffset( LogicToPixel( Point( 3, 3 ), MAP_APPFONT
) );
585 long nOffsetX
= aOffset
.getX();
586 long nOffsetY
= aOffset
.getY();
587 long nOffsetBtnX
= LogicToPixel( Point( 6, 1 ), MAP_APPFONT
).getX();
589 const long nMinCtrlWidth
= LogicToPixel( ::Point( 32, 1 ), MAP_APPFONT
).getX();
590 const long nTextIndent
= LogicToPixel( ::Point( RSC_SP_CHK_TEXTINDENT
, 1 ), MAP_APPFONT
).getX();
592 ::Point
aUpperLeft( nOffsetX
, aPaneSize
.getHeight() - nOffsetY
);
593 long nMaxWidth
= aPaneSize
.getWidth() - 2 * nOffsetX
;
595 // auto preview check-box
596 ::Size aCtrlSize
= maCB_AUTO_PREVIEW
.GetSizePixel();
597 aCtrlSize
.setWidth( maCB_AUTO_PREVIEW
.CalcMinimumSize( nMaxWidth
).getWidth());
598 aUpperLeft
.setY( aUpperLeft
.getY() - aCtrlSize
.getHeight());
599 maCB_AUTO_PREVIEW
.SetPosSizePixel( aUpperLeft
, aCtrlSize
);
601 // fixed line above check-box
602 aCtrlSize
= maFL_EMPTY2
.GetSizePixel();
603 aCtrlSize
.setWidth( nMaxWidth
);
604 aUpperLeft
.setY( aUpperLeft
.getY() - aCtrlSize
.getHeight());
605 maFL_EMPTY2
.SetPosSizePixel( aUpperLeft
, aCtrlSize
);
607 // buttons "Play" and "Slide Show"
608 long nPlayButtonWidth
= maPB_PLAY
.CalcMinimumSize().getWidth() + 2 * nOffsetBtnX
;
609 long nSlideShowButtonWidth
= maPB_SLIDE_SHOW
.CalcMinimumSize().getWidth() + 2 * nOffsetBtnX
;
611 if( (nPlayButtonWidth
+ nSlideShowButtonWidth
+ nOffsetX
) <= nMaxWidth
)
613 // place buttons side by side
614 aCtrlSize
= maPB_PLAY
.GetSizePixel();
615 aUpperLeft
.setY( aUpperLeft
.getY() - aCtrlSize
.getHeight());
616 aCtrlSize
.setWidth( nPlayButtonWidth
);
617 maPB_PLAY
.SetPosSizePixel( aUpperLeft
, aCtrlSize
);
619 aUpperLeft
.setX( aUpperLeft
.getX() + nPlayButtonWidth
+ nOffsetX
);
620 aCtrlSize
.setWidth( nSlideShowButtonWidth
);
621 maPB_SLIDE_SHOW
.SetPosSizePixel( aUpperLeft
, aCtrlSize
);
622 aUpperLeft
.setX( nOffsetX
);
626 // place buttons on top of each other
627 aCtrlSize
= maPB_SLIDE_SHOW
.GetSizePixel();
628 aUpperLeft
.setY( aUpperLeft
.getY() - aCtrlSize
.getHeight());
629 aCtrlSize
.setWidth( nSlideShowButtonWidth
);
630 maPB_SLIDE_SHOW
.SetPosSizePixel( aUpperLeft
, aCtrlSize
);
632 aCtrlSize
= maPB_PLAY
.GetSizePixel();
633 aUpperLeft
.setY( aUpperLeft
.getY() - aCtrlSize
.getHeight() - nOffsetY
);
634 aCtrlSize
.setWidth( nPlayButtonWidth
);
635 maPB_PLAY
.SetPosSizePixel( aUpperLeft
, aCtrlSize
);
638 // "Apply to All Slides" button
639 aCtrlSize
= maPB_APPLY_TO_ALL
.GetSizePixel();
640 aCtrlSize
.setWidth( maPB_APPLY_TO_ALL
.CalcMinimumSize( nMaxWidth
).getWidth() + 2 * nOffsetBtnX
);
641 aUpperLeft
.setY( aUpperLeft
.getY() - aCtrlSize
.getHeight() - nOffsetY
);
642 maPB_APPLY_TO_ALL
.SetPosSizePixel( aUpperLeft
, aCtrlSize
);
644 // fixed line above "Apply to All Slides" button
645 aCtrlSize
= maFL_EMPTY1
.GetSizePixel();
646 aCtrlSize
.setWidth( nMaxWidth
);
647 aUpperLeft
.setY( aUpperLeft
.getY() - aCtrlSize
.getHeight());
648 maFL_EMPTY1
.SetPosSizePixel( aUpperLeft
, aCtrlSize
);
650 // advance automatically after ... seconds
651 long nItemWidth
= maRB_ADVANCE_AUTO
.CalcMinimumSize().getWidth();
653 if( (nItemWidth
+ nMinCtrlWidth
+ nOffsetX
) <= nMaxWidth
)
655 long nBase
= aUpperLeft
.getY();
657 // place controls side by side
658 aCtrlSize
= maRB_ADVANCE_AUTO
.GetSizePixel();
659 aUpperLeft
.setY( nBase
- aCtrlSize
.getHeight());
660 aCtrlSize
.setWidth( nItemWidth
);
661 maRB_ADVANCE_AUTO
.SetPosSizePixel( aUpperLeft
, aCtrlSize
);
663 aCtrlSize
= maMF_ADVANCE_AUTO_AFTER
.GetSizePixel();
664 aUpperLeft
.setY( nBase
- aCtrlSize
.getHeight() );
665 aUpperLeft
.setX( aUpperLeft
.getX() + nItemWidth
+ nOffsetX
);
666 aCtrlSize
.setWidth( nMinCtrlWidth
);
667 maMF_ADVANCE_AUTO_AFTER
.SetPosSizePixel( aUpperLeft
, aCtrlSize
);
668 aUpperLeft
.setX( nOffsetX
);
672 // place controls on top of each other
673 aCtrlSize
= maMF_ADVANCE_AUTO_AFTER
.GetSizePixel();
674 aUpperLeft
.setX( nOffsetX
+ nTextIndent
);
675 aUpperLeft
.setY( aUpperLeft
.getY() - aCtrlSize
.getHeight());
676 aCtrlSize
.setWidth( nMinCtrlWidth
);
677 maMF_ADVANCE_AUTO_AFTER
.SetPosSizePixel( aUpperLeft
, aCtrlSize
);
679 aCtrlSize
= maRB_ADVANCE_AUTO
.GetSizePixel();
680 aUpperLeft
.setY( aUpperLeft
.getY() - aCtrlSize
.getHeight() - nOffsetY
);
681 aUpperLeft
.setX( nOffsetX
);
682 aCtrlSize
.setWidth( nItemWidth
);
683 maRB_ADVANCE_AUTO
.SetPosSizePixel( aUpperLeft
, aCtrlSize
);
684 aUpperLeft
.setX( nOffsetX
);
687 // check box "On mouse click"
688 aCtrlSize
= maRB_ADVANCE_ON_MOUSE
.GetSizePixel();
689 aCtrlSize
.setWidth( nMaxWidth
);
690 aUpperLeft
.setY( aUpperLeft
.getY() - aCtrlSize
.getHeight() - nOffsetY
);
691 maRB_ADVANCE_ON_MOUSE
.SetPosSizePixel( aUpperLeft
, aCtrlSize
);
693 // fixed line "Advance slide"
694 aCtrlSize
= maFL_ADVANCE_SLIDE
.GetSizePixel();
695 aCtrlSize
.setWidth( nMaxWidth
);
696 aUpperLeft
.setY( aUpperLeft
.getY() - aCtrlSize
.getHeight() - nOffsetY
);
697 maFL_ADVANCE_SLIDE
.SetPosSizePixel( aUpperLeft
, aCtrlSize
);
699 // check box "Loop until next sound"
700 long nFTSpeedWidth
= maFT_SPEED
.CalcMinimumSize().getWidth() + 2 * nOffsetX
;
701 long nFTSoundWidth
= maFT_SOUND
.CalcMinimumSize().getWidth() + 2 * nOffsetX
;
702 long nIndent
= ::std::max( nFTSoundWidth
, nFTSpeedWidth
);
704 bool bStack
= ( (nIndent
+ nMinCtrlWidth
+ nOffsetX
) > nMaxWidth
);
707 nIndent
= nTextIndent
;
709 aCtrlSize
= maCB_LOOP_SOUND
.GetSizePixel();
710 aCtrlSize
.setWidth( nMaxWidth
- nIndent
);
711 aUpperLeft
.setY( aUpperLeft
.getY() - aCtrlSize
.getHeight() - nOffsetY
);
712 aUpperLeft
.setX( nIndent
);
713 maCB_LOOP_SOUND
.SetPosSizePixel( aUpperLeft
, aCtrlSize
);
715 aCtrlSize
= maLB_SOUND
.GetSizePixel();
716 aCtrlSize
.setWidth( ::std::max( nMaxWidth
- nIndent
, nMinCtrlWidth
) );
717 aUpperLeft
.setY( aUpperLeft
.getY() - aCtrlSize
.getHeight() - nOffsetY
);
718 maLB_SOUND
.SetPosSizePixel( aUpperLeft
, aCtrlSize
);
719 maLB_SOUND
.SetDropDownLineCount( 8 );
720 aUpperLeft
.setX( nOffsetX
);
722 aCtrlSize
= maFT_SOUND
.GetSizePixel();
724 aUpperLeft
.setY( aUpperLeft
.getY() - aCtrlSize
.getHeight());
725 aCtrlSize
.setWidth( nFTSoundWidth
);
726 maFT_SOUND
.SetPosSizePixel( aUpperLeft
, aCtrlSize
);
728 aUpperLeft
.setX( nIndent
);
729 aCtrlSize
= maLB_SPEED
.GetSizePixel();
730 aCtrlSize
.setWidth( ::std::max( nMaxWidth
- nIndent
, nMinCtrlWidth
) );
731 aUpperLeft
.setY( aUpperLeft
.getY() - aCtrlSize
.getHeight() - nOffsetY
);
732 maLB_SPEED
.SetPosSizePixel( aUpperLeft
, aCtrlSize
);
733 maLB_SPEED
.SetDropDownLineCount( 3 );
734 aUpperLeft
.setX( nOffsetX
);
736 aCtrlSize
= maFT_SPEED
.GetSizePixel();
738 aUpperLeft
.setY( aUpperLeft
.getY() - aCtrlSize
.getHeight());
739 aCtrlSize
.setWidth( nFTSpeedWidth
);
740 maFT_SPEED
.SetPosSizePixel( aUpperLeft
, aCtrlSize
);
742 // fixed line "Modify Transition"
743 aCtrlSize
= maFL_MODIFY_TRANSITION
.GetSizePixel();
744 aCtrlSize
.setWidth( nMaxWidth
);
745 aUpperLeft
.setY( aUpperLeft
.getY() - aCtrlSize
.getHeight() - nOffsetY
);
746 maFL_MODIFY_TRANSITION
.SetPosSizePixel( aUpperLeft
, aCtrlSize
);
748 // fixed line "Apply to selected slides"
749 aCtrlSize
= maFL_APPLY_TRANSITION
.GetSizePixel();
750 aCtrlSize
.setWidth( nMaxWidth
);
751 ::Point
aUpperLeftCorner( nOffsetX
, nOffsetY
);
752 maFL_APPLY_TRANSITION
.SetPosSizePixel( aUpperLeftCorner
, aCtrlSize
);
753 aUpperLeftCorner
.setY( aUpperLeftCorner
.getY() + aCtrlSize
.getHeight() + nOffsetY
);
754 aUpperLeft
.setY( aUpperLeft
.getY() - nOffsetY
);
756 // list box slide transitions
757 aCtrlSize
.setWidth( nMaxWidth
);
758 aCtrlSize
.setHeight( aUpperLeft
.getY() - aUpperLeftCorner
.getY() );
759 maLB_SLIDE_TRANSITIONS
.SetPosSizePixel( aUpperLeftCorner
, aCtrlSize
);
762 void SlideTransitionPane::updateControls()
764 ::sd::slidesorter::SharedPageSelection
pSelectedPages(getSelectedPages());
765 if( pSelectedPages
->empty())
767 mbHasSelection
= false;
770 mbHasSelection
= true;
772 DBG_ASSERT( ! mbUpdatingControls
, "Multiple Control Updates" );
773 mbUpdatingControls
= true;
775 // get model data for first page
776 SdPage
* pFirstPage
= pSelectedPages
->front();
777 DBG_ASSERT( pFirstPage
, "Invalid Page" );
779 impl::TransitionEffect
aEffect( *pFirstPage
);
781 // merge with other pages
782 ::sd::slidesorter::SlideSorterViewShell::PageSelection::const_iterator
aIt(
783 pSelectedPages
->begin());
784 ::sd::slidesorter::SlideSorterViewShell::PageSelection::const_iterator
aEndIt(
785 pSelectedPages
->end());
787 // start with second page (note aIt != aEndIt, because ! aSelectedPages.empty())
788 for( ++aIt
;aIt
!= aEndIt
; ++aIt
)
791 aEffect
.compareWith( *(*aIt
) );
794 // detect current slide effect
795 if( aEffect
.mbEffectAmbiguous
)
796 maLB_SLIDE_TRANSITIONS
.SetNoSelection();
799 // ToDo: That 0 is "no transition" is documented nowhere except in the
801 if( aEffect
.mnType
== 0 )
802 maLB_SLIDE_TRANSITIONS
.SelectEntryPos( 0 );
805 sal_uInt16 nEntry
= lcl_getTransitionEffectIndex( mpDrawDoc
, aEffect
);
806 if( nEntry
== LISTBOX_ENTRY_NOTFOUND
)
807 maLB_SLIDE_TRANSITIONS
.SetNoSelection();
810 // first entry in list is "none", so add 1 after translation
811 if( m_aPresetIndexes
.find( nEntry
) != m_aPresetIndexes
.end())
812 maLB_SLIDE_TRANSITIONS
.SelectEntryPos( m_aPresetIndexes
[ nEntry
] + 1 );
814 maLB_SLIDE_TRANSITIONS
.SetNoSelection();
819 if( aEffect
.mbDurationAmbiguous
)
820 maLB_SPEED
.SetNoSelection();
822 maLB_SPEED
.SelectEntryPos(
823 (aEffect
.mfDuration
> 2.0 )
824 ? 0 : (aEffect
.mfDuration
< 2.0)
825 ? 2 : 1 ); // else FADE_SPEED_FAST
827 if( aEffect
.mbSoundAmbiguous
)
829 maLB_SOUND
.SetNoSelection();
830 maCurrentSoundFile
.Erase();
834 maCurrentSoundFile
.Erase();
835 if( aEffect
.mbStopSound
)
837 maLB_SOUND
.SelectEntryPos( 1 );
839 else if( aEffect
.mbSoundOn
&& aEffect
.maSound
.Len() > 0 )
841 tSoundListType::size_type nPos
= 0;
842 if( lcl_findSoundInList( maSoundList
, aEffect
.maSound
, nPos
))
844 // skip first three entries
845 maLB_SOUND
.SelectEntryPos( (USHORT
)nPos
+ 3 );
846 maCurrentSoundFile
= aEffect
.maSound
;
851 maLB_SOUND
.SelectEntryPos( 0 );
855 if( aEffect
.mbLoopSoundAmbiguous
)
857 maCB_LOOP_SOUND
.SetState( STATE_DONTKNOW
);
861 maCB_LOOP_SOUND
.Check( aEffect
.mbLoopSound
);
864 if( aEffect
.mbPresChangeAmbiguous
)
866 maRB_ADVANCE_ON_MOUSE
.Check( FALSE
);
867 maRB_ADVANCE_AUTO
.Check( FALSE
);
871 maRB_ADVANCE_ON_MOUSE
.Check( aEffect
.mePresChange
== PRESCHANGE_MANUAL
);
872 maRB_ADVANCE_AUTO
.Check( aEffect
.mePresChange
== PRESCHANGE_AUTO
);
873 maMF_ADVANCE_AUTO_AFTER
.SetValue( aEffect
.mnTime
);
876 SdOptions
* pOptions
= SD_MOD()->GetSdOptions(DOCUMENT_TYPE_IMPRESS
);
877 maCB_AUTO_PREVIEW
.Check( pOptions
->IsPreviewTransitions() == sal_True
);
879 mbUpdatingControls
= false;
881 updateControlState();
884 void SlideTransitionPane::updateControlState()
886 maLB_SLIDE_TRANSITIONS
.Enable( mbHasSelection
);
887 maLB_SPEED
.Enable( mbHasSelection
);
888 maLB_SOUND
.Enable( mbHasSelection
);
889 maCB_LOOP_SOUND
.Enable( mbHasSelection
&& (maLB_SOUND
.GetSelectEntryPos() > 2));
890 maRB_ADVANCE_ON_MOUSE
.Enable( mbHasSelection
);
891 maRB_ADVANCE_AUTO
.Enable( mbHasSelection
);
892 maMF_ADVANCE_AUTO_AFTER
.Enable( mbHasSelection
&& maRB_ADVANCE_AUTO
.IsChecked());
894 maPB_APPLY_TO_ALL
.Enable( mbHasSelection
);
895 maPB_PLAY
.Enable( mbHasSelection
);
896 // maPB_SLIDE_SHOW.Enable( TRUE );
897 maCB_AUTO_PREVIEW
.Enable( mbHasSelection
);
900 void SlideTransitionPane::updateSoundList()
904 GalleryExplorer::FillObjList( GALLERY_THEME_SOUNDS
, aSoundList
);
905 GalleryExplorer::FillObjList( GALLERY_THEME_USERSOUNDS
, aSoundList
);
907 sal_uInt32 nCount
= aSoundList
.Count();
909 maSoundList
.reserve( nCount
);
910 for( sal_uInt32 i
=0; i
<nCount
; ++i
)
912 String
* pEntry
= reinterpret_cast< String
* >( aSoundList
.GetObject( i
));
915 // store copy of string in member list
916 maSoundList
.push_back( *pEntry
);
917 // delete pointer in temporary List
922 lcl_FillSoundListBox( maSoundList
, maLB_SOUND
);
925 void SlideTransitionPane::openSoundFileDialog()
927 if( ! maLB_SOUND
.IsEnabled())
930 SdOpenSoundFileDialog aFileDialog
;
933 DBG_ASSERT( maLB_SOUND
.GetSelectEntryPos() == 2,
934 "Dialog should only open when \"Other sound\" is selected" );
935 aFile
= SvtPathOptions().GetGraphicPath();
937 aFileDialog
.SetPath( aFile
);
939 bool bValidSoundFile( false );
940 bool bQuitLoop( false );
942 while( ! bQuitLoop
&&
943 aFileDialog
.Execute() == ERRCODE_NONE
)
945 aFile
= aFileDialog
.GetPath();
946 tSoundListType::size_type nPos
= 0;
947 bValidSoundFile
= lcl_findSoundInList( maSoundList
, aFile
, nPos
);
949 if( bValidSoundFile
)
953 else // not in sound list
955 // try to insert into gallery
956 if( GalleryExplorer::InsertURL( GALLERY_THEME_USERSOUNDS
, aFile
, SGA_FORMAT_SOUND
) )
959 bValidSoundFile
= lcl_findSoundInList( maSoundList
, aFile
, nPos
);
960 DBG_ASSERT( bValidSoundFile
, "Adding sound to gallery failed" );
966 String
aStrWarning(SdResId(STR_WARNING_NOSOUNDFILE
));
967 String
aStr( sal_Unicode( '%' ));
968 aStrWarning
.SearchAndReplace( aStr
, aFile
);
969 WarningBox
aWarningBox( NULL
, WB_3DLOOK
| WB_RETRY_CANCEL
, aStrWarning
);
970 aWarningBox
.SetModalInputMode (TRUE
);
971 bQuitLoop
= (aWarningBox
.Execute() != RET_RETRY
);
973 bValidSoundFile
= false;
977 if( bValidSoundFile
)
978 // skip first three entries in list
979 maLB_SOUND
.SelectEntryPos( (USHORT
)nPos
+ 3 );
982 if( ! bValidSoundFile
)
984 if( maCurrentSoundFile
.Len() > 0 )
986 tSoundListType::size_type nPos
= 0;
987 if( lcl_findSoundInList( maSoundList
, maCurrentSoundFile
, nPos
))
988 maLB_SOUND
.SelectEntryPos( (USHORT
)nPos
+ 3 );
990 maLB_SOUND
.SelectEntryPos( 0 ); // NONE
993 maLB_SOUND
.SelectEntryPos( 0 ); // NONE
997 impl::TransitionEffect
SlideTransitionPane::getTransitionEffectFromControls() const
999 impl::TransitionEffect aResult
;
1000 aResult
.setAllAmbiguous();
1002 // check first (aResult might be overwritten)
1003 if( maLB_SLIDE_TRANSITIONS
.IsEnabled() &&
1004 maLB_SLIDE_TRANSITIONS
.GetSelectEntryCount() > 0 )
1006 TransitionPresetPtr pPreset
= lcl_getTransitionPresetByUIName(
1007 mpDrawDoc
, OUString( maLB_SLIDE_TRANSITIONS
.GetSelectEntry()));
1011 aResult
= impl::TransitionEffect( *pPreset
);
1012 aResult
.setAllAmbiguous();
1018 aResult
.mbEffectAmbiguous
= false;
1022 if( maLB_SPEED
.IsEnabled() &&
1023 maLB_SPEED
.GetSelectEntryCount() > 0 )
1025 sal_uInt16 nPos
= maLB_SPEED
.GetSelectEntryPos();
1026 aResult
.mfDuration
= (nPos
== 0)
1031 DBG_ASSERT( aResult
.mfDuration
!= 1.0 || nPos
== 2, "Invalid Listbox Entry" );
1033 aResult
.mbDurationAmbiguous
= false;
1036 // slide-advance mode
1037 if( maRB_ADVANCE_ON_MOUSE
.IsEnabled() && maRB_ADVANCE_AUTO
.IsEnabled() &&
1038 (maRB_ADVANCE_ON_MOUSE
.IsChecked() || maRB_ADVANCE_AUTO
.IsChecked()))
1040 if( maRB_ADVANCE_ON_MOUSE
.IsChecked())
1041 aResult
.mePresChange
= PRESCHANGE_MANUAL
;
1044 aResult
.mePresChange
= PRESCHANGE_AUTO
;
1045 if( maMF_ADVANCE_AUTO_AFTER
.IsEnabled())
1047 // sal_uInt16 nDigits = maMF_ADVANCE_AUTO_AFTER.GetDecimalDigits();
1048 aResult
.mnTime
= static_cast<long>(maMF_ADVANCE_AUTO_AFTER
.GetValue());
1049 // / static_cast< sal_uInt16 >( pow( 10.0, static_cast< double >( nDigits )));
1050 aResult
.mbTimeAmbiguous
= false;
1054 aResult
.mbPresChangeAmbiguous
= false;
1058 if( maLB_SOUND
.IsEnabled())
1060 maCurrentSoundFile
.Erase();
1061 if( maLB_SOUND
.GetSelectEntryCount() > 0 )
1063 sal_uInt16 nPos
= maLB_SOUND
.GetSelectEntryPos();
1064 aResult
.mbStopSound
= nPos
== 1;
1065 aResult
.mbSoundOn
= nPos
> 1;
1066 if( aResult
.mbStopSound
)
1068 aResult
.maSound
= OUString();
1069 aResult
.mbSoundAmbiguous
= false;
1073 aResult
.maSound
= lcl_getSoundFileURL( maSoundList
, maLB_SOUND
);
1074 aResult
.mbSoundAmbiguous
= false;
1075 maCurrentSoundFile
= aResult
.maSound
;
1081 if( maCB_LOOP_SOUND
.IsEnabled() )
1083 aResult
.mbLoopSound
= maCB_LOOP_SOUND
.IsChecked();
1084 aResult
.mbLoopSoundAmbiguous
= false;
1090 void SlideTransitionPane::applyToSelectedPages()
1092 if( ! mbUpdatingControls
)
1094 ::sd::slidesorter::SharedPageSelection
pSelectedPages( getSelectedPages());
1095 if( ! pSelectedPages
->empty())
1097 lcl_CreateUndoForPages( pSelectedPages
, mrBase
);
1098 lcl_ApplyToPages( pSelectedPages
, getTransitionEffectFromControls() );
1099 mrBase
.GetDocShell()->SetModified();
1101 if( maCB_AUTO_PREVIEW
.IsEnabled() &&
1102 maCB_AUTO_PREVIEW
.IsChecked())
1104 playCurrentEffect();
1109 void SlideTransitionPane::playCurrentEffect()
1114 Reference
< ::com::sun::star::animations::XAnimationNode
> xNode
;
1115 SlideShow::StartPreview( mrBase
, mxView
->getCurrentPage(), xNode
);
1119 void SlideTransitionPane::addListener()
1121 Link
aLink( LINK(this,SlideTransitionPane
,EventMultiplexerListener
) );
1122 mrBase
.GetEventMultiplexer()->AddEventListener (
1124 tools::EventMultiplexerEvent::EID_EDIT_VIEW_SELECTION
1125 | tools::EventMultiplexerEvent::EID_SLIDE_SORTER_SELECTION
1126 | tools::EventMultiplexerEvent::EID_CURRENT_PAGE
1127 | tools::EventMultiplexerEvent::EID_MAIN_VIEW_REMOVED
1128 | tools::EventMultiplexerEvent::EID_MAIN_VIEW_ADDED
1129 | tools::EventMultiplexerEvent::EID_CONFIGURATION_UPDATED
);
1132 void SlideTransitionPane::removeListener()
1134 Link
aLink( LINK(this,SlideTransitionPane
,EventMultiplexerListener
) );
1135 mrBase
.GetEventMultiplexer()->RemoveEventListener( aLink
);
1138 IMPL_LINK(SlideTransitionPane
,EventMultiplexerListener
,
1139 tools::EventMultiplexerEvent
*,pEvent
)
1141 switch (pEvent
->meEventId
)
1143 case tools::EventMultiplexerEvent::EID_EDIT_VIEW_SELECTION
:
1144 onSelectionChanged();
1147 case tools::EventMultiplexerEvent::EID_CURRENT_PAGE
:
1148 case tools::EventMultiplexerEvent::EID_SLIDE_SORTER_SELECTION
:
1149 onChangeCurrentPage();
1152 case tools::EventMultiplexerEvent::EID_MAIN_VIEW_REMOVED
:
1153 mxView
= Reference
<drawing::XDrawView
>();
1154 onSelectionChanged();
1155 onChangeCurrentPage();
1158 case tools::EventMultiplexerEvent::EID_MAIN_VIEW_ADDED
:
1159 mbIsMainViewChangePending
= true;
1162 case tools::EventMultiplexerEvent::EID_CONFIGURATION_UPDATED
:
1163 if (mbIsMainViewChangePending
)
1165 mbIsMainViewChangePending
= false;
1167 // At this moment the controller may not yet been set at
1168 // model or ViewShellBase. Take it from the view shell
1169 // passed with the event.
1170 if (mrBase
.GetMainViewShell() != NULL
)
1172 mxView
= Reference
<drawing::XDrawView
>::query(mrBase
.GetController());
1173 onSelectionChanged();
1174 onChangeCurrentPage();
1185 IMPL_LINK( SlideTransitionPane
, ApplyToAllButtonClicked
, void *, EMPTYARG
)
1187 DBG_ASSERT( mpDrawDoc
, "Invalid Draw Document!" );
1191 ::sd::slidesorter::SharedPageSelection
pPages (
1192 new ::sd::slidesorter::SlideSorterViewShell::PageSelection());
1194 sal_uInt16 nPageCount
= mpDrawDoc
->GetSdPageCount( PK_STANDARD
);
1195 pPages
->reserve( nPageCount
);
1196 for( sal_uInt16 i
=0; i
<nPageCount
; ++i
)
1198 SdPage
* pPage
= mpDrawDoc
->GetSdPage( i
, PK_STANDARD
);
1200 pPages
->push_back( pPage
);
1203 if( ! pPages
->empty())
1205 lcl_CreateUndoForPages( pPages
, mrBase
);
1206 lcl_ApplyToPages( pPages
, getTransitionEffectFromControls() );
1213 IMPL_LINK( SlideTransitionPane
, PlayButtonClicked
, void *, EMPTYARG
)
1215 playCurrentEffect();
1219 IMPL_LINK( SlideTransitionPane
, SlideShowButtonClicked
, void *, EMPTYARG
)
1221 mrBase
.StartPresentation();
1225 IMPL_LINK( SlideTransitionPane
, TransitionSelected
, void *, EMPTYARG
)
1227 applyToSelectedPages();
1231 IMPL_LINK( SlideTransitionPane
, AdvanceSlideRadioButtonToggled
, void *, EMPTYARG
)
1233 updateControlState();
1234 applyToSelectedPages();
1238 IMPL_LINK( SlideTransitionPane
, AdvanceTimeModified
, void *, EMPTYARG
)
1240 applyToSelectedPages();
1244 IMPL_LINK( SlideTransitionPane
, SpeedListBoxSelected
, void *, EMPTYARG
)
1246 applyToSelectedPages();
1250 IMPL_LINK( SlideTransitionPane
, SoundListBoxSelected
, void *, EMPTYARG
)
1252 if( maLB_SOUND
.GetSelectEntryCount() )
1254 sal_uInt16 nPos
= maLB_SOUND
.GetSelectEntryPos();
1258 openSoundFileDialog();
1261 updateControlState();
1262 applyToSelectedPages();
1266 IMPL_LINK( SlideTransitionPane
, LoopSoundBoxChecked
, void *, EMPTYARG
)
1268 applyToSelectedPages();
1272 IMPL_LINK( SlideTransitionPane
, AutoPreviewClicked
, void *, EMPTYARG
)
1274 SdOptions
* pOptions
= SD_MOD()->GetSdOptions(DOCUMENT_TYPE_IMPRESS
);
1275 pOptions
->SetPreviewTransitions( maCB_AUTO_PREVIEW
.IsChecked() ? sal_True
: sal_False
);
1279 IMPL_LINK( SlideTransitionPane
, LateInitCallback
, Timer
*, EMPTYARG
)
1281 const TransitionPresetList
& rPresetList
= TransitionPreset::getTransitionPresetList();
1282 TransitionPresetList::const_iterator
aIter( rPresetList
.begin() );
1283 const TransitionPresetList::const_iterator
aEnd( rPresetList
.end() );
1284 sal_uInt16 nIndex
= 0;
1285 ::std::size_t nUIIndex
= 0;
1286 while( aIter
!= aEnd
)
1288 TransitionPresetPtr pPreset
= (*aIter
++);
1289 const OUString
aUIName( pPreset
->getUIName() );
1290 if( aUIName
.getLength() )
1292 maLB_SLIDE_TRANSITIONS
.InsertEntry( aUIName
);
1293 m_aPresetIndexes
[ nIndex
] = (sal_uInt16
)nUIIndex
;
1305 ::Window
* createSlideTransitionPanel( ::Window
* pParent
, ViewShellBase
& rBase
)
1307 DialogListBox
* pWindow
= 0;
1309 DrawDocShell
* pDocSh
= rBase
.GetDocShell();
1312 pWindow
= new DialogListBox( pParent
, WB_CLIPCHILDREN
|WB_TABSTOP
|WB_AUTOHSCROLL
);
1314 Size
aMinSize( pWindow
->LogicToPixel( Size( 72, 216 ), MAP_APPFONT
) );
1315 ::Window
* pPaneWindow
= new SlideTransitionPane( pWindow
, rBase
, aMinSize
, pDocSh
->GetDoc() );
1316 pWindow
->SetChildWindow( pPaneWindow
, aMinSize
);
1317 pWindow
->SetText( pPaneWindow
->GetText() );