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