xref: /aoo4110/main/sc/source/ui/inc/prevwsh.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SC_PREVWSH_HXX
25 #define SC_PREVWSH_HXX
26 
27 class ScrollBar;
28 
29 #include "address.hxx"
30 #include <sfx2/viewfac.hxx>
31 #include <sfx2/viewsh.hxx>
32 #include <svx/zoomitem.hxx>
33 
34 #include "shellids.hxx"
35 
36 class ScDocument;
37 class ScDocShell;
38 class ScPreview;
39 struct ScHeaderFieldData;
40 class ScPreviewLocationData;
41 class CommandEvent;
42 
43 //==================================================================
44 
45 
46 class ScPreviewShell: public SfxViewShell
47 {
48 	ScDocShell*		pDocShell;
49 
50 	ScPreview*		pPreview;				// Ausgabe-Fenster
51 	ScrollBar*		pHorScroll;
52 	ScrollBar*		pVerScroll;
53 	Window*			pCorner;
54 
55     ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aSourceData;  // ViewData
56 	sal_uInt8			nSourceDesignMode;		// form design mode from TabView
57 	SvxZoomType		eZoom;
58     long            nMaxVertPos;
59 
60 	SfxBroadcaster*	pAccessibilityBroadcaster;
61 
62 private:
63 	void			Construct( Window* pParent );
64 	DECL_LINK(ScrollHandler, ScrollBar* );
65 	void			DoScroll( sal_uInt16 nMode );
66 
67 protected:
68 	virtual void	Activate(sal_Bool bMDI);
69 	virtual void	Deactivate(sal_Bool bMDI);
70 
71 	virtual void	AdjustPosSizePixel( const Point &rPos, const Size &rSize );
72 
73 	virtual void	InnerResizePixel( const Point &rOfs, const Size &rSize );
74 	virtual void	OuterResizePixel( const Point &rOfs, const Size &rSize );
75 
76 	virtual Size	GetOptimalSizePixel() const;
77 
78 	virtual String  GetDescription() const;
79 
80 	virtual void	WriteUserData(String &, sal_Bool bBrowse = sal_False);
81 	virtual void	ReadUserData(const String &, sal_Bool bBrowse = sal_False);
82 
83     virtual void    WriteUserDataSequence (::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
84     virtual void    ReadUserDataSequence (const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
85 
86 public:
87 					TYPEINFO();
88 
89 					SFX_DECL_INTERFACE(SCID_PREVIEW_SHELL)
90 					SFX_DECL_VIEWFACTORY(ScPreviewShell);
91 
92 					ScPreviewShell( SfxViewFrame*			pViewFrame,
93 									SfxViewShell*			pOldSh );
94 
95 	virtual			~ScPreviewShell();
96 
97 	void			InitStartTable(SCTAB nTab);
98 
99 	void			UpdateScrollBars();
100 	sal_Bool			ScrollCommand( const CommandEvent& rCEvt );
101 
102 	void			Execute( SfxRequest& rReq );
103 	void			GetState( SfxItemSet& rSet );
104 
105 	void			FillFieldData( ScHeaderFieldData& rData );
106 
107     ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >
GetSourceData() const108                     GetSourceData() const       { return aSourceData; }
GetSourceDesignMode() const109 	sal_uInt8			GetSourceDesignMode() const	{ return nSourceDesignMode; }
110 
111 	virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
112 
113 	virtual SfxPrinter*		GetPrinter( sal_Bool bCreate = sal_False );
114     virtual sal_uInt16          SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false );
115 	virtual SfxTabPage*     CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions );
116 
117 	void	AddAccessibilityObject( SfxListener& rObject );
118 	void	RemoveAccessibilityObject( SfxListener& rObject );
119 	void	BroadcastAccessibility( const SfxHint &rHint );
120 	sal_Bool	HasAccessibilityObjects();
121 
122 	const ScPreviewLocationData& GetLocationData();
123 	ScDocument*		GetDocument();
GetPreview()124     ScPreview*		GetPreview() { return pPreview; }
125 };
126 
127 
128 
129 #endif
130