xref: /trunk/main/sc/source/ui/inc/prevwsh.hxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb) !
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef SC_PREVWSH_HXX
29 #define SC_PREVWSH_HXX
30 
31 class ScrollBar;
32 
33 #include "address.hxx"
34 #include <sfx2/viewfac.hxx>
35 #include <sfx2/viewsh.hxx>
36 #include <svx/zoomitem.hxx>
37 
38 #include "shellids.hxx"
39 
40 class ScDocument;
41 class ScDocShell;
42 class ScPreview;
43 struct ScHeaderFieldData;
44 class ScPreviewLocationData;
45 class CommandEvent;
46 
47 //==================================================================
48 
49 
50 class ScPreviewShell: public SfxViewShell
51 {
52     ScDocShell*     pDocShell;
53 
54     ScPreview*      pPreview;               // Ausgabe-Fenster
55     ScrollBar*      pHorScroll;
56     ScrollBar*      pVerScroll;
57     Window*         pCorner;
58 
59     ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aSourceData;  // ViewData
60     sal_uInt8           nSourceDesignMode;      // form design mode from TabView
61     SvxZoomType     eZoom;
62     long            nMaxVertPos;
63 
64     SfxBroadcaster* pAccessibilityBroadcaster;
65 
66 private:
67     void            Construct( Window* pParent );
68     DECL_LINK(ScrollHandler, ScrollBar* );
69     void            DoScroll( sal_uInt16 nMode );
70 
71 protected:
72     virtual void    Activate(sal_Bool bMDI);
73     virtual void    Deactivate(sal_Bool bMDI);
74 
75     virtual void    AdjustPosSizePixel( const Point &rPos, const Size &rSize );
76 
77     virtual void    InnerResizePixel( const Point &rOfs, const Size &rSize );
78     virtual void    OuterResizePixel( const Point &rOfs, const Size &rSize );
79 
80     virtual Size    GetOptimalSizePixel() const;
81 
82     virtual String  GetDescription() const;
83 
84     virtual void    WriteUserData(String &, sal_Bool bBrowse = sal_False);
85     virtual void    ReadUserData(const String &, sal_Bool bBrowse = sal_False);
86 
87     virtual void    WriteUserDataSequence (::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
88     virtual void    ReadUserDataSequence (const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
89 
90 public:
91                     TYPEINFO();
92 
93                     SFX_DECL_INTERFACE(SCID_PREVIEW_SHELL)
94                     SFX_DECL_VIEWFACTORY(ScPreviewShell);
95 
96                     ScPreviewShell( SfxViewFrame*           pViewFrame,
97                                     SfxViewShell*           pOldSh );
98 
99     virtual         ~ScPreviewShell();
100 
101     void            InitStartTable(SCTAB nTab);
102 
103     void            UpdateScrollBars();
104     sal_Bool            ScrollCommand( const CommandEvent& rCEvt );
105 
106     void            Execute( SfxRequest& rReq );
107     void            GetState( SfxItemSet& rSet );
108 
109     void            FillFieldData( ScHeaderFieldData& rData );
110 
111     ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >
112                     GetSourceData() const       { return aSourceData; }
113     sal_uInt8           GetSourceDesignMode() const { return nSourceDesignMode; }
114 
115     virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
116 
117     virtual SfxPrinter*     GetPrinter( sal_Bool bCreate = sal_False );
118     virtual sal_uInt16          SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false );
119     virtual SfxTabPage*     CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions );
120 
121     void    AddAccessibilityObject( SfxListener& rObject );
122     void    RemoveAccessibilityObject( SfxListener& rObject );
123     void    BroadcastAccessibility( const SfxHint &rHint );
124     sal_Bool    HasAccessibilityObjects();
125 
126     const ScPreviewLocationData& GetLocationData();
127     ScDocument*     GetDocument();
128     ScPreview*      GetPreview() { return pPreview; }
129 };
130 
131 
132 
133 #endif
134