xref: /AOO41X/main/sd/source/ui/animations/SlideTransitionPane.hxx (revision c45d927ae478a6b27be268f8970f881a09d05b3f)
1*c45d927aSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*c45d927aSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*c45d927aSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*c45d927aSAndrew Rist  * distributed with this work for additional information
6*c45d927aSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*c45d927aSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*c45d927aSAndrew Rist  * "License"); you may not use this file except in compliance
9*c45d927aSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*c45d927aSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*c45d927aSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*c45d927aSAndrew Rist  * software distributed under the License is distributed on an
15*c45d927aSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*c45d927aSAndrew Rist  * KIND, either express or implied.  See the License for the
17*c45d927aSAndrew Rist  * specific language governing permissions and limitations
18*c45d927aSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*c45d927aSAndrew Rist  *************************************************************/
21*c45d927aSAndrew Rist 
22*c45d927aSAndrew Rist 
23cdf0e10cSrcweir #ifndef SD_SLIDETRANSITIONPANE_HXX
24cdf0e10cSrcweir #define SD_SLIDETRANSITIONPANE_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include "EventMultiplexer.hxx"
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include "SlideSorterViewShell.hxx"
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #include <vcl/ctrl.hxx>
31cdf0e10cSrcweir #include <vcl/lstbox.hxx>
32cdf0e10cSrcweir #include <vcl/fixed.hxx>
33cdf0e10cSrcweir #include <vcl/button.hxx>
34cdf0e10cSrcweir #include <vcl/field.hxx>
35cdf0e10cSrcweir #include <com/sun/star/drawing/XDrawView.hpp>
36cdf0e10cSrcweir #include <com/sun/star/frame/XModel.hpp>
37cdf0e10cSrcweir 
38cdf0e10cSrcweir #include <vector>
39cdf0e10cSrcweir #include <map>
40cdf0e10cSrcweir 
41cdf0e10cSrcweir class SdDrawDocument;
42cdf0e10cSrcweir class SdPage;
43cdf0e10cSrcweir 
44cdf0e10cSrcweir namespace sd
45cdf0e10cSrcweir {
46cdf0e10cSrcweir 
47cdf0e10cSrcweir class ViewShellBase;
48cdf0e10cSrcweir 
49cdf0e10cSrcweir namespace impl
50cdf0e10cSrcweir {
51cdf0e10cSrcweir     struct TransitionEffect;
52cdf0e10cSrcweir }
53cdf0e10cSrcweir 
54cdf0e10cSrcweir class SlideTransitionPane : public Control
55cdf0e10cSrcweir {
56cdf0e10cSrcweir public:
57cdf0e10cSrcweir     explicit SlideTransitionPane(
58cdf0e10cSrcweir         ::Window * pParent,
59cdf0e10cSrcweir         ViewShellBase & rBase,
60cdf0e10cSrcweir         const Size& rMinSize,
61cdf0e10cSrcweir         SdDrawDocument* pDoc );
62cdf0e10cSrcweir 	virtual ~SlideTransitionPane();
63cdf0e10cSrcweir 
64cdf0e10cSrcweir     virtual void Resize();
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 	void onSelectionChanged();
67cdf0e10cSrcweir 	void onChangeCurrentPage();
68cdf0e10cSrcweir 
69cdf0e10cSrcweir private:
70cdf0e10cSrcweir     void updateLayout();
71cdf0e10cSrcweir 	void updateControls();
72cdf0e10cSrcweir     void updateControlState();
73cdf0e10cSrcweir 
74cdf0e10cSrcweir     void updateSoundList();
75cdf0e10cSrcweir     void openSoundFileDialog();
76cdf0e10cSrcweir 
77cdf0e10cSrcweir     impl::TransitionEffect getTransitionEffectFromControls() const;
78cdf0e10cSrcweir 
79cdf0e10cSrcweir     void applyToSelectedPages();
80cdf0e10cSrcweir     void playCurrentEffect();
81cdf0e10cSrcweir 
82cdf0e10cSrcweir 	void addListener();
83cdf0e10cSrcweir 	void removeListener();
84cdf0e10cSrcweir 
85cdf0e10cSrcweir     ::sd::slidesorter::SharedPageSelection getSelectedPages (void) const;
86cdf0e10cSrcweir 
87cdf0e10cSrcweir     DECL_LINK( ApplyToAllButtonClicked, void * );
88cdf0e10cSrcweir     DECL_LINK( PlayButtonClicked, void * );
89cdf0e10cSrcweir     DECL_LINK( SlideShowButtonClicked, void * );
90cdf0e10cSrcweir 	DECL_LINK( AutoPreviewClicked, void * );
91cdf0e10cSrcweir 
92cdf0e10cSrcweir     DECL_LINK( TransitionSelected, void * );
93cdf0e10cSrcweir     DECL_LINK( AdvanceSlideRadioButtonToggled, void * );
94cdf0e10cSrcweir     DECL_LINK( AdvanceTimeModified, void * );
95cdf0e10cSrcweir     DECL_LINK( SpeedListBoxSelected, void * );
96cdf0e10cSrcweir     DECL_LINK( SoundListBoxSelected, void * );
97cdf0e10cSrcweir     DECL_LINK( LoopSoundBoxChecked, void * );
98cdf0e10cSrcweir     DECL_LINK(EventMultiplexerListener, tools::EventMultiplexerEvent*);
99cdf0e10cSrcweir     DECL_LINK(LateInitCallback, Timer*);
100cdf0e10cSrcweir 
101cdf0e10cSrcweir private:
102cdf0e10cSrcweir     ViewShellBase &   mrBase;
103cdf0e10cSrcweir     SdDrawDocument *  mpDrawDoc;
104cdf0e10cSrcweir     Size              maMinSize;
105cdf0e10cSrcweir 
106cdf0e10cSrcweir     FixedLine    maFL_APPLY_TRANSITION;
107cdf0e10cSrcweir     ListBox      maLB_SLIDE_TRANSITIONS;
108cdf0e10cSrcweir     FixedLine    maFL_MODIFY_TRANSITION;
109cdf0e10cSrcweir     FixedText    maFT_SPEED;
110cdf0e10cSrcweir     ListBox      maLB_SPEED;
111cdf0e10cSrcweir     FixedText    maFT_SOUND;
112cdf0e10cSrcweir     ListBox      maLB_SOUND;
113cdf0e10cSrcweir     CheckBox     maCB_LOOP_SOUND;
114cdf0e10cSrcweir     FixedLine    maFL_ADVANCE_SLIDE;
115cdf0e10cSrcweir     RadioButton  maRB_ADVANCE_ON_MOUSE;
116cdf0e10cSrcweir     RadioButton  maRB_ADVANCE_AUTO;
117cdf0e10cSrcweir     MetricField  maMF_ADVANCE_AUTO_AFTER;
118cdf0e10cSrcweir     FixedLine    maFL_EMPTY1;
119cdf0e10cSrcweir     PushButton   maPB_APPLY_TO_ALL;
120cdf0e10cSrcweir     PushButton   maPB_PLAY;
121cdf0e10cSrcweir     PushButton   maPB_SLIDE_SHOW;
122cdf0e10cSrcweir     FixedLine    maFL_EMPTY2;
123cdf0e10cSrcweir     CheckBox     maCB_AUTO_PREVIEW;
124cdf0e10cSrcweir 
125cdf0e10cSrcweir     String       maSTR_NO_TRANSITION;
126cdf0e10cSrcweir 
127cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawView >             mxView;
128cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >                  mxModel;
129cdf0e10cSrcweir 
130cdf0e10cSrcweir     bool         mbHasSelection;
131cdf0e10cSrcweir     bool         mbUpdatingControls;
132cdf0e10cSrcweir     bool         mbIsMainViewChangePending;
133cdf0e10cSrcweir 
134cdf0e10cSrcweir     typedef ::std::vector< String > tSoundListType;
135cdf0e10cSrcweir     tSoundListType  maSoundList;
136cdf0e10cSrcweir     mutable String  maCurrentSoundFile;
137cdf0e10cSrcweir 
138cdf0e10cSrcweir     typedef ::std::map< sal_uInt16, sal_uInt16 > tPresetIndexesType;
139cdf0e10cSrcweir     tPresetIndexesType m_aPresetIndexes;
140cdf0e10cSrcweir 
141cdf0e10cSrcweir     Timer maLateInitTimer;
142cdf0e10cSrcweir };
143cdf0e10cSrcweir 
144cdf0e10cSrcweir } //  namespace sd
145cdf0e10cSrcweir 
146cdf0e10cSrcweir // SD_SLIDETRANSITIONPANE_HXX
147cdf0e10cSrcweir #endif
148