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