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 .
19 #ifndef INCLUDED_SD_SOURCE_UI_ANIMATIONS_SLIDETRANSITIONPANE_HXX
20 #define INCLUDED_SD_SOURCE_UI_ANIMATIONS_SLIDETRANSITIONPANE_HXX
22 #include "SlideSorterViewShell.hxx"
24 #include <vcl/lstbox.hxx>
25 #include <vcl/fixed.hxx>
26 #include <vcl/button.hxx>
27 #include <vcl/field.hxx>
28 #include <svtools/valueset.hxx>
29 #include <svx/sidebar/PanelLayout.hxx>
36 namespace com
{ namespace sun
{ namespace star
{ namespace drawing
{ class XDrawView
; } } } }
37 namespace com
{ namespace sun
{ namespace star
{ namespace frame
{ class XModel
; } } } }
38 namespace sd
{ namespace tools
{ class EventMultiplexerEvent
; } }
47 struct TransitionEffect
;
50 class SlideTransitionPane
: public PanelLayout
53 explicit SlideTransitionPane(
55 ViewShellBase
& rBase
,
57 const css::uno::Reference
<css::frame::XFrame
>& rxFrame
);
58 explicit SlideTransitionPane(
60 ViewShellBase
& rBase
,
62 const css::uno::Reference
<css::frame::XFrame
>& rxFrame
,
63 bool bHorizontalLayout
);
64 virtual ~SlideTransitionPane() override
;
65 virtual void dispose() override
;
68 virtual void DataChanged (const DataChangedEvent
& rEvent
) override
;
70 void onSelectionChanged();
71 void onChangeCurrentPage();
74 void updateControls();
75 void updateControlState();
76 void updateVariants(size_t nPresetOffset
);
78 void updateSoundList();
79 void openSoundFileDialog();
81 impl::TransitionEffect
getTransitionEffectFromControls() const;
83 void applyToSelectedPages(bool bPreview
);
84 void playCurrentEffect();
87 void removeListener();
89 ::sd::slidesorter::SharedPageSelection
getSelectedPages() const;
93 void Initialize(SdDrawDocument
* pDoc
);
95 DECL_LINK( ApplyToAllButtonClicked
, Button
*, void );
96 DECL_LINK( PlayButtonClicked
, Button
*, void );
97 DECL_LINK( AutoPreviewClicked
, Button
*, void );
99 DECL_LINK( TransitionSelected
, ValueSet
*, void );
100 DECL_LINK( AdvanceSlideRadioButtonToggled
, RadioButton
&, void );
101 DECL_LINK( AdvanceTimeModified
, Edit
&, void );
102 DECL_LINK( VariantListBoxSelected
, ListBox
&, void );
103 DECL_LINK( DurationModifiedHdl
, Edit
&, void );
104 DECL_LINK( DurationLoseFocusHdl
, Control
&, void );
105 DECL_LINK( SoundListBoxSelected
, ListBox
&, void );
106 DECL_LINK( LoopSoundBoxChecked
, Button
*, void );
107 DECL_LINK( EventMultiplexerListener
, tools::EventMultiplexerEvent
&, void );
108 DECL_LINK(LateInitCallback
, Timer
*, void);
110 ViewShellBase
& mrBase
;
111 SdDrawDocument
* const mpDrawDoc
;
113 VclPtr
<ValueSet
> mpVS_TRANSITION_ICONS
;
114 VclPtr
<FixedText
> mpFT_VARIANT
;
115 VclPtr
<ListBox
> mpLB_VARIANT
;
116 VclPtr
<FixedText
> mpFT_duration
;
117 VclPtr
<MetricBox
> mpCBX_duration
;
118 VclPtr
<FixedText
> mpFT_SOUND
;
119 VclPtr
<ListBox
> mpLB_SOUND
;
120 VclPtr
<CheckBox
> mpCB_LOOP_SOUND
;
121 VclPtr
<RadioButton
> mpRB_ADVANCE_ON_MOUSE
;
122 VclPtr
<RadioButton
> mpRB_ADVANCE_AUTO
;
123 VclPtr
<MetricField
> mpMF_ADVANCE_AUTO_AFTER
;
124 VclPtr
<PushButton
> mpPB_APPLY_TO_ALL
;
125 VclPtr
<PushButton
> mpPB_PLAY
;
126 VclPtr
<CheckBox
> mpCB_AUTO_PREVIEW
;
128 css::uno::Reference
< css::drawing::XDrawView
> mxView
;
129 css::uno::Reference
< css::frame::XModel
> mxModel
;
132 bool mbUpdatingControls
;
133 bool mbIsMainViewChangePending
;
134 bool const mbHorizontalLayout
;
136 std::vector
<OUString
> maSoundList
;
137 mutable OUString maCurrentSoundFile
;
139 // How many variants each transition set has
140 std::map
< OUString
, int > m_aNumVariants
;
142 Timer maLateInitTimer
;
147 // INCLUDED_SD_SOURCE_UI_ANIMATIONS_SLIDETRANSITIONPANE_HXX
150 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */