xref: /trunk/main/sd/source/ui/slideshow/showwindow.hxx (revision 1dda6fa065ca9dda1aeb73fcffcf5e4176683177)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 #ifndef SD_SHOW_WINDOW_HXX
23 #define SD_SHOW_WINDOW_HXX
24 
25 #include <rtl/ref.hxx>
26 #include <sal/types.h>
27 #include <vcl/timer.hxx>
28 #include <vcl/graph.hxx>
29 
30 #ifndef SD_WINDOW_HXX
31 #include "Window.hxx"
32 #endif
33 
34 #include "slideshowimpl.hxx"
35 
36 // ----------------
37 // - SdShowWindow -
38 // ----------------
39 
40 namespace sd {
41 
42 class SlideshowImpl;
43 class PreviewWindow;
44 class ViewShell;
45 
46 // -----------
47 // - Defines -
48 // -----------
49 
50 #define SLIDE_NO_TIMEOUT SAL_MAX_INT32
51 
52 // ---------
53 // - Enums -
54 // ---------
55 
56 enum ShowWindowMode
57 {
58     SHOWWINDOWMODE_NORMAL = 0,
59     SHOWWINDOWMODE_PAUSE = 1,
60     SHOWWINDOWMODE_END = 2,
61     SHOWWINDOWMODE_BLANK = 3,
62     SHOWWINDOWMODE_PREVIEW = 4
63 };
64 
65 //class ShowWindowImpl;
66 
67 class ShowWindow
68     : public ::sd::Window
69 {
70 //  friend class ShowWindowImpl;
71 public:
72     ShowWindow ( const ::rtl::Reference< ::sd::SlideshowImpl >& xController, ::Window* pParent );
73     virtual ~ShowWindow (void);
74 
75     sal_Bool            SetEndMode();
76     sal_Bool            SetPauseMode( sal_Int32 nPageIndexToRestart, sal_Int32 nTimeoutSec = SLIDE_NO_TIMEOUT, Graphic* pLogo = NULL );
77     sal_Bool            SetBlankMode( sal_Int32 nPageIndexToRestart, const Color& rBlankColor );
78 
79     const Color&        GetBlankColor() const { return maShowBackground.GetColor(); }
80 
81     void            SetPreviewMode();
82     void            SetPresentationArea( const Rectangle& rPresArea );
83 
84     void            SetMouseAutoHide( bool bMouseAutoHide ) { mbMouseAutoHide = bMouseAutoHide; }
85 
86     ShowWindowMode  GetShowWindowMode() const { return meShowWindowMode; }
87 
88     void            RestartShow( sal_Int32 nPageIndexToRestart );
89 
90     virtual void    Move();
91     virtual void    Resize();
92     virtual void    GetFocus();
93     virtual void    LoseFocus();
94 //  virtual void    GrabFocus();
95 
96     virtual void    KeyInput(const KeyEvent& rKEvt);
97     virtual void    MouseMove(const MouseEvent& rMEvt);
98     virtual void    MouseButtonUp(const MouseEvent& rMEvt);
99     virtual void    MouseButtonDown(const MouseEvent& rMEvt);
100     virtual void    Paint(const Rectangle& rRect);
101     virtual long    Notify(NotifyEvent& rNEvt);
102     // Overload the sd::Window's CreateAccessible to create a different accessible object
103     virtual ::com::sun::star::uno::Reference<
104         ::com::sun::star::accessibility::XAccessible>
105         CreateAccessible (void);
106 
107     void            TerminateShow();
108     void            RestartShow();
109 
110 private:
111     void            DrawPauseScene( sal_Bool bTimeoutOnly );
112     void            DrawEndScene();
113     void            DrawBlankScene();
114 
115     void            DeleteWindowFromPaintView();
116     void            AddWindowToPaintView();
117 
118 private:
119     Timer           maPauseTimer;
120     Timer           maMouseTimer;
121     Wallpaper       maShowBackground;
122     Graphic         maLogo;
123     sal_uLong           mnPauseTimeout;
124     sal_Int32       mnRestartPageIndex;
125     ShowWindowMode  meShowWindowMode;
126     sal_Bool            mbShowNavigatorAfterSpecialMode;
127     Rectangle       maPresArea;
128     bool            mbMouseAutoHide;
129     bool            mbMouseCursorHidden;
130     sal_uLong           mnFirstMouseMove;
131 
132                     DECL_LINK( PauseTimeoutHdl, Timer* pTimer );
133                     DECL_LINK( MouseTimeoutHdl, Timer* pTimer );
134                     DECL_LINK( EventHdl, VclWindowEvent* pEvent );
135 
136     ::rtl::Reference< SlideshowImpl > mxController;
137 };
138 
139 } // end of namespace sd
140 
141 #endif
142 
143 /* vim: set noet sw=4 ts=4: */
144