LibreOffice Module sc (master) 1
prevwsh.hxx
Go to the documentation of this file.
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#pragma once
21
22#include <types.hxx>
23#include <scdllapi.h>
24
25#include <sfx2/viewsh.hxx>
26#include <sfx2/zoomitem.hxx>
28#include <vcl/syswin.hxx>
29
30#include <shellids.hxx>
31
32class ScDocument;
33class ScDocShell;
34class ScPreview;
37class CommandEvent;
38class SfxViewFactory;
39
41{
43
45 VclPtr<ScPreview> pPreview; // Output window
48
49 TriState nSourceDesignMode; // form design mode from TabView
54
55 std::unique_ptr<SfxBroadcaster> pAccessibilityBroadcaster;
56 bool GetPageSize( Size& aPageSize );
57private:
58 void Construct( vcl::Window* pParent );
59 DECL_DLLPRIVATE_LINK( HorzScrollHandler, weld::Scrollbar&, void );
60 DECL_DLLPRIVATE_LINK( VertScrollHandler, weld::Scrollbar&, void );
61 void ScrollHandler(ScrollAdaptor* pScrollBar);
63 void DoScroll( sal_uInt16 nMode );
64 void ExitPreview();
65
66 virtual void Activate(bool bMDI) override;
67 void AdjustPosSizePixel( const Point &rPos, const Size &rSize );
68
69 virtual void InnerResizePixel( const Point &rOfs, const Size &rSize, bool inplaceEditModeChange ) override;
70 virtual void OuterResizePixel( const Point &rOfs, const Size &rSize ) override;
71
72 virtual void WriteUserData(OUString &, bool bBrowse = false) override;
73 virtual void ReadUserData(const OUString &, bool bBrowse = false) override;
74
75 virtual void WriteUserDataSequence (css::uno::Sequence < css::beans::PropertyValue >& ) override;
76 virtual void ReadUserDataSequence (const css::uno::Sequence < css::beans::PropertyValue >& ) override;
77
78public:
80 SFX_DECL_VIEWFACTORY(ScPreviewShell);
81
82private:
84 static void InitInterface_Impl();
85
86public:
87 ScPreviewShell(SfxViewFrame& rViewFrame, SfxViewShell* pOldSh);
88
89 virtual ~ScPreviewShell() override;
90
91 void InitStartTable(SCTAB nTab);
92
93 void UpdateScrollBars();
94 void UpdateNeededScrollBars(bool bFromZoom);
95 bool ScrollCommand( const CommandEvent& rCEvt );
96
97 void Execute( SfxRequest& rReq );
98 void GetState( SfxItemSet& rSet );
99
100 void FillFieldData( ScHeaderFieldData& rData );
101
102 TriState GetSourceDesignMode() const { return nSourceDesignMode; }
103
104 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
105
106 virtual SfxPrinter* GetPrinter( bool bCreate = false ) override;
107 virtual sal_uInt16 SetPrinter( SfxPrinter* pNewPrinter, SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL ) override;
108 virtual bool HasPrintOptionsPage() const override;
109 virtual std::unique_ptr<SfxTabPage> CreatePrintOptionsPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet &rOptions) override;
110
111 void AddAccessibilityObject( SfxListener& rObject );
112 void RemoveAccessibilityObject( SfxListener& rObject );
113 void BroadcastAccessibility( const SfxHint &rHint );
114 bool HasAccessibilityObjects() const;
115
116 const ScPreviewLocationData& GetLocationData();
117 ScDocument& GetDocument();
118 ScPreview* GetPreview() { return pPreview; }
119};
120
121/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
VclPtr< ScrollAdaptor > pVerScroll
Definition: prevwsh.hxx:47
DECL_DLLPRIVATE_LINK(VertScrollHandler, weld::Scrollbar &, void)
tools::Long nPrevVThumbPos
Definition: prevwsh.hxx:53
TriState nSourceDesignMode
Definition: prevwsh.hxx:49
VclPtr< ScrollAdaptor > pHorScroll
Definition: prevwsh.hxx:46
VclPtr< ScPreview > pPreview
Definition: prevwsh.hxx:45
std::unique_ptr< SfxBroadcaster > pAccessibilityBroadcaster
Definition: prevwsh.hxx:55
ScDocShell * pDocShell
Definition: prevwsh.hxx:42
ScPreview * GetPreview()
Definition: prevwsh.hxx:118
SvxZoomType eZoom
Definition: prevwsh.hxx:50
tools::Long nMaxVertPos
Definition: prevwsh.hxx:51
DECL_DLLPRIVATE_LINK(HorzScrollHandler, weld::Scrollbar &, void)
VclPtr< SystemWindow > mpFrameWindow
Definition: prevwsh.hxx:44
DECL_DLLPRIVATE_LINK(CloseHdl, SystemWindow &, void)
tools::Long nPrevHThumbPos
Definition: prevwsh.hxx:52
virtual SfxPrinter * GetPrinter(bool bCreate=false)
virtual void Activate(bool IsMDIActivate) override
virtual void WriteUserData(OUString &, bool bBrowse=false)
virtual void InnerResizePixel(const Point &rOfs, const Size &rSize, bool inplaceEditModeChange)
virtual void OuterResizePixel(const Point &rOfs, const Size &rSize)
virtual void ReadUserDataSequence(const css::uno::Sequence< css::beans::PropertyValue > &)
virtual bool HasPrintOptionsPage() const
virtual void WriteUserDataSequence(css::uno::Sequence< css::beans::PropertyValue > &)
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual void ReadUserData(const OUString &, bool bBrowse=false)
virtual sal_uInt16 SetPrinter(SfxPrinter *pNewPrinter, SfxPrinterChangeFlags nDiffFlags=SFX_PRINTER_ALL)
virtual std::unique_ptr< SfxTabPage > CreatePrintOptionsPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rOptions)
TriState
long Long
#define SC_DLLPUBLIC
Definition: scdllapi.h:27
#define SFX_DECL_INTERFACE(nId)
#define SCID_PREVIEW_SHELL
Definition: shellids.hxx:30
sal_Int16 SCTAB
Definition: types.hxx:22
SfxPrinterChangeFlags
SvxZoomType