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