LibreOffice Module sd (master) 1
DrawDocShell.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 <o3tl/span.hxx>
23#include <sfx2/docfac.hxx>
24#include <sfx2/objsh.hxx>
25#include <svl/style.hxx>
26
27#include <glob.hxx>
28#include <pres.hxx>
29#include <sddllapi.h>
30#include "fupoor.hxx"
31
32class FontList;
33class SdDrawDocument;
34class SdPage;
35class SfxPrinter;
38class SfxUndoManager;
39
40namespace sd {
41
42class FrameView;
43class ViewShell;
44class DrawViewShell;
45
46// DrawDocShell
48{
49public:
51 SFX_DECL_OBJECTFACTORY();
52
53private:
55 static void InitInterface_Impl();
56
57public:
60 bool bSdDataObj,
62
64 SfxModelFlags nModelCreationFlags,
65 bool bSdDataObj,
67
69 SdDrawDocument* pDoc,
71 bool bSdDataObj,
73 virtual ~DrawDocShell() override;
74
75 void UpdateRefDevice();
76 virtual void Activate( bool bMDI ) override;
77 virtual void Deactivate( bool bMDI ) override;
78 virtual bool InitNew( const css::uno::Reference< css::embed::XStorage >& xStorage ) override;
79 virtual bool ImportFrom(SfxMedium &rMedium,
80 css::uno::Reference<css::text::XTextRange> const& xInsertPosition)
81 override;
82 virtual bool ConvertFrom( SfxMedium &rMedium ) override;
83 virtual bool Save() override;
84 virtual bool SaveAsOwnFormat( SfxMedium& rMedium ) override;
85 virtual bool ConvertTo( SfxMedium &rMedium ) override;
86 virtual bool SaveCompleted( const css::uno::Reference< css::embed::XStorage >& xStorage ) override;
87
88 virtual bool Load( SfxMedium &rMedium ) override;
89 virtual bool LoadFrom( SfxMedium& rMedium ) override;
90 virtual bool SaveAs( SfxMedium &rMedium ) override;
91
92 virtual ::tools::Rectangle GetVisArea(sal_uInt16 nAspect) const override;
93 virtual void Draw(OutputDevice*, const JobSetup& rSetup, sal_uInt16 nAspect, bool bOutputForScreen) override;
94 virtual SfxUndoManager* GetUndoManager() override;
95 virtual Printer* GetDocumentPrinter() override;
96 virtual void OnDocumentPrinterChanged(Printer* pNewPrinter) override;
97 virtual SfxStyleSheetBasePool* GetStyleSheetPool() override;
98 virtual void FillClass(SvGlobalName* pClassName, SotClipboardFormatId* pFormat, OUString* pFullTypeName, sal_Int32 nFileFormat, bool bTemplate = false ) const override;
99 virtual void SetModified( bool = true ) override;
100 virtual std::shared_ptr<SfxDocumentInfoDialog> CreateDocumentInfoDialog(weld::Window* pParent,
101 const SfxItemSet &rSet) override;
102
103 using SfxObjectShell::GetVisArea;
104 using SfxShell::GetViewShell;
105
106 sd::ViewShell* GetViewShell() { return mpViewShell; }
107 ::sd::FrameView* GetFrameView();
108
109 SdDrawDocument* GetDoc() { return mpDoc;}
110 DocumentType GetDocumentType() const { return meDocType; }
111
112 SfxPrinter* GetPrinter(bool bCreate);
113 void SetPrinter(SfxPrinter *pNewPrinter);
114 void UpdateFontList();
115
116 bool IsInDestruction() const { return mbInDestruction; }
117
118 void CancelSearching();
119
120 void Execute( SfxRequest& rReq );
121 void GetState(SfxItemSet&);
122
123 void Connect(sd::ViewShell* pViewSh);
124 void Disconnect(sd::ViewShell const * pViewSh);
125 void UpdateTablePointers();
126
127 void GotoBookmark(std::u16string_view rBookmark);
128
129 BitmapEx GetPagePreviewBitmap(SdPage* pPage);
130
146 bool CheckPageName(weld::Window* pWin, OUString& rName );
147
148 void SetSlotFilter(bool bEnable = false, o3tl::span<sal_uInt16 const> pSIDs = o3tl::span<sal_uInt16 const>()) { mbFilterEnable = bEnable; mpFilterSIDs = pSIDs; }
149 void ApplySlotFilter() const;
150
151 SfxStyleFamily GetStyleFamily() const { return mnStyleFamily; }
152 void SetStyleFamily( SfxStyleFamily nSF ) { mnStyleFamily = nSF; }
153
156 void OpenBookmark( const OUString& rBookmarkURL );
157
177 bool IsNewPageNameValid( OUString & rInOutPageName, bool bResetStringIfStandardName = false );
178
185 bool IsPageNameUnique(std::u16string_view rPagName) const;
186
195 virtual OutputDevice* GetDocumentRefDev() override;
196
198
199 // ExecuteSpellPopup now handled by DrawDocShell
200 DECL_DLLPRIVATE_LINK( OnlineSpellCallback, SpellCallbackInfo&, void );
201
202 void ClearUndoBuffer();
203
204 std::shared_ptr<model::ColorSet> GetThemeColors() override;
205
206private:
207 static void setEditMode(DrawViewShell* pDrawViewShell, bool isMasterPage);
208 void Construct(bool bClipboard);
209
211 std::unique_ptr<SfxUndoManager> mpUndoManager;
214 std::unique_ptr<FontList> mpFontList;
223 bool mbOwnDocument; // if true, we own mpDoc and will delete it in our d'tor
224};
225
226#ifndef SV_DECL_DRAW_DOC_SHELL_DEFINED
227#define SV_DECL_DRAW_DOC_SHELL_DEFINED
228typedef ::tools::SvRef<DrawDocShell> DrawDocShellRef;
229#endif
230
231} // end of namespace sd
232
233/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SfxStyleFamily mnStyleFamily
DECL_DLLPRIVATE_LINK(RenameSlideHdl, AbstractSvxNameDialog &, bool)
::sd::ViewShell * mpViewShell
DECL_DLLPRIVATE_LINK(OnlineSpellCallback, SpellCallbackInfo &, void)
void Construct(bool bClipboard)
void SetStyleFamily(SfxStyleFamily nSF)
std::unique_ptr< FontList > mpFontList
VclPtr< SfxPrinter > mpPrinter
DocumentType meDocType
DocumentType GetDocumentType() const
SfxStyleFamily GetStyleFamily() const
std::unique_ptr< SfxUndoManager > mpUndoManager
void SetSlotFilter(bool bEnable=false, o3tl::span< sal_uInt16 const > pSIDs=o3tl::span< sal_uInt16 const >())
SdDrawDocument * mpDoc
bool IsInDestruction() const
SdDrawDocument * GetDoc()
o3tl::span< sal_uInt16 const > mpFilterSIDs
Base class of the stacked shells that provide graphical views to Draw and Impress documents and editi...
View for MDIFrame.
Definition: FrameView.hxx:36
Base class of the stacked shell hierarchy.
Definition: ViewShell.hxx:92
An SdWindow contains the actual working area of ViewShell.
Definition: Window.hxx:45
SotClipboardFormatId
#define SD_IF_SDDRAWDOCSHELL
Definition: glob.hxx:25
::tools::SvRef< DrawDocShell > DrawDocShellRef
const ::avmedia::MediaItem * Execute(const SdrMarkView *pSdrView, SfxRequest const &rReq)
void GetState(const SdrMarkView *pSdrView, SfxItemSet &rSet)
DocumentType
SfxObjectCreateMode
#define SD_DLLPUBLIC
Definition: sddllapi.h:27
SfxModelFlags
#define SFX_DECL_INTERFACE(nId)
SfxStyleFamily
void SetPrinter(IDocumentDeviceAccess *, SfxPrinter const *, bool bWeb)