update dev300-m57
[ooovba.git] / sc / source / ui / inc / prevwsh.hxx
blob71b5a96de5ba4a12dd63c5048e62108c84712565
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: prevwsh.hxx,v $
10 * $Revision: 1.13.32.1 $
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 SC_PREVWSH_HXX
32 #define SC_PREVWSH_HXX
34 class ScrollBar;
36 #include "address.hxx"
37 #include <sfx2/viewfac.hxx>
38 #include <sfx2/viewsh.hxx>
39 #include <svx/zoomitem.hxx>
41 #include "shellids.hxx"
43 class ScDocument;
44 class ScDocShell;
45 class ScPreview;
46 struct ScHeaderFieldData;
47 class ScPreviewLocationData;
48 class CommandEvent;
50 //==================================================================
53 class ScPreviewShell: public SfxViewShell
55 ScDocShell* pDocShell;
57 ScPreview* pPreview; // Ausgabe-Fenster
58 ScrollBar* pHorScroll;
59 ScrollBar* pVerScroll;
60 Window* pCorner;
62 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aSourceData; // ViewData
63 BYTE nSourceDesignMode; // form design mode from TabView
64 SvxZoomType eZoom;
65 long nMaxVertPos;
67 SfxBroadcaster* pAccessibilityBroadcaster;
69 private:
70 void Construct( Window* pParent );
71 DECL_LINK(ScrollHandler, ScrollBar* );
72 void DoScroll( USHORT nMode );
74 protected:
75 virtual void Activate(BOOL bMDI);
76 virtual void Deactivate(BOOL bMDI);
78 virtual void AdjustPosSizePixel( const Point &rPos, const Size &rSize );
80 virtual void InnerResizePixel( const Point &rOfs, const Size &rSize );
81 virtual void OuterResizePixel( const Point &rOfs, const Size &rSize );
83 virtual Size GetOptimalSizePixel() const;
85 virtual String GetDescription() const;
87 virtual void WriteUserData(String &, BOOL bBrowse = FALSE);
88 virtual void ReadUserData(const String &, BOOL bBrowse = FALSE);
90 virtual void WriteUserDataSequence (::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
91 virtual void ReadUserDataSequence (const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
93 public:
94 TYPEINFO();
96 SFX_DECL_INTERFACE(SCID_PREVIEW_SHELL)
97 SFX_DECL_VIEWFACTORY(ScPreviewShell);
99 ScPreviewShell( SfxViewFrame* pViewFrame,
100 SfxViewShell* pOldSh );
102 virtual ~ScPreviewShell();
104 void InitStartTable(SCTAB nTab);
106 void UpdateScrollBars();
107 BOOL ScrollCommand( const CommandEvent& rCEvt );
109 void Execute( SfxRequest& rReq );
110 void GetState( SfxItemSet& rSet );
112 void FillFieldData( ScHeaderFieldData& rData );
114 ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >
115 GetSourceData() const { return aSourceData; }
116 BYTE GetSourceDesignMode() const { return nSourceDesignMode; }
118 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
120 virtual SfxPrinter* GetPrinter( BOOL bCreate = FALSE );
121 virtual USHORT SetPrinter( SfxPrinter* pNewPrinter, USHORT nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false );
122 virtual PrintDialog* CreatePrintDialog( Window* pParent );
123 virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions );
124 virtual void PreparePrint( PrintDialog* pPrintDialog = NULL );
125 virtual ErrCode DoPrint( SfxPrinter *pPrinter, PrintDialog *pPrintDialog, BOOL bSilent, BOOL bIsAPI );
126 virtual USHORT Print( SfxProgress& rProgress, BOOL bIsAPI, PrintDialog* pPrintDialog = NULL );
128 void AddAccessibilityObject( SfxListener& rObject );
129 void RemoveAccessibilityObject( SfxListener& rObject );
130 void BroadcastAccessibility( const SfxHint &rHint );
131 BOOL HasAccessibilityObjects();
133 const ScPreviewLocationData& GetLocationData();
134 ScDocument* GetDocument();
135 ScPreview* GetPreview() { return pPreview; }
140 #endif