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