xref: /AOO41X/main/sd/source/ui/slideshow/showwindow.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
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 
28*cdf0e10cSrcweir #ifndef SD_SHOW_WINDOW_HXX
29*cdf0e10cSrcweir #define SD_SHOW_WINDOW_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include <rtl/ref.hxx>
32*cdf0e10cSrcweir #include <sal/types.h>
33*cdf0e10cSrcweir #include <vcl/timer.hxx>
34*cdf0e10cSrcweir #include <vcl/graph.hxx>
35*cdf0e10cSrcweir 
36*cdf0e10cSrcweir #ifndef SD_WINDOW_HXX
37*cdf0e10cSrcweir #include "Window.hxx"
38*cdf0e10cSrcweir #endif
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir #include "slideshowimpl.hxx"
41*cdf0e10cSrcweir 
42*cdf0e10cSrcweir // ----------------
43*cdf0e10cSrcweir // - SdShowWindow -
44*cdf0e10cSrcweir // ----------------
45*cdf0e10cSrcweir 
46*cdf0e10cSrcweir 
47*cdf0e10cSrcweir namespace sd {
48*cdf0e10cSrcweir 
49*cdf0e10cSrcweir class SlideshowImpl;
50*cdf0e10cSrcweir class PreviewWindow;
51*cdf0e10cSrcweir class ViewShell;
52*cdf0e10cSrcweir 
53*cdf0e10cSrcweir // -----------
54*cdf0e10cSrcweir // - Defines -
55*cdf0e10cSrcweir // -----------
56*cdf0e10cSrcweir 
57*cdf0e10cSrcweir #define SLIDE_NO_TIMEOUT SAL_MAX_INT32
58*cdf0e10cSrcweir 
59*cdf0e10cSrcweir // ---------
60*cdf0e10cSrcweir // - Enums -
61*cdf0e10cSrcweir // ---------
62*cdf0e10cSrcweir 
63*cdf0e10cSrcweir enum ShowWindowMode
64*cdf0e10cSrcweir {
65*cdf0e10cSrcweir     SHOWWINDOWMODE_NORMAL = 0,
66*cdf0e10cSrcweir     SHOWWINDOWMODE_PAUSE = 1,
67*cdf0e10cSrcweir     SHOWWINDOWMODE_END = 2,
68*cdf0e10cSrcweir     SHOWWINDOWMODE_BLANK = 3,
69*cdf0e10cSrcweir 	SHOWWINDOWMODE_PREVIEW = 4
70*cdf0e10cSrcweir };
71*cdf0e10cSrcweir 
72*cdf0e10cSrcweir //class ShowWindowImpl;
73*cdf0e10cSrcweir 
74*cdf0e10cSrcweir class ShowWindow
75*cdf0e10cSrcweir     : public ::sd::Window
76*cdf0e10cSrcweir {
77*cdf0e10cSrcweir //	friend class ShowWindowImpl;
78*cdf0e10cSrcweir public:
79*cdf0e10cSrcweir 	ShowWindow ( const ::rtl::Reference< ::sd::SlideshowImpl >& xController, ::Window* pParent );
80*cdf0e10cSrcweir     virtual ~ShowWindow (void);
81*cdf0e10cSrcweir 
82*cdf0e10cSrcweir    	sal_Bool			SetEndMode();
83*cdf0e10cSrcweir 	sal_Bool			SetPauseMode( sal_Int32 nPageIndexToRestart, sal_Int32 nTimeoutSec = SLIDE_NO_TIMEOUT, Graphic* pLogo = NULL );
84*cdf0e10cSrcweir 	sal_Bool			SetBlankMode( sal_Int32 nPageIndexToRestart, const Color& rBlankColor );
85*cdf0e10cSrcweir 
86*cdf0e10cSrcweir 	const Color&		GetBlankColor() const { return maShowBackground.GetColor(); }
87*cdf0e10cSrcweir 
88*cdf0e10cSrcweir 	void			SetPreviewMode();
89*cdf0e10cSrcweir 	void			SetPresentationArea( const Rectangle& rPresArea );
90*cdf0e10cSrcweir 
91*cdf0e10cSrcweir 	void			SetMouseAutoHide( bool bMouseAutoHide ) { mbMouseAutoHide = bMouseAutoHide; }
92*cdf0e10cSrcweir 
93*cdf0e10cSrcweir 	ShowWindowMode  GetShowWindowMode() const { return meShowWindowMode; }
94*cdf0e10cSrcweir 
95*cdf0e10cSrcweir 	void			RestartShow( sal_Int32 nPageIndexToRestart );
96*cdf0e10cSrcweir 
97*cdf0e10cSrcweir     virtual void	Move();
98*cdf0e10cSrcweir     virtual void	Resize();
99*cdf0e10cSrcweir     virtual void	GetFocus();
100*cdf0e10cSrcweir     virtual void	LoseFocus();
101*cdf0e10cSrcweir //	virtual void	GrabFocus();
102*cdf0e10cSrcweir 
103*cdf0e10cSrcweir 	virtual void	KeyInput(const KeyEvent& rKEvt);
104*cdf0e10cSrcweir 	virtual void	MouseMove(const MouseEvent& rMEvt);
105*cdf0e10cSrcweir 	virtual void	MouseButtonUp(const MouseEvent& rMEvt);
106*cdf0e10cSrcweir 	virtual void	MouseButtonDown(const MouseEvent& rMEvt);
107*cdf0e10cSrcweir 	virtual void	Paint(const Rectangle& rRect);
108*cdf0e10cSrcweir 	virtual long	Notify(NotifyEvent& rNEvt);
109*cdf0e10cSrcweir 
110*cdf0e10cSrcweir 	void			TerminateShow();
111*cdf0e10cSrcweir 	void			RestartShow();
112*cdf0e10cSrcweir 
113*cdf0e10cSrcweir private:
114*cdf0e10cSrcweir 	void			DrawPauseScene( sal_Bool bTimeoutOnly );
115*cdf0e10cSrcweir 	void			DrawEndScene();
116*cdf0e10cSrcweir 	void			DrawBlankScene();
117*cdf0e10cSrcweir 
118*cdf0e10cSrcweir 	void			DeleteWindowFromPaintView();
119*cdf0e10cSrcweir 	void			AddWindowToPaintView();
120*cdf0e10cSrcweir 
121*cdf0e10cSrcweir private:
122*cdf0e10cSrcweir 	Timer			maPauseTimer;
123*cdf0e10cSrcweir 	Timer			maMouseTimer;
124*cdf0e10cSrcweir 	Wallpaper		maShowBackground;
125*cdf0e10cSrcweir 	Graphic			maLogo;
126*cdf0e10cSrcweir 	sal_uLong			mnPauseTimeout;
127*cdf0e10cSrcweir 	sal_Int32		mnRestartPageIndex;
128*cdf0e10cSrcweir     ShowWindowMode  meShowWindowMode;
129*cdf0e10cSrcweir 	sal_Bool			mbShowNavigatorAfterSpecialMode;
130*cdf0e10cSrcweir 	Rectangle		maPresArea;
131*cdf0e10cSrcweir 	bool			mbMouseAutoHide;
132*cdf0e10cSrcweir 	bool			mbMouseCursorHidden;
133*cdf0e10cSrcweir 	sal_uLong			mnFirstMouseMove;
134*cdf0e10cSrcweir 
135*cdf0e10cSrcweir 					DECL_LINK( PauseTimeoutHdl, Timer* pTimer );
136*cdf0e10cSrcweir 					DECL_LINK( MouseTimeoutHdl, Timer* pTimer );
137*cdf0e10cSrcweir 					DECL_LINK( EventHdl, VclWindowEvent* pEvent );
138*cdf0e10cSrcweir 
139*cdf0e10cSrcweir 	::rtl::Reference< SlideshowImpl > mxController;
140*cdf0e10cSrcweir };
141*cdf0e10cSrcweir 
142*cdf0e10cSrcweir } // end of namespace sd
143*cdf0e10cSrcweir 
144*cdf0e10cSrcweir #endif
145