merge the formfield patch from ooo-build
[ooovba.git] / sd / source / ui / slideshow / showwindow.hxx
blobb264670e2855c766d62dd3338045fd0c71fc923c
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: showwindow.hxx,v $
11 * $Revision: 1.4 $
13 * This file is part of OpenOffice.org.
15 * OpenOffice.org is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License version 3
17 * only, as published by the Free Software Foundation.
19 * OpenOffice.org is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License version 3 for more details
23 * (a copy is included in the LICENSE file that accompanied this code).
25 * You should have received a copy of the GNU Lesser General Public License
26 * version 3 along with OpenOffice.org. If not, see
27 * <http://www.openoffice.org/license.html>
28 * for a copy of the LGPLv3 License.
30 ************************************************************************/
32 #ifndef SD_SHOW_WINDOW_HXX
33 #define SD_SHOW_WINDOW_HXX
35 #include <rtl/ref.hxx>
36 #include <sal/types.h>
37 #include <vcl/timer.hxx>
38 #include <vcl/graph.hxx>
40 #ifndef SD_WINDOW_HXX
41 #include "Window.hxx"
42 #endif
44 #include "slideshowimpl.hxx"
46 // ----------------
47 // - SdShowWindow -
48 // ----------------
51 namespace sd {
53 class SlideshowImpl;
54 class PreviewWindow;
55 class ViewShell;
57 // -----------
58 // - Defines -
59 // -----------
61 #define SLIDE_NO_TIMEOUT SAL_MAX_INT32
63 // ---------
64 // - Enums -
65 // ---------
67 enum ShowWindowMode
69 SHOWWINDOWMODE_NORMAL = 0,
70 SHOWWINDOWMODE_PAUSE = 1,
71 SHOWWINDOWMODE_END = 2,
72 SHOWWINDOWMODE_BLANK = 3,
73 SHOWWINDOWMODE_PREVIEW = 4
76 //class ShowWindowImpl;
78 class ShowWindow
79 : public ::sd::Window
81 // friend class ShowWindowImpl;
82 public:
83 ShowWindow ( const ::rtl::Reference< ::sd::SlideshowImpl >& xController, ::Window* pParent );
84 virtual ~ShowWindow (void);
86 BOOL SetEndMode();
87 BOOL SetPauseMode( sal_Int32 nPageIndexToRestart, sal_Int32 nTimeoutSec = SLIDE_NO_TIMEOUT, Graphic* pLogo = NULL );
88 BOOL SetBlankMode( sal_Int32 nPageIndexToRestart, const Color& rBlankColor );
90 const Color& GetBlankColor() const { return maShowBackground.GetColor(); }
92 void SetPreviewMode();
93 void SetPresentationArea( const Rectangle& rPresArea );
95 void SetMouseAutoHide( bool bMouseAutoHide ) { mbMouseAutoHide = bMouseAutoHide; }
97 ShowWindowMode GetShowWindowMode() const { return meShowWindowMode; }
99 void RestartShow( sal_Int32 nPageIndexToRestart );
101 virtual void Move();
102 virtual void Resize();
103 virtual void GetFocus();
104 virtual void LoseFocus();
105 // virtual void GrabFocus();
107 virtual void KeyInput(const KeyEvent& rKEvt);
108 virtual void MouseMove(const MouseEvent& rMEvt);
109 virtual void MouseButtonUp(const MouseEvent& rMEvt);
110 virtual void MouseButtonDown(const MouseEvent& rMEvt);
111 virtual void Paint(const Rectangle& rRect);
112 virtual long Notify(NotifyEvent& rNEvt);
114 void TerminateShow();
115 void RestartShow();
117 private:
118 void DrawPauseScene( BOOL bTimeoutOnly );
119 void DrawEndScene();
120 void DrawBlankScene();
122 void DeleteWindowFromPaintView();
123 void AddWindowToPaintView();
125 private:
126 Timer maPauseTimer;
127 Timer maMouseTimer;
128 Wallpaper maShowBackground;
129 Graphic maLogo;
130 ULONG mnPauseTimeout;
131 sal_Int32 mnRestartPageIndex;
132 ShowWindowMode meShowWindowMode;
133 BOOL mbShowNavigatorAfterSpecialMode;
134 Rectangle maPresArea;
135 bool mbMouseAutoHide;
136 bool mbMouseCursorHidden;
137 ULONG mnFirstMouseMove;
139 DECL_LINK( PauseTimeoutHdl, Timer* pTimer );
140 DECL_LINK( MouseTimeoutHdl, Timer* pTimer );
141 DECL_LINK( EventHdl, VclWindowEvent* pEvent );
143 ::rtl::Reference< SlideshowImpl > mxController;
146 } // end of namespace sd
148 #endif