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