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