1*c45d927aSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*c45d927aSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*c45d927aSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*c45d927aSAndrew Rist * distributed with this work for additional information 6*c45d927aSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*c45d927aSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*c45d927aSAndrew Rist * "License"); you may not use this file except in compliance 9*c45d927aSAndrew Rist * with the License. You may obtain a copy of the License at 10*c45d927aSAndrew Rist * 11*c45d927aSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*c45d927aSAndrew Rist * 13*c45d927aSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*c45d927aSAndrew Rist * software distributed under the License is distributed on an 15*c45d927aSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*c45d927aSAndrew Rist * KIND, either express or implied. See the License for the 17*c45d927aSAndrew Rist * specific language governing permissions and limitations 18*c45d927aSAndrew Rist * under the License. 19*c45d927aSAndrew Rist * 20*c45d927aSAndrew Rist *************************************************************/ 21*c45d927aSAndrew Rist 22*c45d927aSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef SD_SLIDE_VIEW_SHELL_HXX 25cdf0e10cSrcweir #define SD_SLIDE_VIEW_SHELL_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir 28cdf0e10cSrcweir #include "ViewShell.hxx" 29cdf0e10cSrcweir #include "SlideView.hxx" 30cdf0e10cSrcweir #include <sfx2/viewfac.hxx> 31cdf0e10cSrcweir #include <sfx2/viewsh.hxx> 32cdf0e10cSrcweir 33cdf0e10cSrcweir 34cdf0e10cSrcweir 35cdf0e10cSrcweir class SdPage; 36cdf0e10cSrcweir 37cdf0e10cSrcweir 38cdf0e10cSrcweir 39cdf0e10cSrcweir namespace sd { 40cdf0e10cSrcweir 41cdf0e10cSrcweir class SdUnoSlideView; 42cdf0e10cSrcweir class Window; 43cdf0e10cSrcweir 44cdf0e10cSrcweir /** Show an overview over the slides in an Impress document and allow 45cdf0e10cSrcweir some high level editing i.e. editing of the order in a show, not 46cdf0e10cSrcweir the contents of the slides. 47cdf0e10cSrcweir */ 48cdf0e10cSrcweir class SlideViewShell 49cdf0e10cSrcweir : public ViewShell 50cdf0e10cSrcweir { 51cdf0e10cSrcweir public: 52cdf0e10cSrcweir 53cdf0e10cSrcweir TYPEINFO(); 54cdf0e10cSrcweir 55cdf0e10cSrcweir SFX_DECL_VIEWFACTORY(SlideViewShell); 56cdf0e10cSrcweir SFX_DECL_INTERFACE(SD_IF_SDSLIDEVIEWSHELL) 57cdf0e10cSrcweir 58cdf0e10cSrcweir /** Create a new view shell for the slide view. 59cdf0e10cSrcweir @param rViewShellBase 60cdf0e10cSrcweir The new object will be stacked on this view shell base. 61cdf0e10cSrcweir @param pFrameView 62cdf0e10cSrcweir The frame view that makes it possible to pass information from 63cdf0e10cSrcweir one view shell to the next. 64cdf0e10cSrcweir */ 65cdf0e10cSrcweir SlideViewShell(SfxViewFrame* pFrame, 66cdf0e10cSrcweir ViewShellBase& rViewShellBase, 67cdf0e10cSrcweir ::Window* pParentWindow, 68cdf0e10cSrcweir FrameView* pFrameView = NULL); 69cdf0e10cSrcweir 70cdf0e10cSrcweir SlideViewShell(SfxViewFrame *pFrame, 71cdf0e10cSrcweir ::Window* pParentWindow, 72cdf0e10cSrcweir const SlideViewShell& rShell); 73cdf0e10cSrcweir 74cdf0e10cSrcweir virtual ~SlideViewShell (void); 75cdf0e10cSrcweir 76cdf0e10cSrcweir virtual void Paint(const Rectangle& rRect, ::sd::Window* pWin); 77cdf0e10cSrcweir 78cdf0e10cSrcweir /** Arrange and resize the GUI elements like rulers, sliders, and 79cdf0e10cSrcweir buttons as well as the actual document view according to the size of 80cdf0e10cSrcweir the enclosing window and current sizes of buttons, rulers, and 81cdf0e10cSrcweir sliders. 82cdf0e10cSrcweir */ 83cdf0e10cSrcweir virtual void ArrangeGUIElements (void); 84cdf0e10cSrcweir virtual void AddWindow(::sd::Window* pWin) { pSlideView->AddWindowToPaintView((OutputDevice*) pWin); } 85cdf0e10cSrcweir virtual void RemoveWindow(::sd::Window* pWin) { pSlideView->DeleteWindowFromPaintView((OutputDevice*) pWin); } 86cdf0e10cSrcweir 87cdf0e10cSrcweir virtual sal_Bool KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin); 88cdf0e10cSrcweir virtual void MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin); 89cdf0e10cSrcweir virtual void MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin); 90cdf0e10cSrcweir virtual void MouseButtonDown(const MouseEvent& rMEvt, ::sd::Window* pWin); 91cdf0e10cSrcweir virtual void Command(const CommandEvent& rCEvt, ::sd::Window* pWin); 92cdf0e10cSrcweir 93cdf0e10cSrcweir virtual SdPage* GetActualPage(); 94cdf0e10cSrcweir 95cdf0e10cSrcweir /** @returns 96cdf0e10cSrcweir current or selected page or 0. 97cdf0e10cSrcweir */ 98cdf0e10cSrcweir virtual SdPage* getCurrentPage() const; 99cdf0e10cSrcweir 100cdf0e10cSrcweir void ExecCtrl(SfxRequest &rReq); 101cdf0e10cSrcweir void GetCtrlState(SfxItemSet &rSet); 102cdf0e10cSrcweir void GetMenuState(SfxItemSet &rSet); 103cdf0e10cSrcweir void GetAttrState(SfxItemSet &rSet); 104cdf0e10cSrcweir 105cdf0e10cSrcweir void SetPagesPerRow( sal_uInt16 nPagesPerRow ); 106cdf0e10cSrcweir 107cdf0e10cSrcweir void ExecStatusBar(SfxRequest& rReq); 108cdf0e10cSrcweir void GetStatusBarState(SfxItemSet& rSet); 109cdf0e10cSrcweir 110cdf0e10cSrcweir void FuTemporary(SfxRequest &rReq); 111cdf0e10cSrcweir void FuPermanent(SfxRequest &rReq); 112cdf0e10cSrcweir void FuSupport(SfxRequest &rReq); 113cdf0e10cSrcweir 114cdf0e10cSrcweir virtual void ReadFrameViewData(FrameView* pView); 115cdf0e10cSrcweir virtual void WriteFrameViewData(); 116cdf0e10cSrcweir 117cdf0e10cSrcweir virtual void SetZoom(long nZoom); 118cdf0e10cSrcweir virtual void SetZoomRect(const Rectangle& rZoomRect); 119cdf0e10cSrcweir 120cdf0e10cSrcweir virtual sal_Bool HasSelection( sal_Bool bText = sal_True ) const; 121cdf0e10cSrcweir 122cdf0e10cSrcweir /** Draw the rectangle arround the specified slide that indicates whether 123cdf0e10cSrcweir the slide is selected or not. When not selected the rectangle is 124cdf0e10cSrcweir painted in the background color (WindowColor from the style settings) 125cdf0e10cSrcweir and is therefore not visible. A selected slide is painted with the 126cdf0e10cSrcweir WindowTextColor from the style settings. Painting takes place in 127cdf0e10cSrcweir all associated windows. The line- and fill color of the windows are 128cdf0e10cSrcweir restored to their original values after the rectangle is painted. 129cdf0e10cSrcweir @param nPage 130cdf0e10cSrcweir When the page number is invalid then the call is ignored. 131cdf0e10cSrcweir */ 132cdf0e10cSrcweir void DrawSelectionRect( sal_uInt16 nPage ); 133cdf0e10cSrcweir void DrawFocusRect( sal_uInt16 nPage ); 134cdf0e10cSrcweir 135cdf0e10cSrcweir virtual void WriteUserDataSequence ( ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False ); 136cdf0e10cSrcweir virtual void ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False ); 137cdf0e10cSrcweir 138cdf0e10cSrcweir virtual void VisAreaChanged(const Rectangle& rRect); 139cdf0e10cSrcweir 140cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> CreateAccessibleDocumentView( ::sd::Window* pWindow ); 141cdf0e10cSrcweir 142cdf0e10cSrcweir void SelectionHasChanged(); 143cdf0e10cSrcweir void PageLayoutHasChanged(); 144cdf0e10cSrcweir void FocusHasChanged( sal_uInt16 nOldFocusPage, sal_uInt16 nNewFocusPage ); 145cdf0e10cSrcweir void PageVisibilityHasChanged( sal_uInt16 nPage, sal_Bool bVisible ); 146cdf0e10cSrcweir 147cdf0e10cSrcweir /** On activation the preview is turned off. 148cdf0e10cSrcweir */ 149cdf0e10cSrcweir virtual void Activate (sal_Bool IsMDIActivate); 150cdf0e10cSrcweir 151cdf0e10cSrcweir protected: 152cdf0e10cSrcweir virtual Size GetOptimalSizePixel() const; 153cdf0e10cSrcweir virtual long VirtHScrollHdl(ScrollBar* pHScroll); 154cdf0e10cSrcweir virtual long VirtVScrollHdl(ScrollBar* pVHScroll); 155cdf0e10cSrcweir 156cdf0e10cSrcweir 157cdf0e10cSrcweir private: 158cdf0e10cSrcweir SlideView* pSlideView; 159cdf0e10cSrcweir Point aDisplayPos; 160cdf0e10cSrcweir Size aDisplaySize; 161cdf0e10cSrcweir sal_uInt16 nCurFocusPage; 162cdf0e10cSrcweir bool bSetInitialZoomFactor; 163cdf0e10cSrcweir bool bInitializeWinPos; 164cdf0e10cSrcweir 165cdf0e10cSrcweir void Construct(SdDrawDocument* pDoc); 166cdf0e10cSrcweir void ImplDrawFocusRect( sal_uInt16 nPage, sal_Bool bVisible ); 167cdf0e10cSrcweir }; 168cdf0e10cSrcweir 169cdf0e10cSrcweir } // end of namespace sd 170cdf0e10cSrcweir 171cdf0e10cSrcweir #endif 172