xref: /aoo42x/main/sc/source/ui/inc/prevwsh.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 SC_PREVWSH_HXX
29*cdf0e10cSrcweir #define SC_PREVWSH_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir class ScrollBar;
32*cdf0e10cSrcweir 
33*cdf0e10cSrcweir #include "address.hxx"
34*cdf0e10cSrcweir #include <sfx2/viewfac.hxx>
35*cdf0e10cSrcweir #include <sfx2/viewsh.hxx>
36*cdf0e10cSrcweir #include <svx/zoomitem.hxx>
37*cdf0e10cSrcweir 
38*cdf0e10cSrcweir #include "shellids.hxx"
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir class ScDocument;
41*cdf0e10cSrcweir class ScDocShell;
42*cdf0e10cSrcweir class ScPreview;
43*cdf0e10cSrcweir struct ScHeaderFieldData;
44*cdf0e10cSrcweir class ScPreviewLocationData;
45*cdf0e10cSrcweir class CommandEvent;
46*cdf0e10cSrcweir 
47*cdf0e10cSrcweir //==================================================================
48*cdf0e10cSrcweir 
49*cdf0e10cSrcweir 
50*cdf0e10cSrcweir class ScPreviewShell: public SfxViewShell
51*cdf0e10cSrcweir {
52*cdf0e10cSrcweir 	ScDocShell*		pDocShell;
53*cdf0e10cSrcweir 
54*cdf0e10cSrcweir 	ScPreview*		pPreview;				// Ausgabe-Fenster
55*cdf0e10cSrcweir 	ScrollBar*		pHorScroll;
56*cdf0e10cSrcweir 	ScrollBar*		pVerScroll;
57*cdf0e10cSrcweir 	Window*			pCorner;
58*cdf0e10cSrcweir 
59*cdf0e10cSrcweir     ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aSourceData;  // ViewData
60*cdf0e10cSrcweir 	sal_uInt8			nSourceDesignMode;		// form design mode from TabView
61*cdf0e10cSrcweir 	SvxZoomType		eZoom;
62*cdf0e10cSrcweir     long            nMaxVertPos;
63*cdf0e10cSrcweir 
64*cdf0e10cSrcweir 	SfxBroadcaster*	pAccessibilityBroadcaster;
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir private:
67*cdf0e10cSrcweir 	void			Construct( Window* pParent );
68*cdf0e10cSrcweir 	DECL_LINK(ScrollHandler, ScrollBar* );
69*cdf0e10cSrcweir 	void			DoScroll( sal_uInt16 nMode );
70*cdf0e10cSrcweir 
71*cdf0e10cSrcweir protected:
72*cdf0e10cSrcweir 	virtual void	Activate(sal_Bool bMDI);
73*cdf0e10cSrcweir 	virtual void	Deactivate(sal_Bool bMDI);
74*cdf0e10cSrcweir 
75*cdf0e10cSrcweir 	virtual void	AdjustPosSizePixel( const Point &rPos, const Size &rSize );
76*cdf0e10cSrcweir 
77*cdf0e10cSrcweir 	virtual void	InnerResizePixel( const Point &rOfs, const Size &rSize );
78*cdf0e10cSrcweir 	virtual void	OuterResizePixel( const Point &rOfs, const Size &rSize );
79*cdf0e10cSrcweir 
80*cdf0e10cSrcweir 	virtual Size	GetOptimalSizePixel() const;
81*cdf0e10cSrcweir 
82*cdf0e10cSrcweir 	virtual String  GetDescription() const;
83*cdf0e10cSrcweir 
84*cdf0e10cSrcweir 	virtual void	WriteUserData(String &, sal_Bool bBrowse = sal_False);
85*cdf0e10cSrcweir 	virtual void	ReadUserData(const String &, sal_Bool bBrowse = sal_False);
86*cdf0e10cSrcweir 
87*cdf0e10cSrcweir     virtual void    WriteUserDataSequence (::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
88*cdf0e10cSrcweir     virtual void    ReadUserDataSequence (const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
89*cdf0e10cSrcweir 
90*cdf0e10cSrcweir public:
91*cdf0e10cSrcweir 					TYPEINFO();
92*cdf0e10cSrcweir 
93*cdf0e10cSrcweir 					SFX_DECL_INTERFACE(SCID_PREVIEW_SHELL)
94*cdf0e10cSrcweir 					SFX_DECL_VIEWFACTORY(ScPreviewShell);
95*cdf0e10cSrcweir 
96*cdf0e10cSrcweir 					ScPreviewShell( SfxViewFrame*			pViewFrame,
97*cdf0e10cSrcweir 									SfxViewShell*			pOldSh );
98*cdf0e10cSrcweir 
99*cdf0e10cSrcweir 	virtual			~ScPreviewShell();
100*cdf0e10cSrcweir 
101*cdf0e10cSrcweir 	void			InitStartTable(SCTAB nTab);
102*cdf0e10cSrcweir 
103*cdf0e10cSrcweir 	void			UpdateScrollBars();
104*cdf0e10cSrcweir 	sal_Bool			ScrollCommand( const CommandEvent& rCEvt );
105*cdf0e10cSrcweir 
106*cdf0e10cSrcweir 	void			Execute( SfxRequest& rReq );
107*cdf0e10cSrcweir 	void			GetState( SfxItemSet& rSet );
108*cdf0e10cSrcweir 
109*cdf0e10cSrcweir 	void			FillFieldData( ScHeaderFieldData& rData );
110*cdf0e10cSrcweir 
111*cdf0e10cSrcweir     ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >
112*cdf0e10cSrcweir                     GetSourceData() const       { return aSourceData; }
113*cdf0e10cSrcweir 	sal_uInt8			GetSourceDesignMode() const	{ return nSourceDesignMode; }
114*cdf0e10cSrcweir 
115*cdf0e10cSrcweir 	virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
116*cdf0e10cSrcweir 
117*cdf0e10cSrcweir 	virtual SfxPrinter*		GetPrinter( sal_Bool bCreate = sal_False );
118*cdf0e10cSrcweir     virtual sal_uInt16          SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false );
119*cdf0e10cSrcweir 	virtual SfxTabPage*     CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions );
120*cdf0e10cSrcweir 
121*cdf0e10cSrcweir 	void	AddAccessibilityObject( SfxListener& rObject );
122*cdf0e10cSrcweir 	void	RemoveAccessibilityObject( SfxListener& rObject );
123*cdf0e10cSrcweir 	void	BroadcastAccessibility( const SfxHint &rHint );
124*cdf0e10cSrcweir 	sal_Bool	HasAccessibilityObjects();
125*cdf0e10cSrcweir 
126*cdf0e10cSrcweir 	const ScPreviewLocationData& GetLocationData();
127*cdf0e10cSrcweir 	ScDocument*		GetDocument();
128*cdf0e10cSrcweir     ScPreview*		GetPreview() { return pPreview; }
129*cdf0e10cSrcweir };
130*cdf0e10cSrcweir 
131*cdf0e10cSrcweir 
132*cdf0e10cSrcweir 
133*cdf0e10cSrcweir #endif
134