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 INCLUDED_SC_SOURCE_UI_INC_PREVWSH_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_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 class ScPreviewShell
: public SfxViewShell
41 ScDocShell
* pDocShell
;
43 VclPtr
<SystemWindow
> mpFrameWindow
;
44 VclPtr
<ScPreview
> pPreview
; // Output window
45 VclPtr
<ScrollBar
> pHorScroll
;
46 VclPtr
<ScrollBar
> pVerScroll
;
47 VclPtr
<vcl::Window
> pCorner
;
49 ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
> aSourceData
; // ViewData
50 TriState nSourceDesignMode
; // form design mode from TabView
54 SfxBroadcaster
* pAccessibilityBroadcaster
;
55 bool GetPageSize( Size
& aPageSize
);
57 void Construct( vcl::Window
* pParent
);
58 DECL_LINK(ScrollHandler
, ScrollBar
* );
59 DECL_LINK(CloseHdl
, SystemWindow
*);
60 void DoScroll( sal_uInt16 nMode
);
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
;
68 virtual void InnerResizePixel( const Point
&rOfs
, const Size
&rSize
) SAL_OVERRIDE
;
69 virtual void OuterResizePixel( const Point
&rOfs
, const Size
&rSize
) SAL_OVERRIDE
;
71 virtual void WriteUserData(OUString
&, bool bBrowse
= false) SAL_OVERRIDE
;
72 virtual void ReadUserData(const OUString
&, bool bBrowse
= false) SAL_OVERRIDE
;
74 virtual void WriteUserDataSequence (::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>&, bool bBrowse
= false ) SAL_OVERRIDE
;
75 virtual void ReadUserDataSequence (const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>&, bool bBrowse
= false ) SAL_OVERRIDE
;
78 TYPEINFO_VISIBILITY_OVERRIDE( SC_DLLPUBLIC
);
79 SFX_DECL_INTERFACE(SCID_PREVIEW_SHELL
)
80 SFX_DECL_VIEWFACTORY(ScPreviewShell
);
83 /// SfxInterface initializer.
84 static void InitInterface_Impl();
87 ScPreviewShell( SfxViewFrame
* pViewFrame
,
88 SfxViewShell
* pOldSh
);
90 virtual ~ScPreviewShell();
92 void InitStartTable(SCTAB nTab
);
94 void UpdateScrollBars();
95 void UpdateNeededScrollBars(bool bFromZoom
= false);
96 bool ScrollCommand( const CommandEvent
& rCEvt
);
98 void Execute( SfxRequest
& rReq
);
99 void GetState( SfxItemSet
& rSet
);
101 void FillFieldData( ScHeaderFieldData
& rData
);
103 ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>
104 GetSourceData() const { return aSourceData
; }
105 TriState
GetSourceDesignMode() const { return nSourceDesignMode
; }
107 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
) SAL_OVERRIDE
;
109 virtual SfxPrinter
* GetPrinter( bool bCreate
= false ) SAL_OVERRIDE
;
110 virtual sal_uInt16
SetPrinter( SfxPrinter
* pNewPrinter
, SfxPrinterChangeFlags nDiffFlags
= SFX_PRINTER_ALL
, bool bIsAPI
=false ) SAL_OVERRIDE
;
111 virtual bool HasPrintOptionsPage() const SAL_OVERRIDE
;
112 virtual VclPtr
<SfxTabPage
> CreatePrintOptionsPage( vcl::Window
*pParent
, const SfxItemSet
&rOptions
) SAL_OVERRIDE
;
114 void AddAccessibilityObject( SfxListener
& rObject
);
115 void RemoveAccessibilityObject( SfxListener
& rObject
);
116 void BroadcastAccessibility( const SfxHint
&rHint
);
117 bool HasAccessibilityObjects();
119 const ScPreviewLocationData
& GetLocationData();
120 ScDocument
& GetDocument();
121 SC_DLLPUBLIC ScPreview
* GetPreview() { return pPreview
; }
126 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */