1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: SlideView.hxx,v $
10 * $Revision: 1.8.34.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SD_SLIDE_VIEW_HXX
32 #define SD_SLIDE_VIEW_HXX
46 // ----------------------
47 // - SlideViewFocusMove -
48 // ----------------------
50 enum SlideViewFocusMove
52 SLIDEVIEWFOCUSMOVE_NONE
= 0,
53 SLIDEVIEWFOCUSMOVE_TOGGLE
= 1,
54 SLIDEVIEWFOCUSMOVE_SELECT
= 2,
55 SLIDEVIEWFOCUSMOVE_LEFT
= 3,
56 SLIDEVIEWFOCUSMOVE_TOP
= 4,
57 SLIDEVIEWFOCUSMOVE_RIGHT
= 5,
58 SLIDEVIEWFOCUSMOVE_BOTTOM
= 6
74 SlideViewShell
* pSlideVShell
);
75 virtual ~SlideView (void);
77 void Select( USHORT nSdPageNum
, BOOL bSelect
);
78 void SelectAllSlides( BOOL bSelect
);
80 void MoveFocus( SlideViewFocusMove eMove
);
81 USHORT
GetFocusPage() const;
82 BOOL
HasFocus() const;
84 USHORT
ChangePagesPerRow( USHORT nNum
);
85 USHORT
GetPagesPerRow() const { return nPagesPerRow
; }
87 virtual void InvalidateOneWin( ::Window
& rWin
);
88 virtual void InvalidateOneWin( ::Window
& rWin
, const Rectangle
& rRect
);
90 void SetAllowInvalidate( BOOL bFlag
);
91 BOOL
IsInvalidateAllowed() const;
93 void Paint(const Rectangle
& rRect
, OutputDevice
* pOut
);
94 void DrawSelectionRect(USHORT nPage
);
96 Point
CalcPagePos( USHORT nPageNo
) const;
97 Rectangle
GetPageArea( USHORT nPageNo
) const;
98 ULONG
GetPageGap() const;
99 Rectangle
GetFadeIconArea( USHORT nPageNo
) const;
100 SdPage
* GetHitPage( const Point
& rPos
) const;
101 SdPage
* GetFadePage( const Point
& rPos
) const;
102 SdPage
* GetNearestPage( const Point
& rPos
) const;
105 void MoveMarked( USHORT nTargetPage
);
107 void AddToCache( SdPage
* pPage
, const Bitmap
& rBitmap
, long nZoom
);
108 const GraphicObject
* GetFromCache( SdPage
* pPage
, long& rZoom
, long nZoomTolerance
) const;
110 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
112 virtual void DoCut( ::Window
* pWindow
= NULL
);
113 virtual void DoCopy( ::Window
* pWindow
= NULL
);
114 virtual void DoPaste( ::Window
* pWindow
= NULL
);
116 virtual void StartDrag( const Point
& rDragPt
, ::Window
* pWindow
);
117 virtual void DragFinished( sal_Int8 nDropAction
);
119 virtual sal_Int8
AcceptDrop( const AcceptDropEvent
& rEvt
, DropTargetHelper
& rTargetHelper
,
120 ::sd::Window
* pTargetWindow
= NULL
,
121 USHORT nPage
= SDRPAGE_NOTFOUND
,
122 USHORT nLayer
= SDRPAGE_NOTFOUND
);
123 virtual sal_Int8
ExecuteDrop( const ExecuteDropEvent
& rEvt
, DropTargetHelper
& rTargetHelper
,
124 ::sd::Window
* pTargetWindow
= NULL
,
125 USHORT nPage
= SDRPAGE_NOTFOUND
,
126 USHORT nLayer
= SDRPAGE_NOTFOUND
);
128 void UpdateAllPages();
131 Timer aDelayedPaintTimer
;
133 SlideViewShell
* pSlideViewShell
;
136 VirtualDevice
* mpVDev
;
137 USHORT nAllowInvalidateSmph
;
141 BOOL bInDelayedPaint
;
143 DECL_LINK( PaintDelayed
, Timer
* );
144 void CreateSlideTransferable (::Window
* pWindow
, BOOL bDrag
);
147 } // end of namespace sd