Update ooo320-m1
[ooovba.git] / sd / source / ui / inc / SlideViewShell.hxx
bloba3602ccec26f2056968c5fce8acb9baa95f282d8
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: SlideViewShell.hxx,v $
10 * $Revision: 1.11 $
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_SLIDE_VIEW_SHELL_HXX
32 #define SD_SLIDE_VIEW_SHELL_HXX
35 #include "ViewShell.hxx"
36 #include "SlideView.hxx"
37 #include <sfx2/viewfac.hxx>
38 #include <sfx2/viewsh.hxx>
42 class SdPage;
46 namespace sd {
48 class SdUnoSlideView;
49 class Window;
51 /** Show an overview over the slides in an Impress document and allow
52 some high level editing i.e. editing of the order in a show, not
53 the contents of the slides.
55 class SlideViewShell
56 : public ViewShell
58 public:
60 TYPEINFO();
62 SFX_DECL_VIEWFACTORY(SlideViewShell);
63 SFX_DECL_INTERFACE(SD_IF_SDSLIDEVIEWSHELL)
65 /** Create a new view shell for the slide view.
66 @param rViewShellBase
67 The new object will be stacked on this view shell base.
68 @param pFrameView
69 The frame view that makes it possible to pass information from
70 one view shell to the next.
72 SlideViewShell(SfxViewFrame* pFrame,
73 ViewShellBase& rViewShellBase,
74 ::Window* pParentWindow,
75 FrameView* pFrameView = NULL);
77 SlideViewShell(SfxViewFrame *pFrame,
78 ::Window* pParentWindow,
79 const SlideViewShell& rShell);
81 virtual ~SlideViewShell (void);
83 virtual void Paint(const Rectangle& rRect, ::sd::Window* pWin);
85 /** Arrange and resize the GUI elements like rulers, sliders, and
86 buttons as well as the actual document view according to the size of
87 the enclosing window and current sizes of buttons, rulers, and
88 sliders.
90 virtual void ArrangeGUIElements (void);
91 virtual void AddWindow(::sd::Window* pWin) { pSlideView->AddWindowToPaintView((OutputDevice*) pWin); }
92 virtual void RemoveWindow(::sd::Window* pWin) { pSlideView->DeleteWindowFromPaintView((OutputDevice*) pWin); }
94 virtual BOOL KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin);
95 virtual void MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin);
96 virtual void MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin);
97 virtual void MouseButtonDown(const MouseEvent& rMEvt, ::sd::Window* pWin);
98 virtual void Command(const CommandEvent& rCEvt, ::sd::Window* pWin);
100 virtual SdPage* GetActualPage();
102 /** @returns
103 current or selected page or 0.
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);
116 void SetPagesPerRow( USHORT nPagesPerRow );
118 void ExecStatusBar(SfxRequest& rReq);
119 void GetStatusBarState(SfxItemSet& rSet);
121 void FuTemporary(SfxRequest &rReq);
122 void FuPermanent(SfxRequest &rReq);
123 void FuSupport(SfxRequest &rReq);
125 virtual void ReadFrameViewData(FrameView* pView);
126 virtual void WriteFrameViewData();
128 virtual void SetZoom(long nZoom);
129 virtual void SetZoomRect(const Rectangle& rZoomRect);
131 virtual BOOL HasSelection( BOOL bText = TRUE ) const;
133 /** Draw the rectangle arround the specified slide that indicates whether
134 the slide is selected or not. When not selected the rectangle is
135 painted in the background color (WindowColor from the style settings)
136 and is therefore not visible. A selected slide is painted with the
137 WindowTextColor from the style settings. Painting takes place in
138 all associated windows. The line- and fill color of the windows are
139 restored to their original values after the rectangle is painted.
140 @param nPage
141 When the page number is invalid then the call is ignored.
143 void DrawSelectionRect( USHORT nPage );
144 void DrawFocusRect( USHORT nPage );
146 virtual void WriteUserDataSequence ( ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
147 virtual void ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
149 virtual void VisAreaChanged(const Rectangle& rRect);
151 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> CreateAccessibleDocumentView( ::sd::Window* pWindow );
153 void SelectionHasChanged();
154 void PageLayoutHasChanged();
155 void FocusHasChanged( USHORT nOldFocusPage, USHORT nNewFocusPage );
156 void PageVisibilityHasChanged( USHORT nPage, BOOL bVisible );
158 /** On activation the preview is turned off.
160 virtual void Activate (BOOL IsMDIActivate);
162 protected:
163 virtual Size GetOptimalSizePixel() const;
164 virtual long VirtHScrollHdl(ScrollBar* pHScroll);
165 virtual long VirtVScrollHdl(ScrollBar* pVHScroll);
168 private:
169 SlideView* pSlideView;
170 Point aDisplayPos;
171 Size aDisplaySize;
172 USHORT nCurFocusPage;
173 bool bSetInitialZoomFactor;
174 bool bInitializeWinPos;
176 void Construct(SdDrawDocument* pDoc);
177 void ImplDrawFocusRect( USHORT nPage, BOOL bVisible );
180 } // end of namespace sd
182 #endif