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