1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include "SlideSorterViewShell.hxx"
23 #include <svtools/valueset.hxx>
24 #include <sfx2/sidebar/ILayoutableWindow.hxx>
25 #include <sfx2/sidebar/PanelLayout.hxx>
26 #include <vcl/weld.hxx>
32 class SdXImpressDocument
;
33 namespace com::sun::star::drawing
{ class XDrawView
; }
34 namespace com::sun::star::frame
{ class XModel
; }
35 namespace sd::tools
{ class EventMultiplexerEvent
; }
39 class TransitionPreset
;
44 struct TransitionEffect
;
47 struct TransitionEntry
52 std::vector
<OUString
> mnVariants
;
53 std::shared_ptr
<TransitionPreset
> mpPreset
;
56 class SlideTransitionPane final
: public PanelLayout
57 , public sfx2::sidebar::ILayoutableWindow
60 explicit SlideTransitionPane(
61 weld::Widget
* pParent
,
62 ViewShellBase
& rBase
);
63 virtual ~SlideTransitionPane() override
;
66 virtual css::ui::LayoutSize
GetHeightForWidth (const sal_Int32 nWidth
) override
;
68 void onSelectionChanged();
69 void onChangeCurrentPage();
72 void updateControls();
73 void updateControlState();
74 void updateVariants(std::shared_ptr
<TransitionPreset
> const& pPreset
);
76 void updateSoundList();
77 void openSoundFileDialog();
79 impl::TransitionEffect
getTransitionEffectFromControls() const;
81 void applyToSelectedPages(bool bPreview
);
82 void playCurrentEffect();
85 void removeListener();
87 ::sd::slidesorter::SharedPageSelection
getSelectedPages() const;
89 void Initialize(SdDrawDocument
* pDoc
);
91 DECL_LINK( ApplyToAllButtonClicked
, weld::Button
&, void );
92 DECL_LINK( PlayButtonClicked
, weld::Button
&, void );
93 DECL_LINK( AutoPreviewClicked
, weld::Toggleable
&, void );
95 DECL_LINK( TransitionSelected
, weld::IconView
&, bool );
96 DECL_LINK( AdvanceSlideRadioButtonToggled
, weld::Toggleable
&, void );
97 DECL_LINK( RepeatAfterRadioButtonToggled
, weld::Toggleable
&, void );
98 DECL_LINK( AdvanceTimeModified
, weld::MetricSpinButton
&, void );
99 DECL_LINK( RepeatAfterTimeModified
, weld::MetricSpinButton
&, void );
100 DECL_LINK( VariantListBoxSelected
, weld::ComboBox
&, void );
101 DECL_LINK( DurationModifiedHdl
, weld::MetricSpinButton
&, void );
102 DECL_LINK( DurationLoseFocusHdl
, weld::Widget
&, void );
103 DECL_LINK( SoundListBoxSelected
, weld::ComboBox
&, void );
104 DECL_LINK( LoopSoundBoxChecked
, weld::Toggleable
&, void );
105 DECL_LINK( EventMultiplexerListener
, tools::EventMultiplexerEvent
&, void );
106 DECL_LINK(LateInitCallback
, Timer
*, void);
108 ViewShellBase
& mrBase
;
109 SdDrawDocument
* mpDrawDoc
;
111 std::unique_ptr
<weld::IconView
> mxTransitionsIconView
;
112 std::unique_ptr
<weld::ScrolledWindow
> mxTransitionsScrollWindow
;
113 std::unique_ptr
<weld::Frame
> mxRepeatAutoFrame
;
114 std::unique_ptr
<weld::ComboBox
> mxLB_VARIANT
;
115 std::unique_ptr
<weld::MetricSpinButton
> mxCBX_duration
;
116 std::unique_ptr
<weld::Label
> mxFT_SOUND
;
117 std::unique_ptr
<weld::ComboBox
> mxLB_SOUND
;
118 std::unique_ptr
<weld::CheckButton
> mxCB_LOOP_SOUND
;
119 std::unique_ptr
<weld::RadioButton
> mxRB_ADVANCE_ON_MOUSE
;
120 std::unique_ptr
<weld::RadioButton
> mxRB_ADVANCE_AUTO
;
121 std::unique_ptr
<weld::MetricSpinButton
> mxMF_ADVANCE_AUTO_AFTER
;
122 std::unique_ptr
<weld::RadioButton
> mxRB_REPEAT_DISABLED
;
123 std::unique_ptr
<weld::RadioButton
> mxRB_REPEAT_AUTO
;
124 std::unique_ptr
<weld::MetricSpinButton
> mxMF_REPEAT_AUTO_AFTER
;
125 std::unique_ptr
<weld::Button
> mxPB_APPLY_TO_ALL
;
126 std::unique_ptr
<weld::Button
> mxPB_PLAY
;
127 std::unique_ptr
<weld::CheckButton
> mxCB_AUTO_PREVIEW
;
129 css::uno::Reference
< css::drawing::XDrawView
> mxView
;
130 rtl::Reference
< SdXImpressDocument
> mxModel
;
132 std::unordered_map
<OUString
, std::unique_ptr
<TransitionEntry
>> maTranstionMap
;
135 bool mbUpdatingControls
;
136 bool mbIsMainViewChangePending
;
138 std::vector
<OUString
> maSoundList
;
139 mutable OUString maCurrentSoundFile
;
141 Timer maLateInitTimer
;
146 // INCLUDED_SD_SOURCE_UI_ANIMATIONS_SLIDETRANSITIONPANE_HXX
148 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */