1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir #ifndef SD_SLIDETRANSITIONPANE_HXX
28*cdf0e10cSrcweir #define SD_SLIDETRANSITIONPANE_HXX
29*cdf0e10cSrcweir 
30*cdf0e10cSrcweir #include "EventMultiplexer.hxx"
31*cdf0e10cSrcweir 
32*cdf0e10cSrcweir #include "SlideSorterViewShell.hxx"
33*cdf0e10cSrcweir 
34*cdf0e10cSrcweir #include <vcl/ctrl.hxx>
35*cdf0e10cSrcweir #include <vcl/lstbox.hxx>
36*cdf0e10cSrcweir #include <vcl/fixed.hxx>
37*cdf0e10cSrcweir #include <vcl/button.hxx>
38*cdf0e10cSrcweir #include <vcl/field.hxx>
39*cdf0e10cSrcweir #include <com/sun/star/drawing/XDrawView.hpp>
40*cdf0e10cSrcweir #include <com/sun/star/frame/XModel.hpp>
41*cdf0e10cSrcweir 
42*cdf0e10cSrcweir #include <vector>
43*cdf0e10cSrcweir #include <map>
44*cdf0e10cSrcweir 
45*cdf0e10cSrcweir class SdDrawDocument;
46*cdf0e10cSrcweir class SdPage;
47*cdf0e10cSrcweir 
48*cdf0e10cSrcweir namespace sd
49*cdf0e10cSrcweir {
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir class ViewShellBase;
52*cdf0e10cSrcweir 
53*cdf0e10cSrcweir namespace impl
54*cdf0e10cSrcweir {
55*cdf0e10cSrcweir     struct TransitionEffect;
56*cdf0e10cSrcweir }
57*cdf0e10cSrcweir 
58*cdf0e10cSrcweir class SlideTransitionPane : public Control
59*cdf0e10cSrcweir {
60*cdf0e10cSrcweir public:
61*cdf0e10cSrcweir     explicit SlideTransitionPane(
62*cdf0e10cSrcweir         ::Window * pParent,
63*cdf0e10cSrcweir         ViewShellBase & rBase,
64*cdf0e10cSrcweir         const Size& rMinSize,
65*cdf0e10cSrcweir         SdDrawDocument* pDoc );
66*cdf0e10cSrcweir 	virtual ~SlideTransitionPane();
67*cdf0e10cSrcweir 
68*cdf0e10cSrcweir     virtual void Resize();
69*cdf0e10cSrcweir 
70*cdf0e10cSrcweir 	void onSelectionChanged();
71*cdf0e10cSrcweir 	void onChangeCurrentPage();
72*cdf0e10cSrcweir 
73*cdf0e10cSrcweir private:
74*cdf0e10cSrcweir     void updateLayout();
75*cdf0e10cSrcweir 	void updateControls();
76*cdf0e10cSrcweir     void updateControlState();
77*cdf0e10cSrcweir 
78*cdf0e10cSrcweir     void updateSoundList();
79*cdf0e10cSrcweir     void openSoundFileDialog();
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir     impl::TransitionEffect getTransitionEffectFromControls() const;
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir     void applyToSelectedPages();
84*cdf0e10cSrcweir     void playCurrentEffect();
85*cdf0e10cSrcweir 
86*cdf0e10cSrcweir 	void addListener();
87*cdf0e10cSrcweir 	void removeListener();
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir     ::sd::slidesorter::SharedPageSelection getSelectedPages (void) const;
90*cdf0e10cSrcweir 
91*cdf0e10cSrcweir     DECL_LINK( ApplyToAllButtonClicked, void * );
92*cdf0e10cSrcweir     DECL_LINK( PlayButtonClicked, void * );
93*cdf0e10cSrcweir     DECL_LINK( SlideShowButtonClicked, void * );
94*cdf0e10cSrcweir 	DECL_LINK( AutoPreviewClicked, void * );
95*cdf0e10cSrcweir 
96*cdf0e10cSrcweir     DECL_LINK( TransitionSelected, void * );
97*cdf0e10cSrcweir     DECL_LINK( AdvanceSlideRadioButtonToggled, void * );
98*cdf0e10cSrcweir     DECL_LINK( AdvanceTimeModified, void * );
99*cdf0e10cSrcweir     DECL_LINK( SpeedListBoxSelected, void * );
100*cdf0e10cSrcweir     DECL_LINK( SoundListBoxSelected, void * );
101*cdf0e10cSrcweir     DECL_LINK( LoopSoundBoxChecked, void * );
102*cdf0e10cSrcweir     DECL_LINK(EventMultiplexerListener, tools::EventMultiplexerEvent*);
103*cdf0e10cSrcweir     DECL_LINK(LateInitCallback, Timer*);
104*cdf0e10cSrcweir 
105*cdf0e10cSrcweir private:
106*cdf0e10cSrcweir     ViewShellBase &   mrBase;
107*cdf0e10cSrcweir     SdDrawDocument *  mpDrawDoc;
108*cdf0e10cSrcweir     Size              maMinSize;
109*cdf0e10cSrcweir 
110*cdf0e10cSrcweir     FixedLine    maFL_APPLY_TRANSITION;
111*cdf0e10cSrcweir     ListBox      maLB_SLIDE_TRANSITIONS;
112*cdf0e10cSrcweir     FixedLine    maFL_MODIFY_TRANSITION;
113*cdf0e10cSrcweir     FixedText    maFT_SPEED;
114*cdf0e10cSrcweir     ListBox      maLB_SPEED;
115*cdf0e10cSrcweir     FixedText    maFT_SOUND;
116*cdf0e10cSrcweir     ListBox      maLB_SOUND;
117*cdf0e10cSrcweir     CheckBox     maCB_LOOP_SOUND;
118*cdf0e10cSrcweir     FixedLine    maFL_ADVANCE_SLIDE;
119*cdf0e10cSrcweir     RadioButton  maRB_ADVANCE_ON_MOUSE;
120*cdf0e10cSrcweir     RadioButton  maRB_ADVANCE_AUTO;
121*cdf0e10cSrcweir     MetricField  maMF_ADVANCE_AUTO_AFTER;
122*cdf0e10cSrcweir     FixedLine    maFL_EMPTY1;
123*cdf0e10cSrcweir     PushButton   maPB_APPLY_TO_ALL;
124*cdf0e10cSrcweir     PushButton   maPB_PLAY;
125*cdf0e10cSrcweir     PushButton   maPB_SLIDE_SHOW;
126*cdf0e10cSrcweir     FixedLine    maFL_EMPTY2;
127*cdf0e10cSrcweir     CheckBox     maCB_AUTO_PREVIEW;
128*cdf0e10cSrcweir 
129*cdf0e10cSrcweir     String       maSTR_NO_TRANSITION;
130*cdf0e10cSrcweir 
131*cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawView >             mxView;
132*cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >                  mxModel;
133*cdf0e10cSrcweir 
134*cdf0e10cSrcweir     bool         mbHasSelection;
135*cdf0e10cSrcweir     bool         mbUpdatingControls;
136*cdf0e10cSrcweir     bool         mbIsMainViewChangePending;
137*cdf0e10cSrcweir 
138*cdf0e10cSrcweir     typedef ::std::vector< String > tSoundListType;
139*cdf0e10cSrcweir     tSoundListType  maSoundList;
140*cdf0e10cSrcweir     mutable String  maCurrentSoundFile;
141*cdf0e10cSrcweir 
142*cdf0e10cSrcweir     typedef ::std::map< sal_uInt16, sal_uInt16 > tPresetIndexesType;
143*cdf0e10cSrcweir     tPresetIndexesType m_aPresetIndexes;
144*cdf0e10cSrcweir 
145*cdf0e10cSrcweir     Timer maLateInitTimer;
146*cdf0e10cSrcweir };
147*cdf0e10cSrcweir 
148*cdf0e10cSrcweir } //  namespace sd
149*cdf0e10cSrcweir 
150*cdf0e10cSrcweir // SD_SLIDETRANSITIONPANE_HXX
151*cdf0e10cSrcweir #endif
152