xref: /AOO41X/main/sd/source/ui/inc/DrawViewShell.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
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_DRAW_VIEW_SHELL_HXX
29*cdf0e10cSrcweir #define SD_DRAW_VIEW_SHELL_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include "ViewShell.hxx"
32*cdf0e10cSrcweir #include "tools/AsynchronousCall.hxx"
33*cdf0e10cSrcweir #include <sfx2/viewfac.hxx>
34*cdf0e10cSrcweir #include <sfx2/viewsh.hxx>
35*cdf0e10cSrcweir #include "TabControl.hxx"
36*cdf0e10cSrcweir #include "pres.hxx"
37*cdf0e10cSrcweir #include <com/sun/star/lang/XEventListener.hpp>
38*cdf0e10cSrcweir #include <com/sun/star/scanner/XScannerManager.hpp>
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir class SdPage;
41*cdf0e10cSrcweir class DrawDocShell;
42*cdf0e10cSrcweir class SdAnimationWin;
43*cdf0e10cSrcweir class SdRuler;
44*cdf0e10cSrcweir class TabBar;
45*cdf0e10cSrcweir class SdrObject;
46*cdf0e10cSrcweir class SdrPageView;
47*cdf0e10cSrcweir class TransferableDataHelper;
48*cdf0e10cSrcweir class TransferableClipboardListener;
49*cdf0e10cSrcweir class AbstractSvxNameDialog;
50*cdf0e10cSrcweir class SdrLayer;
51*cdf0e10cSrcweir class SvxClipboardFmtItem;
52*cdf0e10cSrcweir 
53*cdf0e10cSrcweir namespace sd {
54*cdf0e10cSrcweir 
55*cdf0e10cSrcweir class DrawView;
56*cdf0e10cSrcweir class LayerTabBar;
57*cdf0e10cSrcweir class Ruler;
58*cdf0e10cSrcweir class SdUnoDrawView;
59*cdf0e10cSrcweir class AnnotationManager;
60*cdf0e10cSrcweir class ViewOverlayManager;
61*cdf0e10cSrcweir 
62*cdf0e10cSrcweir #define CHECK_RANGE(nMin, nValue, nMax) ((nValue >= nMin) && (nValue <= nMax))
63*cdf0e10cSrcweir 
64*cdf0e10cSrcweir /** Base class of the stacked shells that provide graphical views to
65*cdf0e10cSrcweir     Draw and Impress documents and editing functionality.  In contrast
66*cdf0e10cSrcweir     to this other stacked shells are responsible for showing an
67*cdf0e10cSrcweir     overview over several slides (SlideViewShell) or a textual
68*cdf0e10cSrcweir     overview over the text in an Impress document (OutlineViewShell).
69*cdf0e10cSrcweir */
70*cdf0e10cSrcweir class DrawViewShell
71*cdf0e10cSrcweir     : public ViewShell,
72*cdf0e10cSrcweir       public SfxListener
73*cdf0e10cSrcweir {
74*cdf0e10cSrcweir public:
75*cdf0e10cSrcweir     static const int SLOTARRAY_COUNT = 24;
76*cdf0e10cSrcweir 
77*cdf0e10cSrcweir     TYPEINFO();
78*cdf0e10cSrcweir 
79*cdf0e10cSrcweir     SFX_DECL_INTERFACE(SD_IF_SDDRAWVIEWSHELL)
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir     /** Create a new stackable shell that may take some information
82*cdf0e10cSrcweir         (e.g. the frame view) from the given previous shell.
83*cdf0e10cSrcweir         @param ePageKind
84*cdf0e10cSrcweir             This parameter gives the initial page kind that the new shell
85*cdf0e10cSrcweir             will show.
86*cdf0e10cSrcweir         @param pFrameView
87*cdf0e10cSrcweir             The frame view that makes it possible to pass information from
88*cdf0e10cSrcweir             one view shell to the next.
89*cdf0e10cSrcweir     */
90*cdf0e10cSrcweir     DrawViewShell (
91*cdf0e10cSrcweir         SfxViewFrame* pFrame,
92*cdf0e10cSrcweir         ViewShellBase& rViewShellBase,
93*cdf0e10cSrcweir         ::Window* pParentWindow,
94*cdf0e10cSrcweir         PageKind ePageKind = PK_STANDARD,
95*cdf0e10cSrcweir         FrameView* pFrameView = NULL);
96*cdf0e10cSrcweir 
97*cdf0e10cSrcweir     virtual ~DrawViewShell (void);
98*cdf0e10cSrcweir 
99*cdf0e10cSrcweir     virtual void Init (bool bIsMainViewShell);
100*cdf0e10cSrcweir 
101*cdf0e10cSrcweir     virtual void Shutdown (void);
102*cdf0e10cSrcweir 
103*cdf0e10cSrcweir     void PrePaint();
104*cdf0e10cSrcweir     virtual void Paint(const Rectangle& rRect, ::sd::Window* pWin);
105*cdf0e10cSrcweir 
106*cdf0e10cSrcweir     /** Set the position and size of the area which contains the GUI
107*cdf0e10cSrcweir         elements like rulers, sliders, and buttons as well as the document
108*cdf0e10cSrcweir         view.  Both size and position are expected to be in pixel
109*cdf0e10cSrcweir         coordinates.  The positions and sizes of the mentioned GUI elements
110*cdf0e10cSrcweir         are updated as well.
111*cdf0e10cSrcweir 
112*cdf0e10cSrcweir         <p> This method is implemented by first setting copying the given
113*cdf0e10cSrcweir         values to internal variables and then calling the
114*cdf0e10cSrcweir         <type>ArrangeGUIElements</type> method which performs the actual
115*cdf0e10cSrcweir         work of sizeing and arranging the UI elements accordingly.</p>
116*cdf0e10cSrcweir         @param rPos
117*cdf0e10cSrcweir             The position of the enclosing window relative to the document
118*cdf0e10cSrcweir             window.  This is only interesting if a Draw/Impress document
119*cdf0e10cSrcweir             view is embedded as OLE object into another document view.  For
120*cdf0e10cSrcweir             normal documents this position is (0,0).
121*cdf0e10cSrcweir         @param rSize
122*cdf0e10cSrcweir             The new size in pixel.
123*cdf0e10cSrcweir     */
124*cdf0e10cSrcweir     //	virtual void	AdjustPosSizePixel(const Point &rPos, const Size &rSize);
125*cdf0e10cSrcweir 
126*cdf0e10cSrcweir     /** Arrange and resize the GUI elements like rulers, sliders, and
127*cdf0e10cSrcweir         buttons as well as the actual document view according to the size of
128*cdf0e10cSrcweir         the enclosing window and current sizes of buttons, rulers, and
129*cdf0e10cSrcweir         sliders.
130*cdf0e10cSrcweir     */
131*cdf0e10cSrcweir     virtual void ArrangeGUIElements (void);
132*cdf0e10cSrcweir 
133*cdf0e10cSrcweir     void 	        HidePage();
134*cdf0e10cSrcweir 
135*cdf0e10cSrcweir 	virtual sal_Bool    KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin);
136*cdf0e10cSrcweir 	virtual void    MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin);
137*cdf0e10cSrcweir 	virtual void    MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin);
138*cdf0e10cSrcweir 	virtual void    MouseButtonDown(const MouseEvent& rMEvt, ::sd::Window* pWin);
139*cdf0e10cSrcweir 	virtual void    Command(const CommandEvent& rCEvt, ::sd::Window* pWin);
140*cdf0e10cSrcweir 
141*cdf0e10cSrcweir 	virtual void Resize (void);
142*cdf0e10cSrcweir 
143*cdf0e10cSrcweir 	void            ShowMousePosInfo(const Rectangle& rRect, ::sd::Window* pWin);
144*cdf0e10cSrcweir 
145*cdf0e10cSrcweir 	virtual void    AddWindow(::sd::Window* pWin);
146*cdf0e10cSrcweir 	virtual void    RemoveWindow(::sd::Window* pWin);
147*cdf0e10cSrcweir 
148*cdf0e10cSrcweir 	virtual void ChangeEditMode (EditMode eMode, bool bIsLayerModeActive);
149*cdf0e10cSrcweir 
150*cdf0e10cSrcweir 	virtual void    SetZoom( long nZoom );
151*cdf0e10cSrcweir 	virtual void    SetZoomRect( const Rectangle& rZoomRect );
152*cdf0e10cSrcweir 
153*cdf0e10cSrcweir 	void	        InsertURLField(const String& rURL, const String& rText, const String& rTarget,
154*cdf0e10cSrcweir 			        			   const Point* pPos);
155*cdf0e10cSrcweir 	void	        InsertURLButton(const String& rURL, const String& rText, const String& rTarget,
156*cdf0e10cSrcweir 			        				const Point* pPos);
157*cdf0e10cSrcweir 
158*cdf0e10cSrcweir 	virtual void    SetUIUnit(FieldUnit eUnit);
159*cdf0e10cSrcweir 
160*cdf0e10cSrcweir 	void		    SelectionHasChanged();
161*cdf0e10cSrcweir 	void		    ModelHasChanged();
162*cdf0e10cSrcweir 	virtual void    Activate(sal_Bool bIsMDIActivate);
163*cdf0e10cSrcweir 	virtual void    Deactivate(sal_Bool IsMDIActivate);
164*cdf0e10cSrcweir     virtual void    UIActivating( SfxInPlaceClient* );
165*cdf0e10cSrcweir     virtual void    UIDeactivated( SfxInPlaceClient* );
166*cdf0e10cSrcweir 	virtual String	GetSelectionText( sal_Bool bCompleteWords = sal_False );
167*cdf0e10cSrcweir 	virtual sal_Bool    HasSelection( sal_Bool bText = sal_True ) const;
168*cdf0e10cSrcweir 
169*cdf0e10cSrcweir 	void	        ExecCtrl(SfxRequest& rReq);
170*cdf0e10cSrcweir 	void	        GetCtrlState(SfxItemSet& rSet);
171*cdf0e10cSrcweir 	void	        GetMenuState(SfxItemSet& rSet);
172*cdf0e10cSrcweir 	void	        GetTableMenuState(SfxItemSet& rSet);
173*cdf0e10cSrcweir     /** Set the items of the given item set that are related to
174*cdf0e10cSrcweir         switching the editing mode to the correct values.
175*cdf0e10cSrcweir         <p>This function also sets the states of the mode buttons
176*cdf0e10cSrcweir         (those at the upper right corner) accordingly.</p>
177*cdf0e10cSrcweir     */
178*cdf0e10cSrcweir     void GetModeSwitchingMenuState (SfxItemSet &rSet);
179*cdf0e10cSrcweir 	void	        GetAttrState(SfxItemSet& rSet);
180*cdf0e10cSrcweir 	void	        GetSnapItemState(SfxItemSet& rSet);
181*cdf0e10cSrcweir 
182*cdf0e10cSrcweir 	void	        GetState (SfxItemSet& rSet);
183*cdf0e10cSrcweir     void            Execute (SfxRequest& rReq);
184*cdf0e10cSrcweir 
185*cdf0e10cSrcweir 	void	        ExecStatusBar(SfxRequest& rReq);
186*cdf0e10cSrcweir 	void	        GetStatusBarState(SfxItemSet& rSet);
187*cdf0e10cSrcweir 
188*cdf0e10cSrcweir 	void	        ExecOptionsBar(SfxRequest& rReq);
189*cdf0e10cSrcweir 	void	        GetOptionsBarState(SfxItemSet& rSet);
190*cdf0e10cSrcweir 
191*cdf0e10cSrcweir 	void	        ExecRuler(SfxRequest& rReq);
192*cdf0e10cSrcweir 	void	        GetRulerState(SfxItemSet& rSet);
193*cdf0e10cSrcweir 
194*cdf0e10cSrcweir 	void	        ExecFormText(SfxRequest& rReq);
195*cdf0e10cSrcweir 	void	        GetFormTextState(SfxItemSet& rSet);
196*cdf0e10cSrcweir 
197*cdf0e10cSrcweir 	void	        ExecAnimationWin(SfxRequest& rReq);
198*cdf0e10cSrcweir 	void	        GetAnimationWinState(SfxItemSet& rSet);
199*cdf0e10cSrcweir 
200*cdf0e10cSrcweir 	void	        ExecNavigatorWin(SfxRequest& rReq);
201*cdf0e10cSrcweir 	void	        GetNavigatorWinState(SfxItemSet& rSet);
202*cdf0e10cSrcweir 
203*cdf0e10cSrcweir 	void	        ExecEffectWin(SfxRequest& rReq);
204*cdf0e10cSrcweir 
205*cdf0e10cSrcweir 	void	        Update3DWindow();
206*cdf0e10cSrcweir 	void	        AssignFrom3DWindow();
207*cdf0e10cSrcweir 
208*cdf0e10cSrcweir 	void	        ExecGallery(SfxRequest& rReq);
209*cdf0e10cSrcweir 	void	        GetGalleryState(SfxItemSet& rSet);
210*cdf0e10cSrcweir 
211*cdf0e10cSrcweir 	void	        ExecBmpMask( SfxRequest& rReq );
212*cdf0e10cSrcweir 	void	        GetBmpMaskState( SfxItemSet& rSet );
213*cdf0e10cSrcweir 
214*cdf0e10cSrcweir 	void	        ExecIMap( SfxRequest& rReq );
215*cdf0e10cSrcweir 	void	        GetIMapState( SfxItemSet& rSet );
216*cdf0e10cSrcweir 
217*cdf0e10cSrcweir 	void	        FuTemporary(SfxRequest& rReq);
218*cdf0e10cSrcweir 	void	        FuPermanent(SfxRequest& rReq);
219*cdf0e10cSrcweir 	void	        FuSupport(SfxRequest& rReq);
220*cdf0e10cSrcweir 	void	        FuTable(SfxRequest& rReq);
221*cdf0e10cSrcweir 
222*cdf0e10cSrcweir 	void	        AttrExec (SfxRequest& rReq);
223*cdf0e10cSrcweir 	void	        AttrState (SfxItemSet& rSet);
224*cdf0e10cSrcweir 
225*cdf0e10cSrcweir     void            ExecuteAnnotation (SfxRequest& rRequest);
226*cdf0e10cSrcweir     void            GetAnnotationState (SfxItemSet& rItemSet);
227*cdf0e10cSrcweir 
228*cdf0e10cSrcweir     void StartRulerDrag (
229*cdf0e10cSrcweir         const Ruler& rRuler,
230*cdf0e10cSrcweir         const MouseEvent& rMEvt);
231*cdf0e10cSrcweir 
232*cdf0e10cSrcweir 	virtual sal_uInt16  PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
233*cdf0e10cSrcweir 
234*cdf0e10cSrcweir 	PageKind	    GetPageKind() { return mePageKind; }
235*cdf0e10cSrcweir 
236*cdf0e10cSrcweir 	Point		    GetMousePos() { return maMousePos; }
237*cdf0e10cSrcweir 	sal_Bool 		    IsMousePosFreezed() { return mbMousePosFreezed; }
238*cdf0e10cSrcweir 	void 		    SetMousePosFreezed( sal_Bool bIn ) { mbMousePosFreezed = bIn; }
239*cdf0e10cSrcweir 
240*cdf0e10cSrcweir 	EditMode	    GetEditMode() const { return meEditMode; }
241*cdf0e10cSrcweir 	virtual SdPage*	GetActualPage() { return mpActualPage; }
242*cdf0e10cSrcweir 
243*cdf0e10cSrcweir 	/// inherited from sd::ViewShell
244*cdf0e10cSrcweir 	virtual SdPage* getCurrentPage() const;
245*cdf0e10cSrcweir 
246*cdf0e10cSrcweir 	void		    ResetActualPage();
247*cdf0e10cSrcweir 	void		    ResetActualLayer();
248*cdf0e10cSrcweir 	sal_Bool		    SwitchPage(sal_uInt16 nPage);
249*cdf0e10cSrcweir 	sal_Bool		    IsSwitchPageAllowed() const;
250*cdf0e10cSrcweir 
251*cdf0e10cSrcweir 	sal_Bool		    GotoBookmark(const String& rBookmark);
252*cdf0e10cSrcweir 	void            MakeVisible(const Rectangle& rRect, ::Window& rWin);
253*cdf0e10cSrcweir 
254*cdf0e10cSrcweir 	virtual void    ReadFrameViewData(FrameView* pView);
255*cdf0e10cSrcweir 	virtual void    WriteFrameViewData();
256*cdf0e10cSrcweir 
257*cdf0e10cSrcweir 	virtual ErrCode DoVerb(long nVerb);
258*cdf0e10cSrcweir 	virtual sal_Bool    ActivateObject(SdrOle2Obj* pObj, long nVerb);
259*cdf0e10cSrcweir 
260*cdf0e10cSrcweir 	void		    SetZoomOnPage( sal_Bool bZoom = sal_True ) { mbZoomOnPage = bZoom; }
261*cdf0e10cSrcweir 	sal_Bool		    IsZoomOnPage() { return mbZoomOnPage; }
262*cdf0e10cSrcweir 	void		    CheckLineTo (SfxRequest& rReq);
263*cdf0e10cSrcweir 	void		    FuTemp01(SfxRequest& rReq);
264*cdf0e10cSrcweir 	void		    FuTemp02(SfxRequest& rReq);
265*cdf0e10cSrcweir 	void		    FuTemp03(SfxRequest& rReq);
266*cdf0e10cSrcweir 	void		    FuTemp04(SfxRequest& rReq);
267*cdf0e10cSrcweir 	void		    SetChildWindowState( SfxItemSet& rSet );
268*cdf0e10cSrcweir 
269*cdf0e10cSrcweir 	void		    UpdateIMapDlg( SdrObject* pObj );
270*cdf0e10cSrcweir 
271*cdf0e10cSrcweir 	void		    LockInput();
272*cdf0e10cSrcweir 	void		    UnlockInput();
273*cdf0e10cSrcweir 	sal_Bool		    IsInputLocked() const { return mnLockCount > 0UL; }
274*cdf0e10cSrcweir 
275*cdf0e10cSrcweir 	sal_uInt16		    GetCurPageId() { return( maTabControl.GetCurPageId() ); }
276*cdf0e10cSrcweir 
277*cdf0e10cSrcweir     /** Show controls of the UI or hide them, depending on the given flag.
278*cdf0e10cSrcweir         Do not call this method directly.  Call the method at ViewShellBase
279*cdf0e10cSrcweir         instead.
280*cdf0e10cSrcweir     */
281*cdf0e10cSrcweir 	virtual void ShowUIControls (bool bVisible = true);
282*cdf0e10cSrcweir 
283*cdf0e10cSrcweir 	void		    ScannerEvent( const ::com::sun::star::lang::EventObject& rEventObject );
284*cdf0e10cSrcweir 
285*cdf0e10cSrcweir 	bool IsLayerModeActive (void) const;
286*cdf0e10cSrcweir 
287*cdf0e10cSrcweir 	sal_uInt16*	    	GetSlotArray() const { return mpSlotArray; }
288*cdf0e10cSrcweir 
289*cdf0e10cSrcweir 	virtual sal_Int8    AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTargetHelper,
290*cdf0e10cSrcweir                                     ::sd::Window* pTargetWindow, sal_uInt16 nPage, sal_uInt16 nLayer );
291*cdf0e10cSrcweir 	virtual sal_Int8    ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTargetHelper,
292*cdf0e10cSrcweir                                     ::sd::Window* pTargetWindow, sal_uInt16 nPage, sal_uInt16 nLayer );
293*cdf0e10cSrcweir 
294*cdf0e10cSrcweir     virtual void    WriteUserDataSequence ( ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
295*cdf0e10cSrcweir     virtual void    ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
296*cdf0e10cSrcweir 
297*cdf0e10cSrcweir 	virtual void    VisAreaChanged(const Rectangle& rRect);
298*cdf0e10cSrcweir 
299*cdf0e10cSrcweir     /** Create an accessible object representing the specified window.
300*cdf0e10cSrcweir 	    @param pWindow
301*cdf0e10cSrcweir 	        The returned object makes the document displayed in this window
302*cdf0e10cSrcweir 	        accessible.
303*cdf0e10cSrcweir         @return
304*cdf0e10cSrcweir 	        Returns an <type>AccessibleDrawDocumentView</type> object.
305*cdf0e10cSrcweir    */
306*cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference<
307*cdf0e10cSrcweir         ::com::sun::star::accessibility::XAccessible>
308*cdf0e10cSrcweir         CreateAccessibleDocumentView (::sd::Window* pWindow);
309*cdf0e10cSrcweir 
310*cdf0e10cSrcweir     /** Return the number of layers managed by the layer tab control.  This
311*cdf0e10cSrcweir         will usually differ from the number of layers managed by the layer
312*cdf0e10cSrcweir         administrator.
313*cdf0e10cSrcweir         @return
314*cdf0e10cSrcweir             The number of layers managed by the layer tab control.  The
315*cdf0e10cSrcweir             returned value is independent of whether the layer modus is
316*cdf0e10cSrcweir             currently active and the tab control is visible.
317*cdf0e10cSrcweir     */
318*cdf0e10cSrcweir     virtual int GetTabLayerCount (void) const;
319*cdf0e10cSrcweir 
320*cdf0e10cSrcweir     /** Return the numerical id of the currently active layer as seen by the
321*cdf0e10cSrcweir         layer tab control.
322*cdf0e10cSrcweir         @return
323*cdf0e10cSrcweir             The returned id is a number between zero (inclusive) and the
324*cdf0e10cSrcweir             number of layers as returned by the
325*cdf0e10cSrcweir             <member>GetTabLayerCount</member> method (exclusive).
326*cdf0e10cSrcweir     */
327*cdf0e10cSrcweir     virtual int GetActiveTabLayerIndex (void) const;
328*cdf0e10cSrcweir 
329*cdf0e10cSrcweir     /** Set the active layer at the layer tab control and update the control
330*cdf0e10cSrcweir         accordingly to reflect the change on screen.
331*cdf0e10cSrcweir         @param nId
332*cdf0e10cSrcweir             The id is expected to be a number between zero (inclusive) and
333*cdf0e10cSrcweir             the number of layers as returned by the
334*cdf0e10cSrcweir             <member>GetTabLayerCount</member> method (exclusive).  Note that
335*cdf0e10cSrcweir             Invalid values are ignored.  No excpetion is thrown in that case.
336*cdf0e10cSrcweir     */
337*cdf0e10cSrcweir     virtual void SetActiveTabLayerIndex (int nId);
338*cdf0e10cSrcweir 
339*cdf0e10cSrcweir     /** Return a pointer to the tab control for pages.
340*cdf0e10cSrcweir     */
341*cdf0e10cSrcweir 	TabControl* GetPageTabControl (void);
342*cdf0e10cSrcweir 
343*cdf0e10cSrcweir     /** Return a pointer to the tab control for layers.
344*cdf0e10cSrcweir     */
345*cdf0e10cSrcweir 	LayerTabBar* GetLayerTabControl (void);
346*cdf0e10cSrcweir 
347*cdf0e10cSrcweir     /** Renames the given slide using an SvxNameDialog
348*cdf0e10cSrcweir 
349*cdf0e10cSrcweir         @param nPageId the index of the page in the SdTabControl.
350*cdf0e10cSrcweir         @param rName the new name of the slide.
351*cdf0e10cSrcweir 
352*cdf0e10cSrcweir         @return false, if the new name is invalid for some reason.
353*cdf0e10cSrcweir 
354*cdf0e10cSrcweir         <p>Implemented in <code>drviews8.cxx</code>.</p>
355*cdf0e10cSrcweir      */
356*cdf0e10cSrcweir     bool RenameSlide( sal_uInt16 nPageId, const String & rName );
357*cdf0e10cSrcweir 
358*cdf0e10cSrcweir 	/** modifies the given layer with the given values */
359*cdf0e10cSrcweir 	void ModifyLayer( SdrLayer* pLayer, const String& rLayerName, const String& rLayerTitle, const String& rLayerDesc, bool bIsVisible, bool bIsLocked, bool bIsPrintable );
360*cdf0e10cSrcweir 
361*cdf0e10cSrcweir     virtual css::uno::Reference<css::drawing::XDrawSubController> CreateSubController (void);
362*cdf0e10cSrcweir 
363*cdf0e10cSrcweir 	DrawView*	GetDrawView() const { return mpDrawView; }
364*cdf0e10cSrcweir 
365*cdf0e10cSrcweir     /** Relocation to a new parent window is not supported for DrawViewShell
366*cdf0e10cSrcweir         objects so this method always returns <FALSE/>.
367*cdf0e10cSrcweir     */
368*cdf0e10cSrcweir     virtual bool RelocateToParentWindow (::Window* pParentWindow);
369*cdf0e10cSrcweir 
370*cdf0e10cSrcweir protected:
371*cdf0e10cSrcweir 	DrawView*		mpDrawView;
372*cdf0e10cSrcweir 	SdPage* 		mpActualPage;
373*cdf0e10cSrcweir 	Rectangle		maMarkRect;
374*cdf0e10cSrcweir 	Point			maMousePos;
375*cdf0e10cSrcweir 	sal_Bool			mbMousePosFreezed;
376*cdf0e10cSrcweir 	TabControl		maTabControl;
377*cdf0e10cSrcweir 	EditMode		meEditMode;
378*cdf0e10cSrcweir 	PageKind		mePageKind;
379*cdf0e10cSrcweir 	sal_Bool			mbZoomOnPage;
380*cdf0e10cSrcweir 	sal_Bool			mbIsRulerDrag;
381*cdf0e10cSrcweir 	sal_uLong			mnLockCount;
382*cdf0e10cSrcweir 	Timer			maCloseTimer;
383*cdf0e10cSrcweir 	sal_Bool 			mbReadOnly;
384*cdf0e10cSrcweir 	sal_uInt16*			mpSlotArray;
385*cdf0e10cSrcweir 
386*cdf0e10cSrcweir     static sal_Bool 	mbPipette;
387*cdf0e10cSrcweir 
388*cdf0e10cSrcweir                 	DECL_LINK( ClipboardChanged, TransferableDataHelper* );
389*cdf0e10cSrcweir                 	DECL_LINK( CloseHdl, Timer* pTimer );
390*cdf0e10cSrcweir 	                DECL_LINK( TabSplitHdl, TabBar * );
391*cdf0e10cSrcweir 	                DECL_LINK( NameObjectHdl, AbstractSvxNameDialog* );
392*cdf0e10cSrcweir 	                DECL_LINK( RenameSlideHdl, AbstractSvxNameDialog* );
393*cdf0e10cSrcweir 
394*cdf0e10cSrcweir 	void	        DeleteActualPage();
395*cdf0e10cSrcweir 	void	        DeleteActualLayer();
396*cdf0e10cSrcweir 
397*cdf0e10cSrcweir 	virtual SvxRuler* CreateHRuler(::sd::Window* pWin, sal_Bool bIsFirst);
398*cdf0e10cSrcweir 	virtual SvxRuler* CreateVRuler(::sd::Window* pWin);
399*cdf0e10cSrcweir 	virtual void    UpdateHRuler();
400*cdf0e10cSrcweir 	virtual void    UpdateVRuler();
401*cdf0e10cSrcweir 	virtual long    GetHCtrlWidth();
402*cdf0e10cSrcweir 	virtual void    SetZoomFactor(const Fraction& rZoomX, const Fraction& rZoomY);
403*cdf0e10cSrcweir 	virtual Size    GetOptimalSizePixel() const;
404*cdf0e10cSrcweir 
405*cdf0e10cSrcweir 	void            SetupPage( Size &rSize, long nLeft, long nRight, long nUpper, long nLower,
406*cdf0e10cSrcweir 					           sal_Bool bSize, sal_Bool bMargin, sal_Bool bScaleAll );
407*cdf0e10cSrcweir 
408*cdf0e10cSrcweir 	sal_uInt16	        GetIdBySubId( sal_uInt16 nSId );
409*cdf0e10cSrcweir 	void	        MapSlot( sal_uInt16 nSId );
410*cdf0e10cSrcweir 	void	        UpdateToolboxImages( SfxItemSet &rSet, sal_Bool bPermanent = sal_True );
411*cdf0e10cSrcweir 	sal_uInt16	        GetMappedSlot( sal_uInt16 nSId );
412*cdf0e10cSrcweir 	sal_uInt16	        GetArrayId( sal_uInt16 nSId );
413*cdf0e10cSrcweir 
414*cdf0e10cSrcweir 	void	        GetMenuStateSel(SfxItemSet& rSet);
415*cdf0e10cSrcweir 
416*cdf0e10cSrcweir private:
417*cdf0e10cSrcweir     /** This flag controls whether the layer mode is active, i.e. the layer
418*cdf0e10cSrcweir         dialog is visible.
419*cdf0e10cSrcweir     */
420*cdf0e10cSrcweir 	bool mbIsLayerModeActive;
421*cdf0e10cSrcweir 
422*cdf0e10cSrcweir     /** This item contains the clipboard formats of the current clipboard
423*cdf0e10cSrcweir         content that are supported both by that content and by the
424*cdf0e10cSrcweir         DrawViewShell.
425*cdf0e10cSrcweir     */
426*cdf0e10cSrcweir     ::std::auto_ptr<SvxClipboardFmtItem> mpCurrentClipboardFormats;
427*cdf0e10cSrcweir 
428*cdf0e10cSrcweir     /** On some occasions it is necessary to make SwitchPage calls
429*cdf0e10cSrcweir         asynchronously.
430*cdf0e10cSrcweir     */
431*cdf0e10cSrcweir     tools::AsynchronousCall maAsynchronousSwitchPageCall;
432*cdf0e10cSrcweir 
433*cdf0e10cSrcweir     /** This flag is used to prevent nested calls to SwitchPage().
434*cdf0e10cSrcweir     */
435*cdf0e10cSrcweir     bool mbIsInSwitchPage;
436*cdf0e10cSrcweir 
437*cdf0e10cSrcweir 	void Construct (DrawDocShell* pDocSh, PageKind ePageKind);
438*cdf0e10cSrcweir 
439*cdf0e10cSrcweir     /** Depending on the given request create a new page or duplicate an
440*cdf0e10cSrcweir         existing one.  See ViewShell::CreateOrDuplicatePage() for more
441*cdf0e10cSrcweir         information.
442*cdf0e10cSrcweir     */
443*cdf0e10cSrcweir     virtual SdPage* CreateOrDuplicatePage (
444*cdf0e10cSrcweir         SfxRequest& rRequest,
445*cdf0e10cSrcweir         PageKind ePageKind,
446*cdf0e10cSrcweir         SdPage* pPage,
447*cdf0e10cSrcweir         const sal_Int32 nInsertPosition = -1);
448*cdf0e10cSrcweir 
449*cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::scanner::XScannerManager >	mxScannerManager;
450*cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >		mxScannerListener;
451*cdf0e10cSrcweir 	TransferableClipboardListener*                                                  mpClipEvtLstnr;
452*cdf0e10cSrcweir 	sal_Bool			                                                                mbPastePossible;
453*cdf0e10cSrcweir 
454*cdf0e10cSrcweir 	virtual void Notify (SfxBroadcaster& rBC, const SfxHint& rHint);
455*cdf0e10cSrcweir 
456*cdf0e10cSrcweir     /** Stop a running slide show.  The frame the show is running in is
457*cdf0e10cSrcweir         destroyed if
458*cdf0e10cSrcweir         a) it is running in its own frame, i.e. is a full screen show and
459*cdf0e10cSrcweir         b) the given flag bCloseFrame is true.
460*cdf0e10cSrcweir         @param bCloseFrame
461*cdf0e10cSrcweir             Be carefull with this flag when stopping a full screen show.
462*cdf0e10cSrcweir             When called from the destructor the flag has to be <FALSE/> or
463*cdf0e10cSrcweir             otherwise we run into a loop of calls to destructors of the view
464*cdf0e10cSrcweir             and the frame.
465*cdf0e10cSrcweir             When called from other places the flag should be <TRUE/> so that
466*cdf0e10cSrcweir             not an empty frame remains. When called with <TRUE/> it is the
467*cdf0e10cSrcweir             responsibility of the caller to avoid an illegal reentrant
468*cdf0e10cSrcweir             call.
469*cdf0e10cSrcweir     */
470*cdf0e10cSrcweir     void StopSlideShow (bool bCloseFrame);
471*cdf0e10cSrcweir 
472*cdf0e10cSrcweir     /** Show the context menu for snap lines and points.  Because snap lines
473*cdf0e10cSrcweir         can not be selected the index of the snap line/point for which the
474*cdf0e10cSrcweir         popup menu is opened has to be passed to the processing slot
475*cdf0e10cSrcweir         handlers.  This can be done only by manually showing the popup menu.
476*cdf0e10cSrcweir         @param rPageView
477*cdf0e10cSrcweir             The page view is used to access the help lines.
478*cdf0e10cSrcweir         @param nSnapLineIndex
479*cdf0e10cSrcweir             Index of the snap line or snap point for which to show the
480*cdf0e10cSrcweir             context menu.
481*cdf0e10cSrcweir         @param rMouseLocation
482*cdf0e10cSrcweir             The mouse location defines the location at which to display the
483*cdf0e10cSrcweir             context menu.
484*cdf0e10cSrcweir     */
485*cdf0e10cSrcweir     void ShowSnapLineContextMenu (
486*cdf0e10cSrcweir         SdrPageView& rPageView,
487*cdf0e10cSrcweir         const sal_uInt16 nSnapLineIndex,
488*cdf0e10cSrcweir         const Point& rMouseLocation);
489*cdf0e10cSrcweir 
490*cdf0e10cSrcweir 	using ViewShell::Notify;
491*cdf0e10cSrcweir 
492*cdf0e10cSrcweir 	::std::auto_ptr< AnnotationManager > mpAnnotationManager;
493*cdf0e10cSrcweir 	::std::auto_ptr< ViewOverlayManager > mpViewOverlayManager;
494*cdf0e10cSrcweir };
495*cdf0e10cSrcweir 
496*cdf0e10cSrcweir 
497*cdf0e10cSrcweir } // end of namespace sd
498*cdf0e10cSrcweir 
499*cdf0e10cSrcweir #endif
500