1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef SD_SLIDE_VIEW_HXX
29 #define SD_SLIDE_VIEW_HXX
42 // ----------------------
43 // - SlideViewFocusMove -
44 // ----------------------
46 enum SlideViewFocusMove
48 SLIDEVIEWFOCUSMOVE_NONE
= 0,
49 SLIDEVIEWFOCUSMOVE_TOGGLE
= 1,
50 SLIDEVIEWFOCUSMOVE_SELECT
= 2,
51 SLIDEVIEWFOCUSMOVE_LEFT
= 3,
52 SLIDEVIEWFOCUSMOVE_TOP
= 4,
53 SLIDEVIEWFOCUSMOVE_RIGHT
= 5,
54 SLIDEVIEWFOCUSMOVE_BOTTOM
= 6
70 SlideViewShell
* pSlideVShell
);
71 virtual ~SlideView (void);
73 void Select( sal_uInt16 nSdPageNum
, sal_Bool bSelect
);
74 void SelectAllSlides( sal_Bool bSelect
);
76 void MoveFocus( SlideViewFocusMove eMove
);
77 sal_uInt16
GetFocusPage() const;
78 sal_Bool
HasFocus() const;
80 sal_uInt16
ChangePagesPerRow( sal_uInt16 nNum
);
81 sal_uInt16
GetPagesPerRow() const { return nPagesPerRow
; }
83 virtual void InvalidateOneWin( ::Window
& rWin
);
84 virtual void InvalidateOneWin( ::Window
& rWin
, const Rectangle
& rRect
);
86 void SetAllowInvalidate( sal_Bool bFlag
);
87 sal_Bool
IsInvalidateAllowed() const;
89 void Paint(const Rectangle
& rRect
, OutputDevice
* pOut
);
90 void DrawSelectionRect(sal_uInt16 nPage
);
92 Point
CalcPagePos( sal_uInt16 nPageNo
) const;
93 Rectangle
GetPageArea( sal_uInt16 nPageNo
) const;
94 sal_uLong
GetPageGap() const;
95 Rectangle
GetFadeIconArea( sal_uInt16 nPageNo
) const;
96 SdPage
* GetHitPage( const Point
& rPos
) const;
97 SdPage
* GetFadePage( const Point
& rPos
) const;
98 SdPage
* GetNearestPage( const Point
& rPos
) const;
101 void MoveMarked( sal_uInt16 nTargetPage
);
103 void AddToCache( SdPage
* pPage
, const Bitmap
& rBitmap
, long nZoom
);
104 const GraphicObject
* GetFromCache( SdPage
* pPage
, long& rZoom
, long nZoomTolerance
) const;
106 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
108 virtual void DoCut( ::Window
* pWindow
= NULL
);
109 virtual void DoCopy( ::Window
* pWindow
= NULL
);
110 virtual void DoPaste( ::Window
* pWindow
= NULL
);
112 virtual void StartDrag( const Point
& rDragPt
, ::Window
* pWindow
);
113 virtual void DragFinished( sal_Int8 nDropAction
);
115 virtual sal_Int8
AcceptDrop( const AcceptDropEvent
& rEvt
, DropTargetHelper
& rTargetHelper
,
116 ::sd::Window
* pTargetWindow
= NULL
,
117 sal_uInt16 nPage
= SDRPAGE_NOTFOUND
,
118 sal_uInt16 nLayer
= SDRPAGE_NOTFOUND
);
119 virtual sal_Int8
ExecuteDrop( const ExecuteDropEvent
& rEvt
, DropTargetHelper
& rTargetHelper
,
120 ::sd::Window
* pTargetWindow
= NULL
,
121 sal_uInt16 nPage
= SDRPAGE_NOTFOUND
,
122 sal_uInt16 nLayer
= SDRPAGE_NOTFOUND
);
124 void UpdateAllPages();
127 Timer aDelayedPaintTimer
;
129 SlideViewShell
* pSlideViewShell
;
131 VirtualDevice
* mpVDev
;
132 sal_uInt16 nAllowInvalidateSmph
;
133 sal_uInt16 nPagesPerRow
;
134 sal_uInt16 nFocusPage
;
136 sal_Bool bInDelayedPaint
;
138 DECL_LINK( PaintDelayed
, Timer
* );
139 void CreateSlideTransferable (::Window
* pWindow
, sal_Bool bDrag
);
142 } // end of namespace sd