Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 :
21 : #include <com/sun/star/awt/Key.hpp>
22 :
23 : #include "showwindow.hxx"
24 :
25 : #include <unotools/syslocale.hxx>
26 : #include <sfx2/viewfrm.hxx>
27 :
28 :
29 : #include "res_bmp.hrc"
30 : #include "slideshow.hxx"
31 : #include "ViewShellBase.hxx"
32 : #include "sdresid.hxx"
33 : #include "helpids.h"
34 : #include "strings.hrc"
35 : #include <vcl/virdev.hxx>
36 :
37 : using namespace ::com::sun::star;
38 :
39 : namespace sd {
40 :
41 : static const sal_uLong HIDE_MOUSE_TIMEOUT = 10000;
42 : static const sal_uLong SHOW_MOUSE_TIMEOUT = 1000;
43 :
44 : // =============================================================================
45 :
46 0 : ShowWindow::ShowWindow( const ::rtl::Reference< SlideshowImpl >& xController, ::Window* pParent )
47 : : ::sd::Window( pParent )
48 : , mnPauseTimeout( SLIDE_NO_TIMEOUT )
49 : , mnRestartPageIndex( PAGE_NO_END )
50 : , meShowWindowMode(SHOWWINDOWMODE_NORMAL)
51 : , mbShowNavigatorAfterSpecialMode( false )
52 : , mbMouseAutoHide(true)
53 : , mbMouseCursorHidden(false)
54 : , mnFirstMouseMove(0)
55 0 : , mxController( xController )
56 : {
57 0 : SetOutDevViewType( OUTDEV_VIEWTYPE_SLIDESHOW );
58 :
59 : // Do never mirror the preview window. This explicitly includes right
60 : // to left writing environments.
61 0 : EnableRTL (sal_False);
62 :
63 0 : MapMode aMap(GetMapMode());
64 0 : aMap.SetMapUnit(MAP_100TH_MM);
65 0 : SetMapMode(aMap);
66 :
67 : // set HelpId
68 0 : SetHelpId( HID_SD_WIN_PRESENTATION );
69 0 : SetUniqueId( HID_SD_WIN_PRESENTATION );
70 :
71 0 : maPauseTimer.SetTimeoutHdl( LINK( this, ShowWindow, PauseTimeoutHdl ) );
72 0 : maPauseTimer.SetTimeout( 1000 );
73 0 : maMouseTimer.SetTimeoutHdl( LINK( this, ShowWindow, MouseTimeoutHdl ) );
74 0 : maMouseTimer.SetTimeout( HIDE_MOUSE_TIMEOUT );
75 :
76 0 : maShowBackground = Wallpaper( Color( COL_BLACK ) );
77 0 : SetBackground(); // avoids that VCL paints any background!
78 0 : GetParent()->Show();
79 0 : AddEventListener( LINK( this, ShowWindow, EventHdl ) );
80 0 : }
81 :
82 0 : ShowWindow::~ShowWindow(void)
83 : {
84 0 : maPauseTimer.Stop();
85 0 : maMouseTimer.Stop();
86 0 : }
87 :
88 :
89 0 : void ShowWindow::KeyInput(const KeyEvent& rKEvt)
90 : {
91 0 : bool bReturn = false;
92 :
93 0 : if( SHOWWINDOWMODE_PREVIEW == meShowWindowMode )
94 : {
95 0 : TerminateShow();
96 0 : bReturn = true;
97 : }
98 0 : else if( SHOWWINDOWMODE_END == meShowWindowMode )
99 : {
100 0 : const int nKeyCode = rKEvt.GetKeyCode().GetCode();
101 0 : switch( nKeyCode )
102 : {
103 : case KEY_PAGEUP:
104 : case KEY_LEFT:
105 : case KEY_UP:
106 : case KEY_P:
107 : case KEY_HOME:
108 : case KEY_END:
109 : case awt::Key::CONTEXTMENU:
110 : // these keys will be handled by the slide show even
111 : // while in end mode
112 0 : break;
113 : default:
114 0 : TerminateShow();
115 0 : bReturn = true;
116 : }
117 : }
118 0 : else if( SHOWWINDOWMODE_BLANK == meShowWindowMode )
119 : {
120 0 : RestartShow();
121 0 : bReturn = true;
122 : }
123 0 : else if( SHOWWINDOWMODE_PAUSE == meShowWindowMode )
124 : {
125 0 : const int nKeyCode = rKEvt.GetKeyCode().GetCode();
126 0 : switch( nKeyCode )
127 : {
128 : case KEY_ESCAPE:
129 0 : TerminateShow();
130 0 : bReturn = true;
131 0 : break;
132 : case KEY_PAGEUP:
133 : case KEY_RIGHT:
134 : case KEY_UP:
135 : case KEY_P:
136 : case KEY_HOME:
137 : case KEY_END:
138 : case awt::Key::CONTEXTMENU:
139 : // these keys will be handled by the slide show even
140 : // while in end mode
141 0 : break;
142 : default:
143 0 : RestartShow();
144 0 : bReturn = true;
145 0 : break;
146 : }
147 : }
148 :
149 0 : if( !bReturn )
150 : {
151 0 : if( mxController.is() )
152 0 : bReturn = mxController->keyInput(rKEvt);
153 :
154 0 : if( !bReturn )
155 : {
156 0 : if( mpViewShell )
157 : {
158 0 : mpViewShell->KeyInput(rKEvt,this);
159 : }
160 : else
161 : {
162 0 : Window::KeyInput(rKEvt);
163 : }
164 : }
165 : }
166 :
167 0 : if( mpViewShell )
168 0 : mpViewShell->SetActiveWindow( this );
169 0 : }
170 :
171 :
172 0 : void ShowWindow::MouseButtonDown(const MouseEvent& /*rMEvt*/)
173 : {
174 0 : if( SHOWWINDOWMODE_PREVIEW == meShowWindowMode )
175 : {
176 0 : TerminateShow();
177 : }
178 0 : else if( mpViewShell )
179 : {
180 0 : mpViewShell->SetActiveWindow( this );
181 : }
182 0 : }
183 :
184 :
185 0 : void ShowWindow::MouseMove(const MouseEvent& /*rMEvt*/)
186 : {
187 0 : if( mbMouseAutoHide )
188 : {
189 0 : if( mbMouseCursorHidden )
190 : {
191 0 : if( mnFirstMouseMove )
192 : {
193 : // if this is not the first mouse move while hidden, see if
194 : // enough time has pasted to show mouse pointer again
195 0 : sal_uLong nTime = Time::GetSystemTicks();
196 0 : if( (nTime - mnFirstMouseMove) >= SHOW_MOUSE_TIMEOUT )
197 : {
198 0 : ShowPointer( sal_True );
199 0 : mnFirstMouseMove = 0;
200 0 : mbMouseCursorHidden = false;
201 0 : maMouseTimer.SetTimeout( HIDE_MOUSE_TIMEOUT );
202 0 : maMouseTimer.Start();
203 : }
204 : }
205 : else
206 : {
207 : // if this is the first mouse move, note current
208 : // time and start idle timer to cancel show mouse pointer
209 : // again if not enough mouse movement is measured
210 0 : mnFirstMouseMove = Time::GetSystemTicks();
211 0 : maMouseTimer.SetTimeout( 2*SHOW_MOUSE_TIMEOUT );
212 0 : maMouseTimer.Start();
213 : }
214 : }
215 : else
216 : {
217 : // current mousemove restarts the idle timer to hide the mouse
218 0 : maMouseTimer.Start();
219 : }
220 : }
221 :
222 0 : if( mpViewShell )
223 0 : mpViewShell->SetActiveWindow( this );
224 0 : }
225 :
226 :
227 0 : void ShowWindow::MouseButtonUp(const MouseEvent& rMEvt)
228 : {
229 0 : if( SHOWWINDOWMODE_PREVIEW == meShowWindowMode )
230 : {
231 0 : TerminateShow();
232 : }
233 0 : else if( (SHOWWINDOWMODE_END == meShowWindowMode) && !rMEvt.IsRight() )
234 : {
235 0 : TerminateShow();
236 : }
237 0 : else if( (( SHOWWINDOWMODE_BLANK == meShowWindowMode ) || ( SHOWWINDOWMODE_PAUSE == meShowWindowMode ))
238 0 : && !rMEvt.IsRight() )
239 : {
240 0 : RestartShow();
241 : }
242 : else
243 : {
244 0 : if( mxController.is() )
245 0 : mxController->mouseButtonUp( rMEvt );
246 : }
247 0 : }
248 :
249 : /**
250 : * if FuSlideShow is still available, forward it
251 : */
252 0 : void ShowWindow::Paint(const Rectangle& rRect)
253 : {
254 0 : if( (meShowWindowMode == SHOWWINDOWMODE_NORMAL) || (meShowWindowMode == SHOWWINDOWMODE_PREVIEW) )
255 : {
256 0 : if( mxController.is() )
257 : {
258 0 : mxController->paint(rRect);
259 : }
260 0 : else if(mpViewShell )
261 : {
262 0 : mpViewShell->Paint(rRect, this);
263 : }
264 : }
265 : else
266 : {
267 0 : DrawWallpaper( rRect, maShowBackground );
268 :
269 0 : if( SHOWWINDOWMODE_END == meShowWindowMode )
270 : {
271 0 : DrawEndScene();
272 : }
273 0 : else if( SHOWWINDOWMODE_PAUSE == meShowWindowMode )
274 : {
275 0 : DrawPauseScene( false );
276 : }
277 0 : else if( SHOWWINDOWMODE_BLANK == meShowWindowMode )
278 : {
279 0 : DrawBlankScene();
280 : }
281 : }
282 0 : }
283 :
284 :
285 0 : long ShowWindow::Notify(NotifyEvent& rNEvt)
286 : {
287 0 : long nOK = sal_False;
288 0 : if (!nOK)
289 0 : nOK = Window::Notify(rNEvt);
290 :
291 0 : return nOK;
292 : }
293 :
294 :
295 : // -----------------------------------------------------------------------------
296 :
297 0 : void ShowWindow::GetFocus()
298 : {
299 : // base class
300 0 : Window::GetFocus();
301 0 : }
302 :
303 : // -----------------------------------------------------------------------------
304 :
305 0 : void ShowWindow::LoseFocus()
306 : {
307 0 : Window::LoseFocus();
308 :
309 0 : if( SHOWWINDOWMODE_PREVIEW == meShowWindowMode)
310 0 : TerminateShow();
311 0 : }
312 :
313 : // -----------------------------------------------------------------------------
314 :
315 0 : void ShowWindow::Resize()
316 : {
317 0 : ::sd::Window::Resize();
318 0 : }
319 :
320 : // -----------------------------------------------------------------------------
321 :
322 0 : void ShowWindow::Move()
323 : {
324 0 : ::sd::Window::Move();
325 0 : }
326 :
327 : // -----------------------------------------------------------------------------
328 :
329 0 : bool ShowWindow::SetEndMode()
330 : {
331 0 : if( ( SHOWWINDOWMODE_NORMAL == meShowWindowMode ) && mpViewShell && mpViewShell->GetView() )
332 : {
333 0 : DeleteWindowFromPaintView();
334 0 : meShowWindowMode = SHOWWINDOWMODE_END;
335 0 : maShowBackground = Wallpaper( Color( COL_BLACK ) );
336 :
337 : // hide navigator if it is visible
338 0 : if( mpViewShell->GetViewFrame()->GetChildWindow( SID_NAVIGATOR ) )
339 : {
340 0 : mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, sal_False );
341 0 : mbShowNavigatorAfterSpecialMode = true;
342 : }
343 :
344 0 : Invalidate();
345 : }
346 :
347 0 : return( SHOWWINDOWMODE_END == meShowWindowMode );
348 : }
349 :
350 : // -----------------------------------------------------------------------------
351 :
352 0 : bool ShowWindow::SetPauseMode( sal_Int32 nPageIndexToRestart, sal_Int32 nTimeout, Graphic* pLogo )
353 : {
354 0 : rtl::Reference< SlideShow > xSlideShow;
355 :
356 0 : if( mpViewShell )
357 0 : xSlideShow = SlideShow::GetSlideShow( mpViewShell->GetViewShellBase() );
358 :
359 0 : if( xSlideShow.is() && !nTimeout )
360 : {
361 0 : xSlideShow->jumpToPageIndex( nPageIndexToRestart );
362 : }
363 0 : else if( ( SHOWWINDOWMODE_NORMAL == meShowWindowMode ) && mpViewShell && mpViewShell->GetView() )
364 : {
365 0 : DeleteWindowFromPaintView();
366 0 : mnPauseTimeout = nTimeout;
367 0 : mnRestartPageIndex = nPageIndexToRestart;
368 0 : meShowWindowMode = SHOWWINDOWMODE_PAUSE;
369 0 : maShowBackground = Wallpaper( Color( COL_BLACK ) );
370 :
371 : // hide navigator if it is visible
372 0 : if( mpViewShell->GetViewFrame()->GetChildWindow( SID_NAVIGATOR ) )
373 : {
374 0 : mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, sal_False );
375 0 : mbShowNavigatorAfterSpecialMode = true;
376 : }
377 :
378 0 : if( pLogo )
379 0 : maLogo = *pLogo;
380 :
381 0 : Invalidate();
382 :
383 0 : if( SLIDE_NO_TIMEOUT != mnPauseTimeout )
384 0 : maPauseTimer.Start();
385 : }
386 :
387 0 : return( SHOWWINDOWMODE_PAUSE == meShowWindowMode );
388 : }
389 :
390 : // -----------------------------------------------------------------------------
391 :
392 0 : bool ShowWindow::SetBlankMode( sal_Int32 nPageIndexToRestart, const Color& rBlankColor )
393 : {
394 0 : if( ( SHOWWINDOWMODE_NORMAL == meShowWindowMode ) && mpViewShell && mpViewShell->GetView() )
395 : {
396 0 : DeleteWindowFromPaintView();
397 0 : mnRestartPageIndex = nPageIndexToRestart;
398 0 : meShowWindowMode = SHOWWINDOWMODE_BLANK;
399 0 : maShowBackground = Wallpaper( rBlankColor );
400 :
401 : // hide navigator if it is visible
402 0 : if( mpViewShell->GetViewFrame()->GetChildWindow( SID_NAVIGATOR ) )
403 : {
404 0 : mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, sal_False );
405 0 : mbShowNavigatorAfterSpecialMode = true;
406 : }
407 :
408 0 : Invalidate();
409 : }
410 :
411 0 : return( SHOWWINDOWMODE_BLANK == meShowWindowMode );
412 : }
413 :
414 : // -----------------------------------------------------------------------------
415 :
416 0 : void ShowWindow::SetPreviewMode()
417 : {
418 0 : meShowWindowMode = SHOWWINDOWMODE_PREVIEW;
419 0 : }
420 :
421 : // -----------------------------------------------------------------------------
422 :
423 0 : void ShowWindow::TerminateShow()
424 : {
425 0 : maLogo.Clear();
426 0 : maPauseTimer.Stop();
427 0 : maMouseTimer.Stop();
428 0 : Erase();
429 0 : maShowBackground = Wallpaper( Color( COL_BLACK ) );
430 0 : meShowWindowMode = SHOWWINDOWMODE_NORMAL;
431 0 : mnPauseTimeout = SLIDE_NO_TIMEOUT;
432 :
433 0 : if( mpViewShell )
434 : {
435 : // show navigator?
436 0 : if( mbShowNavigatorAfterSpecialMode )
437 : {
438 0 : mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, sal_True );
439 0 : mbShowNavigatorAfterSpecialMode = false;
440 : }
441 : }
442 :
443 0 : if( mxController.is() )
444 0 : mxController->endPresentation();
445 :
446 0 : mnRestartPageIndex = PAGE_NO_END;
447 0 : }
448 :
449 : // -----------------------------------------------------------------------------
450 :
451 0 : void ShowWindow::RestartShow()
452 : {
453 0 : RestartShow( mnRestartPageIndex );
454 0 : }
455 :
456 : // -----------------------------------------------------------------------------
457 :
458 0 : void ShowWindow::RestartShow( sal_Int32 nPageIndexToRestart )
459 :
460 : {
461 0 : ShowWindowMode eOldShowWindowMode = meShowWindowMode;
462 :
463 0 : maLogo.Clear();
464 0 : maPauseTimer.Stop();
465 0 : Erase();
466 0 : maShowBackground = Wallpaper( Color( COL_BLACK ) );
467 0 : meShowWindowMode = SHOWWINDOWMODE_NORMAL;
468 0 : mnPauseTimeout = SLIDE_NO_TIMEOUT;
469 :
470 0 : if( mpViewShell )
471 : {
472 0 : rtl::Reference< SlideShow > xSlideShow( SlideShow::GetSlideShow( mpViewShell->GetViewShellBase() ) );
473 :
474 0 : if( xSlideShow.is() )
475 : {
476 0 : AddWindowToPaintView();
477 :
478 0 : if( SHOWWINDOWMODE_BLANK == eOldShowWindowMode )
479 : {
480 0 : xSlideShow->pause(false);
481 0 : Invalidate();
482 : }
483 : else
484 : {
485 0 : xSlideShow->jumpToPageIndex( nPageIndexToRestart );
486 : }
487 0 : }
488 : }
489 :
490 0 : mnRestartPageIndex = PAGE_NO_END;
491 :
492 : // show navigator?
493 0 : if( mbShowNavigatorAfterSpecialMode )
494 : {
495 0 : mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, sal_True );
496 0 : mbShowNavigatorAfterSpecialMode = false;
497 : }
498 0 : }
499 :
500 : // -----------------------------------------------------------------------------
501 :
502 0 : void ShowWindow::DrawPauseScene( bool bTimeoutOnly )
503 : {
504 0 : const MapMode& rMap = GetMapMode();
505 0 : const Point aOutOrg( PixelToLogic( Point() ) );
506 0 : const Size aOutSize( GetOutputSize() );
507 0 : const Size aTextSize( LogicToLogic( Size( 0, 14 ), MAP_POINT, rMap ) );
508 0 : const Size aOffset( LogicToLogic( Size( 1000, 1000 ), MAP_100TH_MM, rMap ) );
509 0 : String aText( SdResId( STR_PRES_PAUSE ) );
510 0 : bool bDrawn = false;
511 :
512 0 : Font aFont( GetSettings().GetStyleSettings().GetMenuFont() );
513 0 : const Font aOldFont( GetFont() );
514 :
515 0 : aFont.SetSize( aTextSize );
516 0 : aFont.SetColor( COL_WHITE );
517 0 : aFont.SetCharSet( aOldFont.GetCharSet() );
518 0 : aFont.SetLanguage( aOldFont.GetLanguage() );
519 :
520 0 : if( !bTimeoutOnly && ( maLogo.GetType() != GRAPHIC_NONE ) )
521 : {
522 0 : Size aGrfSize;
523 :
524 0 : if( maLogo.GetPrefMapMode() == MAP_PIXEL )
525 0 : aGrfSize = PixelToLogic( maLogo.GetPrefSize() );
526 : else
527 0 : aGrfSize = LogicToLogic( maLogo.GetPrefSize(), maLogo.GetPrefMapMode(), rMap );
528 :
529 0 : const Point aGrfPos( std::max( aOutOrg.X() + aOutSize.Width() - aGrfSize.Width() - aOffset.Width(), aOutOrg.X() ),
530 0 : std::max( aOutOrg.Y() + aOutSize.Height() - aGrfSize.Height() - aOffset.Height(), aOutOrg.Y() ) );
531 :
532 0 : if( maLogo.IsAnimated() )
533 0 : maLogo.StartAnimation( this, aGrfPos, aGrfSize, (sal_IntPtr) this );
534 : else
535 0 : maLogo.Draw( this, aGrfPos, aGrfSize );
536 : }
537 :
538 0 : if( SLIDE_NO_TIMEOUT != mnPauseTimeout )
539 : {
540 0 : MapMode aVMap( rMap );
541 0 : VirtualDevice aVDev( *this );
542 :
543 0 : aVMap.SetOrigin( Point() );
544 0 : aVDev.SetMapMode( aVMap );
545 0 : aVDev.SetBackground( Wallpaper( Color( COL_BLACK ) ) );
546 :
547 : // set font first, to determine real output height
548 0 : aVDev.SetFont( aFont );
549 :
550 0 : const Size aVDevSize( aOutSize.Width(), aVDev.GetTextHeight() );
551 :
552 0 : if( aVDev.SetOutputSize( aVDevSize ) )
553 : {
554 : // Note: if performance gets an issue here, we can use NumberFormatter directly
555 0 : SvtSysLocale aSysLocale;
556 0 : const LocaleDataWrapper& aLocaleData = aSysLocale.GetLocaleData();
557 :
558 0 : aText.AppendAscii( " ( " );
559 0 : aText += aLocaleData.getDuration( Time( 0, 0, mnPauseTimeout ) );
560 0 : aText.AppendAscii( " )" );
561 0 : aVDev.DrawText( Point( aOffset.Width(), 0 ), aText );
562 0 : DrawOutDev( Point( aOutOrg.X(), aOffset.Height() ), aVDevSize, Point(), aVDevSize, aVDev );
563 0 : bDrawn = true;
564 0 : }
565 : }
566 :
567 0 : if( !bDrawn )
568 : {
569 0 : SetFont( aFont );
570 0 : DrawText( Point( aOutOrg.X() + aOffset.Width(), aOutOrg.Y() + aOffset.Height() ), aText );
571 0 : SetFont( aOldFont );
572 0 : }
573 0 : }
574 :
575 : // -----------------------------------------------------------------------------
576 :
577 0 : void ShowWindow::DrawEndScene()
578 : {
579 0 : const Font aOldFont( GetFont() );
580 0 : Font aFont( GetSettings().GetStyleSettings().GetMenuFont() );
581 :
582 0 : const Point aOutOrg( PixelToLogic( Point() ) );
583 0 : const Size aTextSize( LogicToLogic( Size( 0, 14 ), MAP_POINT, GetMapMode() ) );
584 0 : const String aText( SdResId( STR_PRES_SOFTEND ) );
585 :
586 0 : aFont.SetSize( aTextSize );
587 0 : aFont.SetColor( COL_WHITE );
588 0 : aFont.SetCharSet( aOldFont.GetCharSet() );
589 0 : aFont.SetLanguage( aOldFont.GetLanguage() );
590 0 : SetFont( aFont );
591 0 : DrawText( Point( aOutOrg.X() + aTextSize.Height(), aOutOrg.Y() + aTextSize.Height() ), aText );
592 0 : SetFont( aOldFont );
593 0 : }
594 :
595 : // -----------------------------------------------------------------------------
596 :
597 0 : void ShowWindow::DrawBlankScene()
598 : {
599 : // just blank through background color => nothing to be done here
600 0 : }
601 :
602 : // -----------------------------------------------------------------------------
603 :
604 0 : IMPL_LINK( ShowWindow, PauseTimeoutHdl, Timer*, pTimer )
605 : {
606 0 : if( !( --mnPauseTimeout ) )
607 0 : RestartShow();
608 : else
609 : {
610 0 : DrawPauseScene( true );
611 0 : pTimer->Start();
612 : }
613 :
614 0 : return 0L;
615 : }
616 :
617 0 : IMPL_LINK_NOARG(ShowWindow, MouseTimeoutHdl)
618 : {
619 0 : if( mbMouseCursorHidden )
620 : {
621 : // not enough mouse movements since first recording so
622 : // cancel show mouse pointer for now
623 0 : mnFirstMouseMove = 0;
624 : }
625 : else
626 : {
627 : // mouse has been idle to long, hide pointer
628 0 : ShowPointer( sal_False );
629 0 : mbMouseCursorHidden = true;
630 : }
631 0 : return 0L;
632 : }
633 :
634 0 : IMPL_LINK( ShowWindow, EventHdl, VclWindowEvent*, pEvent )
635 : {
636 0 : if( mbMouseAutoHide )
637 : {
638 0 : if (pEvent->GetId() == VCLEVENT_WINDOW_SHOW)
639 : {
640 0 : maMouseTimer.SetTimeout( HIDE_MOUSE_TIMEOUT );
641 0 : maMouseTimer.Start();
642 : }
643 : }
644 0 : return 0L;
645 : }
646 :
647 0 : void ShowWindow::SetPresentationArea( const Rectangle& rPresArea )
648 : {
649 0 : maPresArea = rPresArea;
650 0 : }
651 :
652 0 : void ShowWindow::DeleteWindowFromPaintView()
653 : {
654 0 : if( mpViewShell->GetView() )
655 0 : mpViewShell->GetView()->DeleteWindowFromPaintView( this );
656 :
657 0 : sal_uInt16 nChild = GetChildCount();
658 0 : while( nChild-- )
659 0 : GetChild( nChild )->Show( sal_False );
660 0 : }
661 :
662 0 : void ShowWindow::AddWindowToPaintView()
663 : {
664 0 : if( mpViewShell->GetView() )
665 0 : mpViewShell->GetView()->AddWindowToPaintView( this );
666 :
667 0 : sal_uInt16 nChild = GetChildCount();
668 0 : while( nChild-- )
669 0 : GetChild( nChild )->Show( sal_True );
670 0 : }
671 :
672 33 : } // end of namespace sd
673 :
674 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|