xref: /aoo42x/main/sd/source/ui/inc/SlideView.hxx (revision 67e470da)
1*c45d927aSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*c45d927aSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*c45d927aSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*c45d927aSAndrew Rist  * distributed with this work for additional information
6*c45d927aSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*c45d927aSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*c45d927aSAndrew Rist  * "License"); you may not use this file except in compliance
9*c45d927aSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*c45d927aSAndrew Rist  *
11*c45d927aSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*c45d927aSAndrew Rist  *
13*c45d927aSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*c45d927aSAndrew Rist  * software distributed under the License is distributed on an
15*c45d927aSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*c45d927aSAndrew Rist  * KIND, either express or implied.  See the License for the
17*c45d927aSAndrew Rist  * specific language governing permissions and limitations
18*c45d927aSAndrew Rist  * under the License.
19*c45d927aSAndrew Rist  *
20*c45d927aSAndrew Rist  *************************************************************/
21*c45d927aSAndrew Rist 
22*c45d927aSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SD_SLIDE_VIEW_HXX
25cdf0e10cSrcweir #define SD_SLIDE_VIEW_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "View.hxx"
28cdf0e10cSrcweir 
29cdf0e10cSrcweir class SdDrawDocument;
30cdf0e10cSrcweir class BitmapCache;
31cdf0e10cSrcweir class SdPage;
32cdf0e10cSrcweir 
33cdf0e10cSrcweir namespace sd {
34cdf0e10cSrcweir 
35cdf0e10cSrcweir class SlideViewShell;
36cdf0e10cSrcweir class Window;
37cdf0e10cSrcweir 
38cdf0e10cSrcweir // ----------------------
39cdf0e10cSrcweir // - SlideViewFocusMove -
40cdf0e10cSrcweir // ----------------------
41cdf0e10cSrcweir 
42cdf0e10cSrcweir enum SlideViewFocusMove
43cdf0e10cSrcweir {
44cdf0e10cSrcweir     SLIDEVIEWFOCUSMOVE_NONE = 0,
45cdf0e10cSrcweir     SLIDEVIEWFOCUSMOVE_TOGGLE = 1,
46cdf0e10cSrcweir     SLIDEVIEWFOCUSMOVE_SELECT = 2,
47cdf0e10cSrcweir     SLIDEVIEWFOCUSMOVE_LEFT = 3,
48cdf0e10cSrcweir     SLIDEVIEWFOCUSMOVE_TOP = 4,
49cdf0e10cSrcweir     SLIDEVIEWFOCUSMOVE_RIGHT = 5,
50cdf0e10cSrcweir     SLIDEVIEWFOCUSMOVE_BOTTOM = 6
51cdf0e10cSrcweir };
52cdf0e10cSrcweir 
53cdf0e10cSrcweir // ---------------
54cdf0e10cSrcweir // - SdSlideView -
55cdf0e10cSrcweir // ---------------
56cdf0e10cSrcweir 
57cdf0e10cSrcweir class SlideView
58cdf0e10cSrcweir     : public ::sd::View
59cdf0e10cSrcweir {
60cdf0e10cSrcweir public:
61cdf0e10cSrcweir     TYPEINFO();
62cdf0e10cSrcweir 
63cdf0e10cSrcweir     SlideView (
64cdf0e10cSrcweir         SdDrawDocument* pDoc,
65cdf0e10cSrcweir         ::Window* pWindow,
66cdf0e10cSrcweir         SlideViewShell* pSlideVShell);
67cdf0e10cSrcweir     virtual ~SlideView (void);
68cdf0e10cSrcweir 
69cdf0e10cSrcweir     void                Select( sal_uInt16 nSdPageNum, sal_Bool bSelect );
70cdf0e10cSrcweir     void                SelectAllSlides( sal_Bool bSelect );
71cdf0e10cSrcweir 
72cdf0e10cSrcweir     void                MoveFocus( SlideViewFocusMove eMove );
73cdf0e10cSrcweir     sal_uInt16              GetFocusPage() const;
74cdf0e10cSrcweir     sal_Bool                HasFocus() const;
75cdf0e10cSrcweir 
76cdf0e10cSrcweir 	sal_uInt16              ChangePagesPerRow( sal_uInt16 nNum );
GetPagesPerRow() const77cdf0e10cSrcweir 	sal_uInt16              GetPagesPerRow() const { return nPagesPerRow; }
78cdf0e10cSrcweir 
79cdf0e10cSrcweir 	virtual void        InvalidateOneWin( ::Window& rWin );
80cdf0e10cSrcweir 	virtual void        InvalidateOneWin( ::Window& rWin, const Rectangle& rRect );
81cdf0e10cSrcweir 
82cdf0e10cSrcweir 	void                SetAllowInvalidate( sal_Bool bFlag );
83cdf0e10cSrcweir 	sal_Bool                IsInvalidateAllowed() const;
84cdf0e10cSrcweir 
85cdf0e10cSrcweir 	void                Paint(const Rectangle& rRect, OutputDevice* pOut);
86cdf0e10cSrcweir 	void                DrawSelectionRect(sal_uInt16 nPage);
87cdf0e10cSrcweir 
88cdf0e10cSrcweir 	Point	            CalcPagePos( sal_uInt16 nPageNo ) const;
89cdf0e10cSrcweir 	Rectangle           GetPageArea( sal_uInt16 nPageNo ) const;
90cdf0e10cSrcweir 	sal_uLong	            GetPageGap() const;
91cdf0e10cSrcweir 	Rectangle           GetFadeIconArea( sal_uInt16 nPageNo ) const;
92cdf0e10cSrcweir     SdPage*             GetHitPage( const Point& rPos ) const;
93cdf0e10cSrcweir     SdPage*             GetFadePage( const Point& rPos ) const;
94cdf0e10cSrcweir     SdPage*             GetNearestPage( const Point& rPos ) const;
95cdf0e10cSrcweir 
96cdf0e10cSrcweir 	void                DeleteMarked();
97cdf0e10cSrcweir 	void                MoveMarked( sal_uInt16 nTargetPage );
98cdf0e10cSrcweir 
99cdf0e10cSrcweir 	void		            AddToCache( SdPage* pPage, const Bitmap& rBitmap, long nZoom );
100cdf0e10cSrcweir 	const GraphicObject*    GetFromCache( SdPage* pPage, long& rZoom, long nZoomTolerance ) const;
101cdf0e10cSrcweir 
102cdf0e10cSrcweir 	virtual void        Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
103cdf0e10cSrcweir 
104cdf0e10cSrcweir 	virtual void        DoCut( ::Window* pWindow = NULL );
105cdf0e10cSrcweir 	virtual void        DoCopy( ::Window* pWindow = NULL );
106cdf0e10cSrcweir 	virtual void        DoPaste( ::Window* pWindow = NULL );
107cdf0e10cSrcweir 
108cdf0e10cSrcweir     virtual void        StartDrag( const Point& rDragPt, ::Window* pWindow );
109cdf0e10cSrcweir 	virtual void        DragFinished( sal_Int8 nDropAction );
110cdf0e10cSrcweir 
111cdf0e10cSrcweir     virtual sal_Int8    AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTargetHelper,
112cdf0e10cSrcweir                                     ::sd::Window* pTargetWindow = NULL,
113cdf0e10cSrcweir                                     sal_uInt16 nPage = SDRPAGE_NOTFOUND,
114cdf0e10cSrcweir                                     sal_uInt16 nLayer = SDRPAGE_NOTFOUND );
115cdf0e10cSrcweir 	virtual sal_Int8    ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTargetHelper,
116cdf0e10cSrcweir                                      ::sd::Window* pTargetWindow = NULL,
117cdf0e10cSrcweir                                      sal_uInt16 nPage = SDRPAGE_NOTFOUND,
118cdf0e10cSrcweir                                      sal_uInt16 nLayer = SDRPAGE_NOTFOUND );
119cdf0e10cSrcweir 
120cdf0e10cSrcweir 	void 	            UpdateAllPages();
121cdf0e10cSrcweir 
122cdf0e10cSrcweir private:
123cdf0e10cSrcweir 	Timer				aDelayedPaintTimer;
124cdf0e10cSrcweir 	List				aDelayedPaints;
125cdf0e10cSrcweir 	SlideViewShell*		pSlideViewShell;
126cdf0e10cSrcweir 	BitmapCache*		pCache;
127cdf0e10cSrcweir 	VirtualDevice*		mpVDev;
128cdf0e10cSrcweir 	sal_uInt16				nAllowInvalidateSmph;
129cdf0e10cSrcweir 	sal_uInt16				nPagesPerRow;
130cdf0e10cSrcweir     sal_uInt16              nFocusPage;
131cdf0e10cSrcweir 	sal_Bool				bInPaint;
132cdf0e10cSrcweir 	sal_Bool				bInDelayedPaint;
133cdf0e10cSrcweir 
134cdf0e10cSrcweir 	                    DECL_LINK( PaintDelayed, Timer * );
135cdf0e10cSrcweir     void CreateSlideTransferable (::Window* pWindow, sal_Bool bDrag);
136cdf0e10cSrcweir };
137cdf0e10cSrcweir 
138cdf0e10cSrcweir } // end of namespace sd
139cdf0e10cSrcweir 
140cdf0e10cSrcweir #endif
141