Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef INCLUDED_SC_SOURCE_UI_INC_PREVWSH_HXX
21 : #define INCLUDED_SC_SOURCE_UI_INC_PREVWSH_HXX
22 :
23 : class ScrollBar;
24 :
25 : #include "address.hxx"
26 : #include <sfx2/viewfac.hxx>
27 : #include <sfx2/viewsh.hxx>
28 : #include <sfx2/zoomitem.hxx>
29 :
30 : #include "shellids.hxx"
31 :
32 : class ScDocument;
33 : class ScDocShell;
34 : class ScPreview;
35 : struct ScHeaderFieldData;
36 : class ScPreviewLocationData;
37 : class CommandEvent;
38 :
39 : class ScPreviewShell: public SfxViewShell
40 : {
41 : ScDocShell* pDocShell;
42 :
43 : SystemWindow* mpFrameWindow;
44 : ScPreview* pPreview; // Output window
45 : ScrollBar* pHorScroll;
46 : ScrollBar* pVerScroll;
47 : vcl::Window* pCorner;
48 :
49 : ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aSourceData; // ViewData
50 : sal_uInt8 nSourceDesignMode; // form design mode from TabView
51 : SvxZoomType eZoom;
52 : long nMaxVertPos;
53 :
54 : SfxBroadcaster* pAccessibilityBroadcaster;
55 : bool GetPageSize( Size& aPageSize );
56 : private:
57 : void Construct( vcl::Window* pParent );
58 : DECL_LINK(ScrollHandler, ScrollBar* );
59 : DECL_LINK(CloseHdl, SystemWindow*);
60 : void DoScroll( sal_uInt16 nMode );
61 : void ExitPreview();
62 :
63 : protected:
64 : virtual void Activate(bool bMDI) SAL_OVERRIDE;
65 : virtual void Deactivate(bool bMDI) SAL_OVERRIDE;
66 : virtual void AdjustPosSizePixel( const Point &rPos, const Size &rSize ) SAL_OVERRIDE;
67 :
68 : virtual void InnerResizePixel( const Point &rOfs, const Size &rSize ) SAL_OVERRIDE;
69 : virtual void OuterResizePixel( const Point &rOfs, const Size &rSize ) SAL_OVERRIDE;
70 :
71 : virtual OUString GetDescription() const;
72 :
73 : virtual void WriteUserData(OUString &, bool bBrowse = false) SAL_OVERRIDE;
74 : virtual void ReadUserData(const OUString &, bool bBrowse = false) SAL_OVERRIDE;
75 :
76 : virtual void WriteUserDataSequence (::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, bool bBrowse = false ) SAL_OVERRIDE;
77 : virtual void ReadUserDataSequence (const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, bool bBrowse = false ) SAL_OVERRIDE;
78 :
79 : public:
80 : TYPEINFO_VISIBILITY( SC_DLLPUBLIC );
81 76 : SFX_DECL_INTERFACE(SCID_PREVIEW_SHELL)
82 76 : SFX_DECL_VIEWFACTORY(ScPreviewShell);
83 :
84 : private:
85 : /// SfxInterface initializer.
86 : static void InitInterface_Impl();
87 :
88 : public:
89 : ScPreviewShell( SfxViewFrame* pViewFrame,
90 : SfxViewShell* pOldSh );
91 :
92 : virtual ~ScPreviewShell();
93 :
94 : void InitStartTable(SCTAB nTab);
95 :
96 : void UpdateScrollBars();
97 : void UpdateNeededScrollBars(bool bFromZoom = false);
98 : bool ScrollCommand( const CommandEvent& rCEvt );
99 :
100 : void Execute( SfxRequest& rReq );
101 : void GetState( SfxItemSet& rSet );
102 :
103 : void FillFieldData( ScHeaderFieldData& rData );
104 :
105 : ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >
106 : GetSourceData() const { return aSourceData; }
107 0 : sal_uInt8 GetSourceDesignMode() const { return nSourceDesignMode; }
108 :
109 : virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
110 :
111 : virtual SfxPrinter* GetPrinter( bool bCreate = false ) SAL_OVERRIDE;
112 : virtual sal_uInt16 SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false ) SAL_OVERRIDE;
113 : virtual bool HasPrintOptionsPage() const SAL_OVERRIDE;
114 : virtual SfxTabPage* CreatePrintOptionsPage( vcl::Window *pParent, const SfxItemSet &rOptions ) SAL_OVERRIDE;
115 :
116 : void AddAccessibilityObject( SfxListener& rObject );
117 : void RemoveAccessibilityObject( SfxListener& rObject );
118 : void BroadcastAccessibility( const SfxHint &rHint );
119 : bool HasAccessibilityObjects();
120 :
121 : const ScPreviewLocationData& GetLocationData();
122 : ScDocument& GetDocument();
123 0 : SC_DLLPUBLIC ScPreview* GetPreview() { return pPreview; }
124 : };
125 :
126 : #endif
127 :
128 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|