xref: /aoo41x/main/sd/source/ui/inc/SlideView.hxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #ifndef SD_SLIDE_VIEW_HXX
29*cdf0e10cSrcweir #define SD_SLIDE_VIEW_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include "View.hxx"
32*cdf0e10cSrcweir 
33*cdf0e10cSrcweir class SdDrawDocument;
34*cdf0e10cSrcweir class BitmapCache;
35*cdf0e10cSrcweir class SdPage;
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir namespace sd {
38*cdf0e10cSrcweir 
39*cdf0e10cSrcweir class SlideViewShell;
40*cdf0e10cSrcweir class Window;
41*cdf0e10cSrcweir 
42*cdf0e10cSrcweir // ----------------------
43*cdf0e10cSrcweir // - SlideViewFocusMove -
44*cdf0e10cSrcweir // ----------------------
45*cdf0e10cSrcweir 
46*cdf0e10cSrcweir enum SlideViewFocusMove
47*cdf0e10cSrcweir {
48*cdf0e10cSrcweir     SLIDEVIEWFOCUSMOVE_NONE = 0,
49*cdf0e10cSrcweir     SLIDEVIEWFOCUSMOVE_TOGGLE = 1,
50*cdf0e10cSrcweir     SLIDEVIEWFOCUSMOVE_SELECT = 2,
51*cdf0e10cSrcweir     SLIDEVIEWFOCUSMOVE_LEFT = 3,
52*cdf0e10cSrcweir     SLIDEVIEWFOCUSMOVE_TOP = 4,
53*cdf0e10cSrcweir     SLIDEVIEWFOCUSMOVE_RIGHT = 5,
54*cdf0e10cSrcweir     SLIDEVIEWFOCUSMOVE_BOTTOM = 6
55*cdf0e10cSrcweir };
56*cdf0e10cSrcweir 
57*cdf0e10cSrcweir // ---------------
58*cdf0e10cSrcweir // - SdSlideView -
59*cdf0e10cSrcweir // ---------------
60*cdf0e10cSrcweir 
61*cdf0e10cSrcweir class SlideView
62*cdf0e10cSrcweir     : public ::sd::View
63*cdf0e10cSrcweir {
64*cdf0e10cSrcweir public:
65*cdf0e10cSrcweir     TYPEINFO();
66*cdf0e10cSrcweir 
67*cdf0e10cSrcweir     SlideView (
68*cdf0e10cSrcweir         SdDrawDocument* pDoc,
69*cdf0e10cSrcweir         ::Window* pWindow,
70*cdf0e10cSrcweir         SlideViewShell* pSlideVShell);
71*cdf0e10cSrcweir     virtual ~SlideView (void);
72*cdf0e10cSrcweir 
73*cdf0e10cSrcweir     void                Select( sal_uInt16 nSdPageNum, sal_Bool bSelect );
74*cdf0e10cSrcweir     void                SelectAllSlides( sal_Bool bSelect );
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir     void                MoveFocus( SlideViewFocusMove eMove );
77*cdf0e10cSrcweir     sal_uInt16              GetFocusPage() const;
78*cdf0e10cSrcweir     sal_Bool                HasFocus() const;
79*cdf0e10cSrcweir 
80*cdf0e10cSrcweir 	sal_uInt16              ChangePagesPerRow( sal_uInt16 nNum );
81*cdf0e10cSrcweir 	sal_uInt16              GetPagesPerRow() const { return nPagesPerRow; }
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir 	virtual void        InvalidateOneWin( ::Window& rWin );
84*cdf0e10cSrcweir 	virtual void        InvalidateOneWin( ::Window& rWin, const Rectangle& rRect );
85*cdf0e10cSrcweir 
86*cdf0e10cSrcweir 	void                SetAllowInvalidate( sal_Bool bFlag );
87*cdf0e10cSrcweir 	sal_Bool                IsInvalidateAllowed() const;
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir 	void                Paint(const Rectangle& rRect, OutputDevice* pOut);
90*cdf0e10cSrcweir 	void                DrawSelectionRect(sal_uInt16 nPage);
91*cdf0e10cSrcweir 
92*cdf0e10cSrcweir 	Point	            CalcPagePos( sal_uInt16 nPageNo ) const;
93*cdf0e10cSrcweir 	Rectangle           GetPageArea( sal_uInt16 nPageNo ) const;
94*cdf0e10cSrcweir 	sal_uLong	            GetPageGap() const;
95*cdf0e10cSrcweir 	Rectangle           GetFadeIconArea( sal_uInt16 nPageNo ) const;
96*cdf0e10cSrcweir     SdPage*             GetHitPage( const Point& rPos ) const;
97*cdf0e10cSrcweir     SdPage*             GetFadePage( const Point& rPos ) const;
98*cdf0e10cSrcweir     SdPage*             GetNearestPage( const Point& rPos ) const;
99*cdf0e10cSrcweir 
100*cdf0e10cSrcweir 	void                DeleteMarked();
101*cdf0e10cSrcweir 	void                MoveMarked( sal_uInt16 nTargetPage );
102*cdf0e10cSrcweir 
103*cdf0e10cSrcweir 	void		            AddToCache( SdPage* pPage, const Bitmap& rBitmap, long nZoom );
104*cdf0e10cSrcweir 	const GraphicObject*    GetFromCache( SdPage* pPage, long& rZoom, long nZoomTolerance ) const;
105*cdf0e10cSrcweir 
106*cdf0e10cSrcweir 	virtual void        Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
107*cdf0e10cSrcweir 
108*cdf0e10cSrcweir 	virtual void        DoCut( ::Window* pWindow = NULL );
109*cdf0e10cSrcweir 	virtual void        DoCopy( ::Window* pWindow = NULL );
110*cdf0e10cSrcweir 	virtual void        DoPaste( ::Window* pWindow = NULL );
111*cdf0e10cSrcweir 
112*cdf0e10cSrcweir     virtual void        StartDrag( const Point& rDragPt, ::Window* pWindow );
113*cdf0e10cSrcweir 	virtual void        DragFinished( sal_Int8 nDropAction );
114*cdf0e10cSrcweir 
115*cdf0e10cSrcweir     virtual sal_Int8    AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTargetHelper,
116*cdf0e10cSrcweir                                     ::sd::Window* pTargetWindow = NULL,
117*cdf0e10cSrcweir                                     sal_uInt16 nPage = SDRPAGE_NOTFOUND,
118*cdf0e10cSrcweir                                     sal_uInt16 nLayer = SDRPAGE_NOTFOUND );
119*cdf0e10cSrcweir 	virtual sal_Int8    ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTargetHelper,
120*cdf0e10cSrcweir                                      ::sd::Window* pTargetWindow = NULL,
121*cdf0e10cSrcweir                                      sal_uInt16 nPage = SDRPAGE_NOTFOUND,
122*cdf0e10cSrcweir                                      sal_uInt16 nLayer = SDRPAGE_NOTFOUND );
123*cdf0e10cSrcweir 
124*cdf0e10cSrcweir 	void 	            UpdateAllPages();
125*cdf0e10cSrcweir 
126*cdf0e10cSrcweir private:
127*cdf0e10cSrcweir 	Timer				aDelayedPaintTimer;
128*cdf0e10cSrcweir 	List				aDelayedPaints;
129*cdf0e10cSrcweir 	SlideViewShell*		pSlideViewShell;
130*cdf0e10cSrcweir 	BitmapCache*		pCache;
131*cdf0e10cSrcweir 	VirtualDevice*		mpVDev;
132*cdf0e10cSrcweir 	sal_uInt16				nAllowInvalidateSmph;
133*cdf0e10cSrcweir 	sal_uInt16				nPagesPerRow;
134*cdf0e10cSrcweir     sal_uInt16              nFocusPage;
135*cdf0e10cSrcweir 	sal_Bool				bInPaint;
136*cdf0e10cSrcweir 	sal_Bool				bInDelayedPaint;
137*cdf0e10cSrcweir 
138*cdf0e10cSrcweir 	                    DECL_LINK( PaintDelayed, Timer * );
139*cdf0e10cSrcweir     void CreateSlideTransferable (::Window* pWindow, sal_Bool bDrag);
140*cdf0e10cSrcweir };
141*cdf0e10cSrcweir 
142*cdf0e10cSrcweir } // end of namespace sd
143*cdf0e10cSrcweir 
144*cdf0e10cSrcweir #endif
145