1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef SC_PREVWSH_HXX
21 #define SC_PREVWSH_HXX
25 #include "address.hxx"
26 #include <sfx2/viewfac.hxx>
27 #include <sfx2/viewsh.hxx>
28 #include <sfx2/zoomitem.hxx>
30 #include "shellids.hxx"
35 struct ScHeaderFieldData
;
36 class ScPreviewLocationData
;
39 //==================================================================
42 class ScPreviewShell
: public SfxViewShell
44 ScDocShell
* pDocShell
;
46 SystemWindow
* mpFrameWindow
;
47 ScPreview
* pPreview
; // Output window
48 ScrollBar
* pHorScroll
;
49 ScrollBar
* pVerScroll
;
52 ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
> aSourceData
; // ViewData
53 sal_uInt8 nSourceDesignMode
; // form design mode from TabView
57 SfxBroadcaster
* pAccessibilityBroadcaster
;
58 bool GetPageSize( Size
& aPageSize
);
60 void Construct( Window
* pParent
);
61 DECL_LINK(ScrollHandler
, ScrollBar
* );
62 DECL_LINK(CloseHdl
, SystemWindow
*);
63 void DoScroll( sal_uInt16 nMode
);
67 virtual void Activate(sal_Bool bMDI
);
68 virtual void Deactivate(sal_Bool bMDI
);
69 virtual void AdjustPosSizePixel( const Point
&rPos
, const Size
&rSize
);
71 virtual void InnerResizePixel( const Point
&rOfs
, const Size
&rSize
);
72 virtual void OuterResizePixel( const Point
&rOfs
, const Size
&rSize
);
74 virtual OUString
GetDescription() const;
76 virtual void WriteUserData(OUString
&, bool bBrowse
= false);
77 virtual void ReadUserData(const OUString
&, bool bBrowse
= false);
79 virtual void WriteUserDataSequence (::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>&, sal_Bool bBrowse
= false );
80 virtual void ReadUserDataSequence (const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>&, sal_Bool bBrowse
= false );
83 TYPEINFO_VISIBILITY( SC_DLLPUBLIC
);
85 SFX_DECL_INTERFACE(SCID_PREVIEW_SHELL
)
86 SFX_DECL_VIEWFACTORY(ScPreviewShell
);
88 ScPreviewShell( SfxViewFrame
* pViewFrame
,
89 SfxViewShell
* pOldSh
);
91 virtual ~ScPreviewShell();
93 void InitStartTable(SCTAB nTab
);
95 void UpdateScrollBars();
96 void UpdateNeededScrollBars(bool bFromZoom
= false);
97 sal_Bool
ScrollCommand( const CommandEvent
& rCEvt
);
99 void Execute( SfxRequest
& rReq
);
100 void GetState( SfxItemSet
& rSet
);
102 void FillFieldData( ScHeaderFieldData
& rData
);
104 ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>
105 GetSourceData() const { return aSourceData
; }
106 sal_uInt8
GetSourceDesignMode() const { return nSourceDesignMode
; }
108 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
110 virtual SfxPrinter
* GetPrinter( sal_Bool bCreate
= false );
111 virtual sal_uInt16
SetPrinter( SfxPrinter
* pNewPrinter
, sal_uInt16 nDiffFlags
= SFX_PRINTER_ALL
, bool bIsAPI
=false );
112 virtual bool HasPrintOptionsPage() const;
113 virtual SfxTabPage
* CreatePrintOptionsPage( Window
*pParent
, const SfxItemSet
&rOptions
);
115 void AddAccessibilityObject( SfxListener
& rObject
);
116 void RemoveAccessibilityObject( SfxListener
& rObject
);
117 void BroadcastAccessibility( const SfxHint
&rHint
);
118 sal_Bool
HasAccessibilityObjects();
120 const ScPreviewLocationData
& GetLocationData();
121 ScDocument
* GetDocument();
122 SC_DLLPUBLIC ScPreview
* GetPreview() { return pPreview
; }
129 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */