CWS-TOOLING: integrate CWS os150
[LibreOffice.git] / sd / source / ui / inc / SlideView.hxx
blob70427f5b79ced669a0a59d875d78539a3f0e336c
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
31 #include "View.hxx"
33 class SdDrawDocument;
34 class BitmapCache;
35 class SdPage;
37 namespace sd {
39 class SlideViewShell;
40 class Window;
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
57 // ---------------
58 // - SdSlideView -
59 // ---------------
61 class SlideView
62 : public ::sd::View
64 public:
65 TYPEINFO();
67 SlideView (
68 SdDrawDocument* pDoc,
69 ::Window* pWindow,
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;
100 void DeleteMarked();
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();
126 private:
127 Timer aDelayedPaintTimer;
128 List aDelayedPaints;
129 SlideViewShell* pSlideViewShell;
130 BitmapCache* pCache;
131 VirtualDevice* mpVDev;
132 sal_uInt16 nAllowInvalidateSmph;
133 sal_uInt16 nPagesPerRow;
134 sal_uInt16 nFocusPage;
135 sal_Bool bInPaint;
136 sal_Bool bInDelayedPaint;
138 DECL_LINK( PaintDelayed, Timer * );
139 void CreateSlideTransferable (::Window* pWindow, sal_Bool bDrag);
142 } // end of namespace sd
144 #endif