20#include <config_features.h>
22#include <com/sun/star/presentation/EffectNodeType.hpp>
23#include <com/sun/star/animations/Timing.hpp>
24#include <com/sun/star/animations/Event.hpp>
25#include <com/sun/star/animations/EventTrigger.hpp>
26#include <com/sun/star/animations/AnimationFill.hpp>
27#include <com/sun/star/presentation/TextAnimationType.hpp>
28#include <com/sun/star/animations/ValuePair.hpp>
29#include <com/sun/star/awt/FontSlant.hpp>
30#include <com/sun/star/awt/FontWeight.hpp>
31#include <com/sun/star/awt/FontUnderline.hpp>
32#include <com/sun/star/drawing/XDrawPage.hpp>
33#include <com/sun/star/beans/XPropertySet.hpp>
34#include <com/sun/star/media/XPlayer.hpp>
57#include <editeng/editids.hrc>
75using ::com::sun::star::uno::UNO_QUERY;
76using ::com::sun::star::uno::Any;
77using ::com::sun::star::uno::Sequence;
78using ::com::sun::star::uno::Reference;
79using ::com::sun::star::uno::Exception;
80using ::com::sun::star::drawing::XShape;
81using ::com::sun::star::drawing::XDrawPage;
82using ::com::sun::star::beans::XPropertySet;
87 : mxBuilder(
Application::CreateBuilder(pParent,
"modules/simpress/ui/customanimationfragment.ui",
88 false, reinterpret_cast<sal_uInt64>(
SfxViewShell::Current())))
89 ,
mxContainer(mxBuilder->weld_container(
"EffectFragment"))
107 virtual void setValue(
const Any& rValue,
const OUString& rPresetId )
override;
110 std::vector<OUString> maPropertyValues;
112 std::unique_ptr<weld::ComboBox> mxControl;
120 : SdPropertySubControl(pParent)
121 , maModifyLink(rModifyHdl)
122 , mxControl(mxBuilder->weld_combo_box(
"combo"))
124 mxControl->connect_changed(
LINK(
this, SdPresetPropertyBox, OnSelect));
133 maModifyLink.Call(
nullptr);
136void SdPresetPropertyBox::setValue(
const Any& rValue,
const OUString& rPresetId )
143 maPropertyValues.clear();
151 OUString aPropertyValue;
152 rValue >>= aPropertyValue;
154 std::vector<OUString> aSubTypes( pDescriptor->getSubTypes() );
156 mxControl->set_sensitive(!aSubTypes.empty());
158 for(
const auto& aSubType : aSubTypes )
160 mxControl->append_text(rPresets.getUINameForProperty(aSubType));
161 maPropertyValues.push_back(aSubType);
162 if (aSubType == aPropertyValue)
163 nPos = maPropertyValues.size() - 1;
168 mxControl->set_sensitive(
false);
172 mxControl->set_active(nPos);
175Any SdPresetPropertyBox::getValue()
177 const int nIndex = mxControl->get_active();
180 return Any(maPropertyValues[nIndex]);
185class SdColorPropertyBox :
public SdPropertySubControl
191 virtual void setValue(
const Any& rValue,
const OUString& rPresetId )
override;
195 std::unique_ptr<ColorListBox> mxControl;
203 : SdPropertySubControl(pParent)
204 , maModifyLink(rModifyHdl)
205 , mxControl(new
ColorListBox(mxBuilder->weld_menu_button(
"color"), [pTopLevel]{
return pTopLevel; }))
207 mxControl->SetSelectHdl(
LINK(
this, SdColorPropertyBox, OnSelect));
214 mxControl->SelectEntry(nColor);
219 maModifyLink.Call(
nullptr);
222void SdColorPropertyBox::setValue(
const Any& rValue,
const OUString& )
229 mxControl->SetNoSelection();
230 mxControl->SelectEntry(nColor);
234Any SdColorPropertyBox::getValue()
236 return Any(sal_Int32(mxControl->GetSelectEntryColor().GetRGBColor()));
241class SdFontPropertyBox :
public SdPropertySubControl
247 virtual void setValue(
const Any& rValue,
const OUString& rPresetId)
override;
251 std::unique_ptr<weld::ComboBox> mxControl;
259 : SdPropertySubControl(pParent)
261 , mxControl(mxBuilder->weld_combo_box(
"fontname"))
263 mxControl->connect_changed(
LINK(
this, SdFontPropertyBox, ControlSelectHdl));
268 const FontList* pFontList =
nullptr;
269 bool bMustDelete =
false;
273 auto pItem = pDocSh->GetItem( SID_ATTR_CHAR_FONTLIST );
287 for (sal_uInt16 i = 0;
i < nFontCount; ++
i)
306void SdFontPropertyBox::setValue(
const Any& rValue,
const OUString& )
311 rValue >>= aFontName;
312 mxControl->set_entry_text(aFontName);
316Any SdFontPropertyBox::getValue()
318 OUString aFontName(mxControl->get_active_text());
319 return Any(aFontName);
324class SdCharHeightPropertyBox :
public SdPropertySubControl
330 virtual void setValue(
const Any& rValue,
const OUString& )
override;
332 DECL_LINK(implMenuSelectHdl,
const OUString& rIdent,
void);
336 std::unique_ptr<weld::MetricSpinButton> mxMetric;
337 std::unique_ptr<weld::MenuButton> mxControl;
345 : SdPropertySubControl(pParent)
347 , mxMetric(mxBuilder->weld_metric_spin_button(
"fontsize",
FieldUnit::
PERCENT))
348 , mxControl(mxBuilder->weld_menu_button(
"fontsizemenu"))
350 mxMetric->connect_value_changed(
LINK(
this, SdCharHeightPropertyBox, EditModifyHdl));
355 mxControl->connect_selected(
LINK(
this, SdCharHeightPropertyBox, implMenuSelectHdl));
367IMPL_LINK(SdCharHeightPropertyBox, implMenuSelectHdl,
const OUString&, rIdent,
void)
369 sal_Int32
nValue = rIdent.toInt32();
370 mxMetric->set_value(
nValue, FieldUnit::PERCENT);
371 EditModifyHdl(*mxMetric);
374void SdCharHeightPropertyBox::setValue(
const Any& rValue,
const OUString& )
380 mxMetric->set_value(
static_cast<::
tools::Long>(fValue * 100.0), FieldUnit::PERCENT);
384Any SdCharHeightPropertyBox::getValue()
386 return Any(
static_cast<double>(mxMetric->get_value(FieldUnit::PERCENT)) / 100.0);
391class SdTransparencyPropertyBox :
public SdPropertySubControl
397 virtual void setValue(
const Any& rValue,
const OUString& rPresetId )
override;
399 DECL_LINK(implMenuSelectHdl,
const OUString&,
void);
407 std::unique_ptr<weld::MetricSpinButton> mxMetric;
408 std::unique_ptr<weld::MenuButton> mxControl;
414 : SdPropertySubControl(pParent)
416 , mxMetric(mxBuilder->weld_metric_spin_button(
"transparent",
FieldUnit::
PERCENT))
417 , mxControl(mxBuilder->weld_menu_button(
"transparentmenu"))
419 for (sal_Int32 i = 25;
i < 101;
i += 25)
423 mxControl->append_item_check(OUString::number(i), aStr);
426 mxControl->connect_selected(
LINK(
this, SdTransparencyPropertyBox, implMenuSelectHdl));
430 mxMetric->connect_value_changed(
LINK(
this, SdTransparencyPropertyBox, implModifyHdl));
438void SdTransparencyPropertyBox::updateMenu()
440 sal_Int64
nValue = mxMetric->get_value(FieldUnit::PERCENT);
441 for (sal_uInt16 i = 25;
i < 101;
i += 25)
442 mxControl->set_item_active(OUString::number(i), nValue == i);
451IMPL_LINK(SdTransparencyPropertyBox, implMenuSelectHdl,
const OUString&, rIdent,
void)
453 auto nValue = rIdent.toInt32();
454 if (
nValue != mxMetric->get_value(FieldUnit::PERCENT))
456 mxMetric->set_value(
nValue, FieldUnit::PERCENT);
457 implModifyHdl(*mxMetric);
461void SdTransparencyPropertyBox::setValue(
const Any& rValue,
const OUString&)
468 mxMetric->set_value(nValue, FieldUnit::PERCENT);
473Any SdTransparencyPropertyBox::getValue()
475 return Any(
static_cast<double>(mxMetric->get_value(FieldUnit::PERCENT)) / 100.0);
480class SdRotationPropertyBox :
public SdPropertySubControl
486 virtual void setValue(
const Any& rValue,
const OUString& )
override;
488 DECL_LINK(implMenuSelectHdl,
const OUString&,
void);
496 std::unique_ptr<weld::MetricSpinButton> mxMetric;
497 std::unique_ptr<weld::MenuButton> mxControl;
503 : SdPropertySubControl(pParent)
505 , mxMetric(mxBuilder->weld_metric_spin_button(
"rotate",
FieldUnit::
DEGREE))
506 , mxControl(mxBuilder->weld_menu_button(
"rotatemenu"))
508 mxMetric->connect_value_changed(
LINK(
this, SdRotationPropertyBox, implModifyHdl));
513 mxControl->connect_selected(
LINK(
this, SdRotationPropertyBox, implMenuSelectHdl));
520void SdRotationPropertyBox::updateMenu()
522 sal_Int64
nValue = mxMetric->get_value(FieldUnit::DEGREE);
523 bool bDirection =
nValue >= 0;
526 mxControl->set_item_active(
"90", nValue == 90);
527 mxControl->set_item_active(
"180", nValue == 180);
528 mxControl->set_item_active(
"360", nValue == 360);
529 mxControl->set_item_active(
"720", nValue == 720);
531 mxControl->set_item_active(
"closewise", bDirection);
532 mxControl->set_item_active(
"counterclock", !bDirection);
541IMPL_LINK(SdRotationPropertyBox, implMenuSelectHdl,
const OUString&, rIdent,
void)
543 auto nValue = mxMetric->get_value(FieldUnit::DEGREE);
544 bool bDirection =
nValue >= 0;
547 if (rIdent ==
"clockwise")
549 else if (rIdent ==
"counterclock")
552 nValue = rIdent.toInt32();
557 if (
nValue != mxMetric->get_value(FieldUnit::DEGREE))
559 mxMetric->set_value(
nValue, FieldUnit::DEGREE);
560 implModifyHdl(*mxMetric);
564void SdRotationPropertyBox::setValue(
const Any& rValue,
const OUString& )
571 mxMetric->set_value(nValue, FieldUnit::DEGREE);
576Any SdRotationPropertyBox::getValue()
578 return Any(
static_cast<double>(mxMetric->get_value(FieldUnit::DEGREE)));
583class SdScalePropertyBox :
public SdPropertySubControl
589 virtual void setValue(
const Any& rValue,
const OUString& )
override;
591 DECL_LINK(implMenuSelectHdl,
const OUString&,
void);
600 std::unique_ptr<weld::MetricSpinButton> mxMetric;
601 std::unique_ptr<weld::MenuButton> mxControl;
607 : SdPropertySubControl(pParent)
610 , mxControl(mxBuilder->weld_menu_button(
"scalemenu"))
612 mxControl->connect_selected(
LINK(
this, SdScalePropertyBox, implMenuSelectHdl));
616 mxMetric->connect_value_changed(
LINK(
this, SdScalePropertyBox, implModifyHdl));
624void SdScalePropertyBox::updateMenu()
626 auto nValue = mxMetric->get_value(FieldUnit::PERCENT);
628 mxControl->set_item_active(
"25scale", nValue == 25);
629 mxControl->set_item_active(
"50scale", nValue == 50);
630 mxControl->set_item_active(
"150scale", nValue == 150);
631 mxControl->set_item_active(
"400scale", nValue == 400);
633 mxControl->set_item_active(
"hori", mnDirection == 1);
634 mxControl->set_item_active(
"vert", mnDirection == 2);
635 mxControl->set_item_active(
"both", mnDirection == 3);
644IMPL_LINK(SdScalePropertyBox, implMenuSelectHdl,
const OUString&, rIdent,
void)
646 auto nValue = mxMetric->get_value(FieldUnit::PERCENT);
648 int nDirection = mnDirection;
650 if (rIdent ==
"hori")
652 else if (rIdent ==
"vert")
654 else if (rIdent ==
"both")
657 nValue = rIdent.toInt32();
659 bool bModified =
false;
661 if( nDirection != mnDirection )
663 mnDirection = nDirection;
667 if (
nValue != mxMetric->get_value(FieldUnit::PERCENT))
669 mxMetric->set_value(
nValue, FieldUnit::PERCENT);
675 implModifyHdl(*mxMetric);
680void SdScalePropertyBox::setValue(
const Any& rValue,
const OUString&)
688 double fValue1 = 0.0;
689 double fValue2 = 0.0;
691 aValues.First >>= fValue1;
692 aValues.Second >>= fValue2;
697 if( (fValue1 == 0.0) && (fValue2 == 0.0) )
699 else if( (fValue1 != 0.0) && (fValue2 == 0.0) )
701 else if( (fValue1 == 0.0) && (fValue2 != 0.0) )
718 if( mnDirection == 1 )
720 else if( mnDirection == 2 )
722 else if( mnDirection == 3 ){
723 if (fValue1 >= fValue2)
731 mxMetric->set_value(nValue, FieldUnit::PERCENT);
735Any SdScalePropertyBox::getValue()
737 double fValue1 =
static_cast<double>(mxMetric->get_value(FieldUnit::PERCENT)) / 100.0;
747 double fValue2 = fValue1;
751 if( mnDirection == 1 )
753 else if( mnDirection == 2 )
757 aValues.First <<= fValue1;
758 aValues.Second <<= fValue2;
760 return Any( aValues );
765class SdFontStylePropertyBox :
public SdPropertySubControl
771 virtual void setValue(
const Any& rValue,
const OUString& )
override;
773 DECL_LINK(implMenuSelectHdl,
const OUString&,
void);
779 awt::FontSlant meFontSlant;
780 sal_Int16 mnFontUnderline;
783 std::unique_ptr<weld::Entry> mxEdit;
784 std::unique_ptr<weld::MenuButton> mxControl;
790 : SdPropertySubControl(pParent)
792 , mxEdit(mxBuilder->weld_entry(
"entry"))
793 , mxControl(mxBuilder->weld_menu_button(
"entrymenu"))
795 mxEdit->set_text(
SdResId(STR_CUSTOMANIMATION_SAMPLE));
800 mxControl->connect_selected(
LINK(
this, SdFontStylePropertyBox, implMenuSelectHdl));
807void SdFontStylePropertyBox::update()
810 mxControl->set_item_active(
"bold", mfFontWeight == awt::FontWeight::BOLD);
811 mxControl->set_item_active(
"italic", meFontSlant == awt::FontSlant_ITALIC);
812 mxControl->set_item_active(
"underline", mnFontUnderline != awt::FontUnderline::NONE );
816 aFont.SetWeight(mfFontWeight == awt::FontWeight::BOLD ? WEIGHT_BOLD : WEIGHT_NORMAL);
817 aFont.SetItalic(meFontSlant == awt::FontSlant_ITALIC ? ITALIC_NORMAL : ITALIC_NONE);
818 aFont.SetUnderline(mnFontUnderline == awt::FontUnderline::NONE ? LINESTYLE_NONE : LINESTYLE_SINGLE);
819 mxEdit->set_font(aFont);
822IMPL_LINK(SdFontStylePropertyBox, implMenuSelectHdl,
const OUString&, rIdent,
void)
824 if (rIdent ==
"bold")
826 if( mfFontWeight == awt::FontWeight::BOLD )
829 mfFontWeight = awt::FontWeight::BOLD;
831 else if (rIdent ==
"italic")
833 if( meFontSlant == awt::FontSlant_ITALIC )
834 meFontSlant = awt::FontSlant_NONE;
836 meFontSlant = awt::FontSlant_ITALIC;
838 else if (rIdent ==
"underline")
840 if( mnFontUnderline == awt::FontUnderline::SINGLE )
841 mnFontUnderline = awt::FontUnderline::NONE;
843 mnFontUnderline = awt::FontUnderline::SINGLE;
850void SdFontStylePropertyBox::setValue(
const Any& rValue,
const OUString& )
852 Sequence<Any> aValues;
855 aValues[0] >>= mfFontWeight;
856 aValues[1] >>= meFontSlant;
857 aValues[2] >>= mnFontUnderline;
862Any SdFontStylePropertyBox::getValue()
864 Sequence<Any> aValues{
Any(mfFontWeight),
Any(meFontSlant),
Any(mnFontUnderline) };
865 return Any( aValues );
879 void updateControlStates();
880 void fillSoundListBox();
881 void clearSoundListBox();
882 sal_Int32 getSoundObject( std::u16string_view rStr );
883 void openSoundFileDialog();
884 void onSoundPreview();
918 , mxBuilder(
Application::CreateBuilder(pParent,
"modules/simpress/ui/customanimationeffecttab.ui"))
919 ,
mxContainer(mxBuilder->weld_container(
"EffectTab"))
920 , mxSettings(mxBuilder->weld_widget(
"settings"))
921 , mxFTProperty1(mxBuilder->weld_label(
"prop_label1"))
922 , mxPlaceholderBox(mxBuilder->weld_container(
"placeholder"))
923 , mxCBSmoothStart(mxBuilder->weld_check_button(
"smooth_start"))
924 , mxCBSmoothEnd(mxBuilder->weld_check_button(
"smooth_end"))
925 , mxFTSound(mxBuilder->weld_label(
"sound_label"))
926 , mxLBSound(mxBuilder->weld_combo_box(
"sound_list"))
927 , mxPBSoundPreview(mxBuilder->weld_button(
"sound_preview"))
928 , mxLBAfterEffect(mxBuilder->weld_combo_box(
"aeffect_list"))
929 , mxFTDimColor(mxBuilder->weld_label(
"dim_color_label"))
930 , mxCLBDimColor(new
ColorListBox(mxBuilder->weld_menu_button(
"dim_color_list"), [pDialog]{
return pDialog; }))
931 , mxFTTextAnim(mxBuilder->weld_label(
"text_animation_label"))
932 , mxLBTextAnim(mxBuilder->weld_combo_box(
"text_animation_list"))
933 , mxMFTextDelay(mxBuilder->weld_metric_spin_button(
"text_delay", FieldUnit::PERCENT))
934 , mxFTTextDelay(mxBuilder->weld_label(
"text_delay_label"))
936 mxCLBDimColor->SelectEntry(COL_BLACK);
962 if( !aPropertyName.isEmpty() )
965 mxFTProperty1->set_label(aPropertyName);
976 mxFTProperty1->set_sensitive(mxPlaceholderBox->get_sensitive());
982 mxCBSmoothStart->show();
983 mxCBSmoothEnd->show();
987 mxCBSmoothStart->set_active( fTemp > 0.0 );
990 mxCBSmoothEnd->set_active( fTemp > 0.0 );
996 mxLBAfterEffect->connect_changed(
LINK(
this, CustomAnimationEffectTabPage, implSelectHdl));
997 mxLBTextAnim->connect_changed(
LINK(
this, CustomAnimationEffectTabPage, implSelectHdl));
1003 bool bHasAfterEffect =
false;
1007 if( bHasAfterEffect )
1011 bool bAfterEffectOnNextClick =
false;
1015 if( aDimColor.hasValue() )
1018 aDimColor >>= aColor;
1019 mxCLBDimColor->SelectEntry(aColor);
1024 if( bAfterEffectOnNextClick )
1029 mxLBAfterEffect->set_active(nPos);
1041 sal_Int32 nIterateType = 0;
1043 switch( nIterateType )
1045 case TextAnimationType::BY_PARAGRAPH:
nPos = 0;
break;
1046 case TextAnimationType::BY_WORD:
nPos = 1;
break;
1047 case TextAnimationType::BY_LETTER:
nPos = 2;
break;
1050 mxLBTextAnim->set_active(nPos);
1055 double fIterateInterval = 0.0;
1057 mxMFTextDelay->set_value(
static_cast<::
tools::Long>(fIterateInterval*10), FieldUnit::NONE);
1062 mxFTTextAnim->set_sensitive(
false);
1063 mxLBTextAnim->set_sensitive(
false);
1064 mxMFTextDelay->set_sensitive(
false);
1065 mxFTTextDelay->set_sensitive(
false);
1082 aValue >>= aSoundURL;
1084 if( !aSoundURL.isEmpty() )
1087 for( i = 0;
i < maSoundList.size();
i++ )
1089 OUString aString = maSoundList[
i ];
1090 if( aString == aSoundURL )
1092 nPos =
static_cast<sal_Int32
>(
i)+2;
1099 nPos =
static_cast<sal_Int32
>(maSoundList.size())+2;
1100 maSoundList.push_back( aSoundURL );
1102 mxLBSound->insert_text(nPos,
aURL.GetBase());
1108 mxLBSound->set_active(nPos);
1111 updateControlStates();
1184 if( aOldValue != aNewValue )
1194 double fOldTemp = 0.0;
1200 if( fOldTemp != fTemp )
1211 if( fOldTemp != fTemp )
1218 bool bAfterEffect =
nPos != 0;
1220 bool bOldAfterEffect =
false;
1225 bOldAfterEffect = !bAfterEffect;
1227 if( bOldAfterEffect != bAfterEffect )
1241 bool bAfterEffectOnNextEffect =
nPos != 2;
1242 bool bOldAfterEffectOnNextEffect = !bAfterEffectOnNextEffect;
1247 if( bAfterEffectOnNextEffect != bOldAfterEffectOnNextEffect )
1254 sal_Int16 nIterateType;
1258 case 1: nIterateType = TextAnimationType::BY_WORD;
break;
1259 case 2: nIterateType = TextAnimationType::BY_LETTER;
break;
1261 nIterateType = TextAnimationType::BY_PARAGRAPH;
1264 sal_Int16 nOldIterateType = nIterateType-1;
1269 if( nIterateType != nOldIterateType )
1274 double fIterateInterval =
static_cast<double>(
mxMFTextDelay->get_value(FieldUnit::NONE)) / 10;
1275 double fOldIterateInterval = -1.0;
1280 if( fIterateInterval != fOldIterateInterval )
1288 Any aNewSoundURL, aOldSoundURL(
Any( sal_Int32(0) ) );
1294 else if(
nPos == 1 )
1297 aNewSoundURL <<=
true;
1302 aNewSoundURL <<= aSoundURL;
1308 if( aNewSoundURL != aOldSoundURL )
1318 mxLBSound->append_text(
SdResId(STR_CUSTOMANIMATION_STOP_PREVIOUS_SOUND) );
1350 bool bValidSoundFile =
false;
1351 bool bQuitLoop =
false;
1356 OUString aFile = aFileDialog.
GetPath();
1368 DBG_ASSERT(
nPos >= 0,
"sd::CustomAnimationEffectTabPage::openSoundFileDialog(), Recently inserted sound not in list!" );
1370 bValidSoundFile=
true;
1375 OUString aStrWarning(
SdResId(STR_WARNING_NOSOUNDFILE));
1376 aStrWarning = aStrWarning.replaceFirst(
"%", aFile);
1378 VclMessageType::Warning, VclButtonsType::NONE,
1384 bValidSoundFile=
false;
1389 bValidSoundFile=
true;
1394 if( !bValidSoundFile )
1402#if HAVE_FEATURE_AVMEDIA
1411 catch( uno::Exception& )
1447 , mxBuilder(
Application::CreateBuilder(pParent,
"modules/simpress/ui/customanimationtimingtab.ui"))
1448 ,
mxContainer(mxBuilder->weld_container(
"TimingTab"))
1449 , mxLBStart(mxBuilder->weld_combo_box(
"start_list"))
1450 , mxMFStartDelay(mxBuilder->weld_metric_spin_button(
"delay_value",
FieldUnit::
SECOND))
1451 , mxFTDuration(mxBuilder->weld_label(
"duration_label"))
1452 , mxCBXDuration(mxBuilder->weld_metric_spin_button(
"anim_duration",
FieldUnit::
SECOND))
1453 , mxFTRepeat(mxBuilder->weld_label(
"repeat_label"))
1454 , mxCBRepeat(mxBuilder->weld_combo_box(
"repeat_list"))
1455 , mxCBXRewind(mxBuilder->weld_check_button(
"rewind"))
1456 , mxRBClickSequence(mxBuilder->weld_radio_button(
"rb_click_sequence"))
1457 , mxRBInteractive(mxBuilder->weld_radio_button(
"rb_interactive"))
1458 , mxLBTrigger(mxBuilder->weld_combo_box(
"trigger_list"))
1469 sal_Int16 nStart = 0;
1474 case EffectNodeType::WITH_PREVIOUS:
nPos = 1;
break;
1475 case EffectNodeType::AFTER_PREVIOUS:
nPos = 2;
break;
1482 double fBegin = 0.0;
1489 double fDuration = 0.0;
1492 if( fDuration == 0.001 )
1502 mxCBXDuration->set_value(fDuration * 100.0, FieldUnit::NONE);
1511 double fRepeat = 0.0;
1512 if( aRepeatCount.hasValue() )
1513 aRepeatCount >>= fRepeat;
1519 else if( fRepeat == 2.0 )
1521 else if( fRepeat == 3.0 )
1523 else if( fRepeat == 4.0 )
1525 else if( fRepeat == 5.0 )
1527 else if( fRepeat == 10.0 )
1533 mxCBRepeat->set_entry_text(OUString::number(fRepeat));
1541 mxCBRepeat->set_active(aEnd.hasValue() ? 6 : 7);
1547 sal_Int16 nFill = 0;
1550 mxCBXRewind->set_active(nFill == AnimationFill::REMOVE);
1558 Reference< XShape > xTrigger;
1568 Reference< XDrawPage > xCurrentPage;
1570 if( !xCurrentPage.is() )
1573 static constexpr OUStringLiteral aStrIsEmptyPresObj(
u"IsEmptyPresentationObject" );
1575 sal_Int32 nShape,
nCount = xCurrentPage->getCount();
1576 for( nShape = 0; nShape <
nCount; nShape++ )
1578 Reference< XShape > xShape( xCurrentPage->getByIndex( nShape ), UNO_QUERY );
1583 Reference< XPropertySet > xSet( xShape, UNO_QUERY );
1584 if( xSet.is() && xSet->getPropertySetInfo()->hasPropertyByName( aStrIsEmptyPresObj ) )
1586 bool bIsEmpty =
false;
1587 xSet->getPropertyValue( aStrIsEmptyPresObj ) >>= bIsEmpty;
1593 mxLBTrigger->append(OUString::number(nShape), aDescription);
1595 if (xShape == xTrigger)
1602 mxRBInteractive->set_active(
true);
1603 assert(!mxRBClickSequence->get_active());
1608 if (!mxCBXDuration->get_text().isEmpty())
1610 double duration_value =
static_cast<double>(mxCBXDuration->get_value(FieldUnit::NONE));
1611 if(duration_value <= 0.0)
1612 mxCBXDuration->set_value(1, FieldUnit::NONE);
1614 mxCBXDuration->set_value(duration_value, FieldUnit::NONE);
1624 sal_Int16 nOldStart = -1;
1628 case 1: nStart = EffectNodeType::WITH_PREVIOUS;
break;
1629 case 2: nStart = EffectNodeType::AFTER_PREVIOUS;
break;
1631 nStart = EffectNodeType::ON_CLICK;
break;
1637 if( nStart != nOldStart )
1642 double fBegin =
static_cast<double>(
mxMFStartDelay->get_value(FieldUnit::NONE)) / 10.0;
1643 double fOldBegin = -1.0;
1648 if( fBegin != fOldBegin )
1666 aEvent.Trigger = EventTrigger::ON_NEXT;
1672 aRepeatCount <<= Timing_INDEFINITE;
1677 if( !aText.isEmpty() )
1678 aRepeatCount <<= aText.toDouble();
1682 Any aOldRepeatCount( aRepeatCount );
1686 if( aRepeatCount != aOldRepeatCount )
1689 Any aOldEnd( aEnd );
1693 if( aEnd != aOldEnd )
1697 double fDuration = -1.0;
1701 double duration_value =
static_cast<double>(
mxCBXDuration->get_value(FieldUnit::NONE));
1703 if(duration_value > 0)
1704 fDuration = duration_value/100.0;
1707 if( fDuration != -1.0 )
1709 double fOldDuration = -1;
1714 if( fDuration != fOldDuration )
1720 sal_Int16 nFill =
mxCBXRewind->get_active() ? AnimationFill::REMOVE : AnimationFill::HOLD;
1726 sal_Int16 nOldFill = 0;
1728 bSet = nFill != nOldFill;
1735 Reference< XShape > xTrigger;
1744 Reference< XDrawPage > xCurrentPage;
1747 if( xCurrentPage.is() && (nShape >= 0) && (nShape < xCurrentPage->getCount()) )
1748 xCurrentPage->getByIndex( nShape ) >>= xTrigger;
1754 Any aNewValue( xTrigger );
1760 if( aNewValue != aOldValue )
1790 , mbHasVisibleShapes(true)
1791 , mxBuilder(
Application::CreateBuilder(pParent,
"modules/simpress/ui/customanimationtexttab.ui"))
1792 ,
mxContainer(mxBuilder->weld_container(
"TextAnimationTab"))
1793 , mxLBGroupText(mxBuilder->weld_combo_box(
"group_text_list"))
1794 , mxCBXGroupAuto(mxBuilder->weld_check_button(
"auto_after"))
1795 , mxMFGroupAuto(mxBuilder->weld_metric_spin_button(
"auto_after_value",
FieldUnit::
SECOND))
1796 , mxCBXAnimateForm(mxBuilder->weld_check_button(
"animate_shape"))
1797 , mxCBXReverse(mxBuilder->weld_check_button(
"reverse_order"))
1803 sal_Int32 nTextGrouping = 0;
1813 double fTextGroupingAuto = 0.0;
1817 if( fTextGroupingAuto >= 0.0 )
1829 bool bAnimateForm =
false;
1843 bool bTextReverse =
false;
1852 sal_Int32 nMaxParaDepth = 0;
1857 while( (
nPos > 2) && (
nPos > nMaxParaDepth) )
1872 sal_Int32 nTextGrouping =
nPos - 1;
1873 sal_Int32 nOldGrouping = -2;
1878 if( nTextGrouping != nOldGrouping )
1885 bool bOldTextReverse = !bTextReverse;
1890 if( bTextReverse != bOldTextReverse )
1896 double fOldTextGroupingAuto = -2.0;
1901 if( fTextGroupingAuto != fOldTextGroupingAuto )
1911 bool bOldAnimateForm = !bAnimateForm;
1916 if( bAnimateForm != bOldAnimateForm )
1942 updateControlStates();
1946 : GenericDialogController(pParent,
"modules/simpress/ui/customanimationproperties.ui",
"CustomAnimationProperties")
1947 , mxSet(
std::move(pSet))
1948 , mxTabControl(m_xBuilder->weld_notebook(
"tabcontrol"))
1952 bool bHasText =
false;
1965 if (!rPage.isEmpty())
1998 pSet->setPropertyDefaultValue(
nHandleStart,
Any( sal_Int16(EffectNodeType::ON_CLICK) ) );
2002 pSet->setPropertyDefaultValue(
nHandleRewind,
Any( AnimationFill::HOLD ) );
2004 pSet->setPropertyDefaultValue(
nHandleEnd, aEmpty );
2035 std::unique_ptr<SdPropertySubControl> pSubControl;
2041 pSubControl.reset(
new SdPresetPropertyBox( pLabel, pParent, rValue, rPresetId, rModifyHdl ) );
2049 pSubControl.reset(
new SdColorPropertyBox( pLabel, pParent, pTopLevel, rValue, rModifyHdl ) );
2053 pSubControl.reset(
new SdFontPropertyBox( pLabel, pParent, rValue, rModifyHdl ) );
2057 pSubControl.reset(
new SdCharHeightPropertyBox( pLabel, pParent, rValue, rModifyHdl ) );
2061 pSubControl.reset(
new SdRotationPropertyBox( pLabel, pParent, rValue, rModifyHdl ) );
2065 pSubControl.reset(
new SdTransparencyPropertyBox( pLabel, pParent, rValue, rModifyHdl ) );
2069 pSubControl.reset(
new SdScalePropertyBox( pLabel, pParent, rValue, rModifyHdl ) );
2073 pSubControl.reset(
new SdFontStylePropertyBox( pLabel, pParent, rValue, rModifyHdl ) );
Reference< XExecutableDialog > m_xDialog
static OutputDevice * GetDefaultDevice()
static const AllSettings & GetSettings()
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
Color GetRGBColor() const
size_t GetFontNameCount() const
const FontMetric & GetFontName(size_t nFont) const
static bool FillObjList(std::u16string_view rThemeName, std::vector< OUString > &rObjList)
static bool InsertURL(std::u16string_view rThemeName, std::u16string_view rURL)
The class SdOpenSoundFileDialog wraps the FileDialogHelper, displaying the FILEOPEN_PLAY dialog templ...
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
STLPropertySet * getResultSet()
std::unique_ptr< STLPropertySet > mxSet
std::unique_ptr< CustomAnimationEffectTabPage > mxEffectTabPage
std::unique_ptr< STLPropertySet > mxResultSet
std::unique_ptr< CustomAnimationTextAnimTabPage > mxTextAnimTabPage
CustomAnimationDialog(weld::Window *pParent, std::unique_ptr< STLPropertySet > pSet, const OUString &Page)
static std::unique_ptr< STLPropertySet > createDefaultSet()
std::unique_ptr< CustomAnimationDurationTabPage > mxDurationTabPage
virtual ~CustomAnimationDialog() override
std::unique_ptr< weld::Notebook > mxTabControl
std::unique_ptr< weld::Builder > mxBuilder
std::unique_ptr< weld::ComboBox > mxLBTrigger
const STLPropertySet * mpSet
std::unique_ptr< weld::RadioButton > mxRBClickSequence
std::unique_ptr< weld::RadioButton > mxRBInteractive
std::unique_ptr< weld::ComboBox > mxLBStart
std::unique_ptr< weld::Label > mxFTRepeat
DECL_LINK(implControlHdl, weld::ComboBox &, void)
CustomAnimationDurationTabPage(weld::Container *pParent, const STLPropertySet *pSet)
void update(STLPropertySet *pSet)
std::unique_ptr< weld::Container > mxContainer
std::unique_ptr< weld::CheckButton > mxCBXRewind
std::unique_ptr< weld::MetricSpinButton > mxMFStartDelay
DECL_LINK(DurationModifiedHdl, weld::MetricSpinButton &, void)
std::unique_ptr< weld::MetricSpinButton > mxCBXDuration
std::unique_ptr< weld::Label > mxFTDuration
std::unique_ptr< weld::ComboBox > mxCBRepeat
std::unique_ptr< ColorListBox > mxCLBDimColor
std::unique_ptr< weld::Container > mxContainer
void openSoundFileDialog()
DECL_LINK(implSelectHdl, weld::ComboBox &, void)
std::unique_ptr< weld::CheckButton > mxCBSmoothEnd
void updateControlStates()
std::unique_ptr< weld::ComboBox > mxLBTextAnim
std::unique_ptr< weld::Label > mxFTDimColor
std::unique_ptr< SdPropertySubControl > mxLBSubControl
std::unique_ptr< weld::Widget > mxSettings
const STLPropertySet * mpSet
::std::vector< OUString > maSoundList
std::unique_ptr< weld::MetricSpinButton > mxMFTextDelay
std::unique_ptr< weld::Button > mxPBSoundPreview
std::unique_ptr< weld::CheckButton > mxCBSmoothStart
void implHdl(const weld::Widget *)
void update(STLPropertySet *pSet)
sal_Int32 getSoundObject(std::u16string_view rStr)
std::unique_ptr< weld::Label > mxFTTextAnim
std::unique_ptr< weld::Container > mxPlaceholderBox
std::unique_ptr< weld::ComboBox > mxLBSound
std::unique_ptr< weld::Label > mxFTSound
std::unique_ptr< weld::Label > mxFTTextDelay
css::uno::Reference< css::media::XPlayer > mxPlayer
std::unique_ptr< weld::Label > mxFTProperty1
weld::Window * GetFrameWeld() const
std::unique_ptr< weld::ComboBox > mxLBAfterEffect
DECL_LINK(implClickHdl, weld::Button &, void)
std::unique_ptr< weld::Builder > mxBuilder
static const CustomAnimationPresets & getCustomAnimationPresets()
This method gets presets instance, which is localized for the current user's locale.
std::unique_ptr< weld::Container > mxContainer
DECL_LINK(implSelectHdl, weld::ComboBox &, void)
std::unique_ptr< weld::CheckButton > mxCBXAnimateForm
void updateControlStates()
std::unique_ptr< weld::CheckButton > mxCBXReverse
CustomAnimationTextAnimTabPage(weld::Container *pParent, const STLPropertySet *pSet)
std::unique_ptr< weld::MetricSpinButton > mxMFGroupAuto
std::unique_ptr< weld::ComboBox > mxLBGroupText
void update(STLPropertySet *pSet)
const STLPropertySet * mpSet
std::unique_ptr< weld::Builder > mxBuilder
std::unique_ptr< weld::CheckButton > mxCBXGroupAuto
STLPropertyState getPropertyState(sal_Int32 nHandle) const
void setPropertyValue(sal_Int32 nHandle, const css::uno::Any &rValue)
css::uno::Any getPropertyValue(sal_Int32 nHandle) const
SdPropertySubControl(weld::Container *pParent)
static std::unique_ptr< SdPropertySubControl > create(sal_Int32 nType, weld::Label *pLabel, weld::Container *pParent, weld::Window *pTopLevel, const css::uno::Any &rValue, const OUString &rPresetId, const Link< LinkParamNone *, void > &rModifyHdl)
std::unique_ptr< weld::Container > mxContainer
virtual void setValue(const css::uno::Any &rValue, const OUString &rPresetId)=0
weld::Container * mpParent
virtual ~SdPropertySubControl()
static OUString formatPercent(double dNumber, const LanguageTag &rLangTag)
const OUString & GetFamilyName() const
virtual void move(weld::Widget *pWidget, weld::Container *pNewParent)=0
virtual void set_mnemonic_widget(Widget *pTarget)=0
Link< ColorFieldControl &, void > maModifyHdl
#define DBG_ASSERT(sCon, aError)
#define TOOLS_WARN_EXCEPTION(area, stream)
DECL_LINK(CheckNameHdl, SvxNameDialog &, bool)
RegionData_Impl * mpParent
#define GALLERY_THEME_USERSOUNDS
#define GALLERY_THEME_SOUNDS
constexpr OUStringLiteral HID_SD_CUSTOMANIMATIONPANE_SCALEPROPERTYBOX
constexpr OUStringLiteral HID_SD_CUSTOMANIMATIONPANE_FONTSTYLEPROPERTYBOX
constexpr OUStringLiteral HID_SD_CUSTOMANIMATIONPANE_FONTPROPERTYBOX
constexpr OUStringLiteral HID_SD_CUSTOMANIMATIONPANE_TRANSPARENCYPROPERTYBOX
constexpr OUStringLiteral HID_SD_CUSTOMANIMATIONPANE_ROTATIONPROPERTYBOX
constexpr OUStringLiteral HID_SD_CUSTOMANIMATIONPANE_PRESETPROPERTYBOX
constexpr OUStringLiteral HID_SD_CUSTOMANIMATIONPANE_COLORPROPERTYBOX
constexpr OUStringLiteral HID_SD_CUSTOMANIMATIONPANE_CHARHEIGHTPROPERTYBOX
#define LINK(Instance, Class, Member)
css::beans::Optional< css::uno::Any > getValue(std::u16string_view id)
bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2)
const sal_Int32 nHandleEnd
IMPL_LINK(CustomAnimationEffectTabPage, implSelectHdl, weld::ComboBox &, rListBox, void)
const sal_Int32 nPropertyTypeFillColor
const sal_Int32 nHandleTrigger
const sal_Int32 nPropertyTypeDirection
const sal_Int32 nHandleProperty1Type
IMPL_LINK_NOARG(MainSequence, onTimerHdl, Timer *, void)
const sal_Int32 nHandleIterateType
const sal_Int32 nHandleRepeat
const sal_Int32 nPropertyTypeZoom
const sal_Int32 nPropertyTypeScale
void fillRepeatComboBox(weld::ComboBox &rBox)
const sal_Int32 nPropertyTypeFont
const sal_Int32 nHandleCurrentPage
const sal_Int32 nPropertyTypeSpokes
const sal_Int32 nHandleProperty2Value
const sal_Int32 nHandleBegin
const sal_Int32 nHandleDimColor
const sal_Int32 nPropertyTypeLineColor
std::shared_ptr< CustomAnimationPreset > CustomAnimationPresetPtr
const sal_Int32 nHandleAccelerate
const sal_Int32 nHandleSoundVolume
const sal_Int32 nPropertyTypeColor
const sal_Int32 nHandleAfterEffectOnNextEffect
const sal_Int32 nHandlePresetId
const sal_Int32 nHandleSoundURL
const sal_Int32 nHandleTextGroupingAuto
const sal_Int32 nHandleDecelerate
OUString getShapeDescription(const Reference< XShape > &xShape, bool bWithText)
IMPL_LINK_NOARG(CustomAnimationTextAnimTabPage, implSelectHdl, weld::ComboBox &, void)
const sal_Int32 nHandleTextGrouping
const sal_Int32 nPropertyTypeFirstColor
const sal_Int32 nHandleIterateInterval
const sal_Int32 nHandleStart
const sal_Int32 nHandleHasVisibleShape
OUString getPropertyName(sal_Int32 nPropertyType)
IMPL_LINK(SdCharHeightPropertyBox, implMenuSelectHdl, const OUString &, rIdent, void)
const sal_Int32 nPropertyTypeCharDecoration
const sal_Int32 nHandleHasText
const sal_Int32 nPropertyTypeCharHeight
const sal_Int32 nHandleAutoReverse
const sal_Int32 nHandleRewind
const sal_Int32 nHandleMaxParaDepth
const sal_Int32 nHandleProperty1Value
const sal_Int32 nPropertyTypeRotate
const sal_Int32 nHandleDuration
const sal_Int32 nHandleSoundEndAfterSlide
const sal_Int32 nHandleTextReverse
const sal_Int32 nPropertyTypeCharColor
const sal_Int32 nHandleProperty2Type
const sal_Int32 nHandleAnimateForm
const sal_Int32 nHandleCommand
const sal_Int32 nPropertyTypeNone
const sal_Int32 nHandleHasAfterEffect
const sal_Int32 nPropertyTypeTransparency
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
RegError REGISTRY_CALLTYPE setValue(RegKeyHandle hKey, rtl_uString *keyName, RegValueType valueType, RegValue pData, sal_uInt32 valueSize)
OUString SdResId(TranslateId aId)
OUString VCL_DLLPUBLIC GetStandardText(StandardButtonType eButton)
constexpr OUStringLiteral PERCENT(u"Percent")