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_OUTLINE_VIEW_SHELL_HXX
29*cdf0e10cSrcweir #define SD_OUTLINE_VIEW_SHELL_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include "DrawDocShell.hxx"
32*cdf0e10cSrcweir #include "ViewShell.hxx"
33*cdf0e10cSrcweir #include "OutlineView.hxx"
34*cdf0e10cSrcweir 
35*cdf0e10cSrcweir class SdPage;
36*cdf0e10cSrcweir class TransferableDataHelper;
37*cdf0e10cSrcweir class TransferableClipboardListener;
38*cdf0e10cSrcweir 
39*cdf0e10cSrcweir namespace sd {
40*cdf0e10cSrcweir 
41*cdf0e10cSrcweir class SdUnoOutlineView;
42*cdf0e10cSrcweir 
43*cdf0e10cSrcweir /** Show a textual overview of the text contents of all slides.
44*cdf0e10cSrcweir */
45*cdf0e10cSrcweir class OutlineViewShell
46*cdf0e10cSrcweir     : public ViewShell
47*cdf0e10cSrcweir {
48*cdf0e10cSrcweir public:
49*cdf0e10cSrcweir 	TYPEINFO();
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir 	SFX_DECL_VIEWFACTORY(OutlineViewShell);
52*cdf0e10cSrcweir 	SFX_DECL_INTERFACE(SD_IF_SDOUTLINEVIEWSHELL)
53*cdf0e10cSrcweir 
54*cdf0e10cSrcweir     // The previous macros change access mode.  To be sure switch back
55*cdf0e10cSrcweir     // to public access.
56*cdf0e10cSrcweir public:
57*cdf0e10cSrcweir     /** Create a new view shell for the outline mode.
58*cdf0e10cSrcweir         @param rViewShellBase
59*cdf0e10cSrcweir             The new object will be stacked on this view shell base.
60*cdf0e10cSrcweir         @param pFrameView
61*cdf0e10cSrcweir             The frame view that makes it possible to pass information from
62*cdf0e10cSrcweir             one view shell to the next.
63*cdf0e10cSrcweir     */
64*cdf0e10cSrcweir     OutlineViewShell (
65*cdf0e10cSrcweir         SfxViewFrame* pFrame,
66*cdf0e10cSrcweir         ViewShellBase& rViewShellBase,
67*cdf0e10cSrcweir         ::Window* pParentWindow,
68*cdf0e10cSrcweir         FrameView* pFrameView = NULL);
69*cdf0e10cSrcweir 
70*cdf0e10cSrcweir 	virtual ~OutlineViewShell (void);
71*cdf0e10cSrcweir 
72*cdf0e10cSrcweir     virtual void Shutdown (void);
73*cdf0e10cSrcweir 
74*cdf0e10cSrcweir 	virtual void Paint(const Rectangle& rRect, ::sd::Window* pWin);
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir     /** Arrange and resize the GUI elements like rulers, sliders, and
77*cdf0e10cSrcweir         buttons as well as the actual document view according to the size of
78*cdf0e10cSrcweir         the enclosing window and current sizes of buttons, rulers, and
79*cdf0e10cSrcweir         sliders.
80*cdf0e10cSrcweir     */
81*cdf0e10cSrcweir     virtual void ArrangeGUIElements (void);
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir 	virtual sal_uInt16 PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
84*cdf0e10cSrcweir 
85*cdf0e10cSrcweir 	virtual long VirtHScrollHdl(ScrollBar* pHScroll);
86*cdf0e10cSrcweir 	virtual long VirtVScrollHdl(ScrollBar* pVHScroll);
87*cdf0e10cSrcweir 
88*cdf0e10cSrcweir 	virtual void AddWindow(::sd::Window* pWin);
89*cdf0e10cSrcweir 	virtual void RemoveWindow(::sd::Window* pWin);
90*cdf0e10cSrcweir 
91*cdf0e10cSrcweir 	virtual void Activate( sal_Bool IsMDIActivate );
92*cdf0e10cSrcweir 	virtual void Deactivate( sal_Bool IsMDIActivate );
93*cdf0e10cSrcweir 
94*cdf0e10cSrcweir 	virtual SdPage*	GetActualPage();
95*cdf0e10cSrcweir 
96*cdf0e10cSrcweir 	/// inherited from sd::ViewShell
97*cdf0e10cSrcweir 	virtual SdPage* getCurrentPage() const;
98*cdf0e10cSrcweir 
99*cdf0e10cSrcweir 	void ExecCtrl(SfxRequest &rReq);
100*cdf0e10cSrcweir 	void GetCtrlState(SfxItemSet &rSet);
101*cdf0e10cSrcweir 	void GetMenuState(SfxItemSet &rSet);
102*cdf0e10cSrcweir 	void GetAttrState(SfxItemSet &rSet);
103*cdf0e10cSrcweir     void GetState (SfxItemSet& rSet);
104*cdf0e10cSrcweir 
105*cdf0e10cSrcweir 	void ExecStatusBar(SfxRequest& rReq);
106*cdf0e10cSrcweir 	void GetStatusBarState(SfxItemSet& rSet);
107*cdf0e10cSrcweir 
108*cdf0e10cSrcweir 	void FuTemporary(SfxRequest &rReq);
109*cdf0e10cSrcweir 	void FuTemporaryModify(SfxRequest &rReq);
110*cdf0e10cSrcweir 	void FuPermanent(SfxRequest &rReq);
111*cdf0e10cSrcweir 	void FuSupport(SfxRequest &rReq);
112*cdf0e10cSrcweir 
113*cdf0e10cSrcweir 	virtual void SetZoom(long nZoom);
114*cdf0e10cSrcweir 	virtual void SetZoomRect(const Rectangle& rZoomRect);
115*cdf0e10cSrcweir 	virtual String	GetSelectionText( sal_Bool bCompleteWords = sal_False );
116*cdf0e10cSrcweir 	virtual sal_Bool    HasSelection( sal_Bool bText = sal_True ) const;
117*cdf0e10cSrcweir 
118*cdf0e10cSrcweir 	void Execute(SfxRequest& rReq);
119*cdf0e10cSrcweir 
120*cdf0e10cSrcweir 	virtual void ReadFrameViewData(FrameView* pView);
121*cdf0e10cSrcweir 	virtual void WriteFrameViewData();
122*cdf0e10cSrcweir 
123*cdf0e10cSrcweir 	virtual void Command( const CommandEvent& rCEvt, ::sd::Window* pWin );
124*cdf0e10cSrcweir 	virtual sal_Bool KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin);
125*cdf0e10cSrcweir 	virtual void MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin);
126*cdf0e10cSrcweir 
127*cdf0e10cSrcweir     sal_uLong   Read(SvStream& rInput, const String& rBaseURL, sal_uInt16 eFormat);
128*cdf0e10cSrcweir 
129*cdf0e10cSrcweir     virtual void WriteUserDataSequence ( ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
130*cdf0e10cSrcweir     virtual void ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
131*cdf0e10cSrcweir 
132*cdf0e10cSrcweir 	/** this method is called when the visible area of the view from this viewshell is changed */
133*cdf0e10cSrcweir 	virtual void VisAreaChanged(const Rectangle& rRect);
134*cdf0e10cSrcweir 
135*cdf0e10cSrcweir     /** Create an accessible object representing the specified window.
136*cdf0e10cSrcweir 	    @param pWindow
137*cdf0e10cSrcweir 	        The returned object makes the document displayed in this window
138*cdf0e10cSrcweir 	        accessible.
139*cdf0e10cSrcweir         @return
140*cdf0e10cSrcweir 	        Returns an <type>AccessibleDrawDocumentView</type> object.
141*cdf0e10cSrcweir    */
142*cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference<
143*cdf0e10cSrcweir         ::com::sun::star::accessibility::XAccessible>
144*cdf0e10cSrcweir         CreateAccessibleDocumentView (::sd::Window* pWindow);
145*cdf0e10cSrcweir 
146*cdf0e10cSrcweir     /** Update the preview to show the specified page.
147*cdf0e10cSrcweir     */
148*cdf0e10cSrcweir 	virtual void UpdatePreview (SdPage* pPage, sal_Bool bInit = sal_False);
149*cdf0e10cSrcweir 
150*cdf0e10cSrcweir     virtual css::uno::Reference<css::drawing::XDrawSubController> CreateSubController (void);
151*cdf0e10cSrcweir 
152*cdf0e10cSrcweir     /** Make the given page the new current page.  This method
153*cdf0e10cSrcweir         notifies the controller and adapts the selection of the
154*cdf0e10cSrcweir         model.
155*cdf0e10cSrcweir         @param pPage
156*cdf0e10cSrcweir             The new current page.  Pass NULL when there is no current page.
157*cdf0e10cSrcweir     */
158*cdf0e10cSrcweir     void SetCurrentPage (SdPage* pPage);
159*cdf0e10cSrcweir 
160*cdf0e10cSrcweir 	bool UpdateTitleObject( SdPage* pPage, Paragraph* pPara );
161*cdf0e10cSrcweir 	bool UpdateOutlineObject( SdPage* pPage, Paragraph* pPara );
162*cdf0e10cSrcweir 
163*cdf0e10cSrcweir protected:
164*cdf0e10cSrcweir 	virtual Size GetOptimalSizePixel() const;
165*cdf0e10cSrcweir 
166*cdf0e10cSrcweir private:
167*cdf0e10cSrcweir 	OutlineView* pOlView;
168*cdf0e10cSrcweir 	SdPage*			pLastPage; // Zur performanten Aufbereitung der Preview
169*cdf0e10cSrcweir 	TransferableClipboardListener* pClipEvtLstnr;
170*cdf0e10cSrcweir 	sal_Bool			bPastePossible;
171*cdf0e10cSrcweir     bool mbInitialized;
172*cdf0e10cSrcweir 
173*cdf0e10cSrcweir 	void Construct (DrawDocShell* pDocSh);
174*cdf0e10cSrcweir 	DECL_LINK( ClipboardChanged, TransferableDataHelper* );
175*cdf0e10cSrcweir };
176*cdf0e10cSrcweir 
177*cdf0e10cSrcweir } // end of namespace sd
178*cdf0e10cSrcweir 
179*cdf0e10cSrcweir #endif
180