tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / sc / source / ui / inc / prevwsh.hxx
blob76a338d5945dd4651364bef07e28b4689e4aea03
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 #pragma once
22 #include <types.hxx>
23 #include <scdllapi.h>
25 #include <sfx2/viewsh.hxx>
26 #include <sfx2/zoomitem.hxx>
27 #include <svtools/scrolladaptor.hxx>
28 #include <vcl/syswin.hxx>
30 #include <shellids.hxx>
32 class ScDocument;
33 class ScDocShell;
34 class ScPreview;
35 struct ScHeaderFieldData;
36 class ScPreviewLocationData;
37 class CommandEvent;
38 class SfxViewFactory;
40 class SAL_DLLPUBLIC_RTTI ScPreviewShell final : public SfxViewShell
42 ScDocShell* pDocShell;
44 VclPtr<SystemWindow> mpFrameWindow;
45 VclPtr<ScPreview> pPreview; // Output window
46 VclPtr<ScrollAdaptor> pHorScroll;
47 VclPtr<ScrollAdaptor> pVerScroll;
49 TriState nSourceDesignMode; // form design mode from TabView
50 SvxZoomType eZoom;
51 tools::Long nMaxVertPos;
52 tools::Long nPrevHThumbPos;
53 tools::Long nPrevVThumbPos;
55 std::unique_ptr<SfxBroadcaster> pAccessibilityBroadcaster;
56 bool GetPageSize( Size& aPageSize );
57 private:
58 void Construct( vcl::Window* pParent );
59 DECL_LINK( HorzScrollHandler, weld::Scrollbar&, void );
60 DECL_LINK( VertScrollHandler, weld::Scrollbar&, void );
61 void ScrollHandler(ScrollAdaptor* pScrollBar);
62 DECL_LINK( CloseHdl, SystemWindow&, void);
63 void DoScroll( sal_uInt16 nMode );
64 void ExitPreview();
66 virtual void Activate(bool bMDI) override;
67 void AdjustPosSizePixel( const Point &rPos, const Size &rSize );
69 virtual void InnerResizePixel( const Point &rOfs, const Size &rSize, bool inplaceEditModeChange ) override;
70 virtual void OuterResizePixel( const Point &rOfs, const Size &rSize ) override;
72 virtual void WriteUserData(OUString &, bool bBrowse = false) override;
73 virtual void ReadUserData(const OUString &, bool bBrowse = false) override;
75 virtual void WriteUserDataSequence (css::uno::Sequence < css::beans::PropertyValue >& ) override;
76 virtual void ReadUserDataSequence (const css::uno::Sequence < css::beans::PropertyValue >& ) override;
78 public:
79 SFX_DECL_INTERFACE(SCID_PREVIEW_SHELL)
80 SFX_DECL_VIEWFACTORY(ScPreviewShell);
82 private:
83 /// SfxInterface initializer.
84 static void InitInterface_Impl();
86 public:
87 ScPreviewShell(SfxViewFrame& rViewFrame, SfxViewShell* pOldSh);
89 virtual ~ScPreviewShell() override;
91 void InitStartTable(SCTAB nTab);
93 void UpdateScrollBars();
94 void UpdateNeededScrollBars(bool bFromZoom);
95 bool ScrollCommand( const CommandEvent& rCEvt );
97 void Execute( SfxRequest& rReq );
98 void GetState( SfxItemSet& rSet );
100 void FillFieldData( ScHeaderFieldData& rData );
102 TriState GetSourceDesignMode() const { return nSourceDesignMode; }
104 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
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;
111 void AddAccessibilityObject( SfxListener& rObject );
112 void RemoveAccessibilityObject( SfxListener& rObject );
113 void BroadcastAccessibility( const SfxHint &rHint );
114 bool HasAccessibilityObjects() const;
116 const ScPreviewLocationData& GetLocationData();
117 ScDocument& GetDocument();
118 ScPreview* GetPreview() { return pPreview; }
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */