update dev300-m58
[ooovba.git] / sd / source / ui / inc / OutlineViewShell.hxx
blobac95daf833e52ad9445ee51906880ea4b3ba44b5
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: OutlineViewShell.hxx,v $
10 * $Revision: 1.15 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SD_OUTLINE_VIEW_SHELL_HXX
32 #define SD_OUTLINE_VIEW_SHELL_HXX
34 #include "DrawDocShell.hxx"
35 #include "ViewShell.hxx"
36 #include "OutlineView.hxx"
38 class SdPage;
39 class TransferableDataHelper;
40 class TransferableClipboardListener;
42 namespace sd {
44 class SdUnoOutlineView;
46 /** Show a textual overview of the text contents of all slides.
48 class OutlineViewShell
49 : public ViewShell
51 public:
52 TYPEINFO();
54 SFX_DECL_VIEWFACTORY(OutlineViewShell);
55 SFX_DECL_INTERFACE(SD_IF_SDOUTLINEVIEWSHELL)
57 // The previous macros change access mode. To be sure switch back
58 // to public access.
59 public:
60 /** Create a new view shell for the outline mode.
61 @param rViewShellBase
62 The new object will be stacked on this view shell base.
63 @param pFrameView
64 The frame view that makes it possible to pass information from
65 one view shell to the next.
67 OutlineViewShell (
68 SfxViewFrame* pFrame,
69 ViewShellBase& rViewShellBase,
70 ::Window* pParentWindow,
71 FrameView* pFrameView = NULL);
73 OutlineViewShell (
74 SfxViewFrame* pFrame,
75 ::Window* pParentWindow,
76 const OutlineViewShell& rShell);
78 virtual ~OutlineViewShell (void);
80 virtual void Shutdown (void);
82 virtual void Paint(const Rectangle& rRect, ::sd::Window* pWin);
84 /** Arrange and resize the GUI elements like rulers, sliders, and
85 buttons as well as the actual document view according to the size of
86 the enclosing window and current sizes of buttons, rulers, and
87 sliders.
89 virtual void ArrangeGUIElements (void);
91 virtual USHORT PrepareClose( BOOL bUI = TRUE, BOOL bForBrowsing = FALSE );
93 virtual long VirtHScrollHdl(ScrollBar* pHScroll);
94 virtual long VirtVScrollHdl(ScrollBar* pVHScroll);
96 virtual void AddWindow(::sd::Window* pWin);
97 virtual void RemoveWindow(::sd::Window* pWin);
99 virtual void Activate( BOOL IsMDIActivate );
100 virtual void Deactivate( BOOL IsMDIActivate );
102 virtual SdPage* GetActualPage();
104 /// inherited from sd::ViewShell
105 virtual SdPage* getCurrentPage() const;
107 /** Return a string that describes the currently selected pages.
109 String GetPageRangeString (void);
111 void ExecCtrl(SfxRequest &rReq);
112 void GetCtrlState(SfxItemSet &rSet);
113 void GetMenuState(SfxItemSet &rSet);
114 void GetAttrState(SfxItemSet &rSet);
115 void GetState (SfxItemSet& rSet);
117 void ExecStatusBar(SfxRequest& rReq);
118 void GetStatusBarState(SfxItemSet& rSet);
120 void FuTemporary(SfxRequest &rReq);
121 void FuTemporaryModify(SfxRequest &rReq);
122 void FuPermanent(SfxRequest &rReq);
123 void FuSupport(SfxRequest &rReq);
125 virtual void SetZoom(long nZoom);
126 virtual void SetZoomRect(const Rectangle& rZoomRect);
127 virtual String GetSelectionText( BOOL bCompleteWords = FALSE );
128 virtual BOOL HasSelection( BOOL bText = TRUE ) const;
130 void Execute(SfxRequest& rReq);
132 virtual void ReadFrameViewData(FrameView* pView);
133 virtual void WriteFrameViewData();
135 virtual void Command( const CommandEvent& rCEvt, ::sd::Window* pWin );
136 virtual BOOL KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin);
137 virtual void MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin);
139 ULONG Read(SvStream& rInput, const String& rBaseURL, USHORT eFormat);
141 virtual void WriteUserDataSequence ( ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
142 virtual void ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
144 /** this method is called when the visible area of the view from this viewshell is changed */
145 virtual void VisAreaChanged(const Rectangle& rRect);
147 /** Create an accessible object representing the specified window.
148 @param pWindow
149 The returned object makes the document displayed in this window
150 accessible.
151 @return
152 Returns an <type>AccessibleDrawDocumentView</type> object.
154 virtual ::com::sun::star::uno::Reference<
155 ::com::sun::star::accessibility::XAccessible>
156 CreateAccessibleDocumentView (::sd::Window* pWindow);
158 /** Update the preview to show the specified page.
160 virtual void UpdatePreview (SdPage* pPage, BOOL bInit = FALSE);
162 virtual css::uno::Reference<css::drawing::XDrawSubController> CreateSubController (void);
164 /** Make the given page the new current page. This method
165 notifies the controller and adapts the selection of the
166 model.
167 @param pPage
168 The new current page. Pass NULL when there is no current page.
170 void SetCurrentPage (SdPage* pPage);
172 bool UpdateTitleObject( SdPage* pPage, Paragraph* pPara );
173 bool UpdateOutlineObject( SdPage* pPage, Paragraph* pPara );
175 protected:
176 virtual Size GetOptimalSizePixel() const;
178 private:
179 OutlineView* pOlView;
180 SdPage* pLastPage; // Zur performanten Aufbereitung der Preview
181 TransferableClipboardListener* pClipEvtLstnr;
182 BOOL bPastePossible;
183 bool mbInitialized;
185 void Construct (DrawDocShell* pDocSh);
186 DECL_LINK( ClipboardChanged, TransferableDataHelper* );
189 } // end of namespace sd
191 #endif