Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sw / source / core / inc / DocumentDeviceManager.hxx
blobe99c54c1002cb844b215327dd69e12a6de243afb
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 .
19 #ifndef INCLUDED_SW_SOURCE_CORE_INC_DOCUMENTDEVICEMANAGER_HXX
20 #define INCLUDED_SW_SOURCE_CORE_INC_DOCUMENTDEVICEMANAGER_HXX
22 #include <IDocumentDeviceAccess.hxx>
23 #include <vcl/vclptr.hxx>
24 #include <memory>
26 class SwDoc;
27 class SfxPrinter;
28 class VirtualDevice;
29 class OutputDevice;
30 class JobSetup;
31 class SwPrintData;
33 namespace sw
35 class DocumentDeviceManager final : public IDocumentDeviceAccess
37 public:
38 DocumentDeviceManager(SwDoc& i_rSwdoc);
40 SfxPrinter* getPrinter(/*[in]*/ bool bCreate) const override;
42 void setPrinter(/*[in]*/ SfxPrinter* pP, /*[in]*/ bool bDeleteOld,
43 /*[in]*/ bool bCallPrtDataChanged) override;
45 VirtualDevice* getVirtualDevice(/*[in]*/ bool bCreate) const override;
47 void setVirtualDevice(/*[in]*/ VirtualDevice* pVd) override;
49 OutputDevice* getReferenceDevice(/*[in]*/ bool bCreate) const override;
51 void setReferenceDeviceType(/*[in]*/ bool bNewVirtual, /*[in]*/ bool bNewHiRes) override;
53 const JobSetup* getJobsetup() const override;
55 void setJobsetup(/*[in]*/ const JobSetup& rJobSetup) override;
57 const SwPrintData& getPrintData() const override;
59 void setPrintData(/*[in]*/ const SwPrintData& rPrtData) override;
61 virtual ~DocumentDeviceManager() override;
63 private:
64 DocumentDeviceManager(DocumentDeviceManager const&) = delete;
65 DocumentDeviceManager& operator=(DocumentDeviceManager const&) = delete;
67 VirtualDevice& CreateVirtualDevice_() const;
68 SfxPrinter& CreatePrinter_() const;
69 void PrtDataChanged(); /**< Printer or JobSetup altered.
70 Care has to be taken of the necessary
71 invalidations and notifications. */
73 SwDoc& m_rDoc;
74 VclPtr<SfxPrinter> mpPrt;
75 VclPtr<VirtualDevice> mpVirDev;
76 std::unique_ptr<SwPrintData> mpPrtData;
79 #endif
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */