| 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 <config_options.h> |
| 23 |
#include <svx/sdr/contact/objectcontact.hxx> |
| 24 |
#include <svx/svxdllapi.h> |
| 25 |
#include <svx/svdpage.hxx> |
| 26 |
#include <unotools/weakref.hxx> |
| 27 |
|
| 28 |
class SdrObject; |
| 29 |
|
| 30 |
namespace sdr::contact { |
| 31 |
|
| 32 |
class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) ObjectContactPainter : public ObjectContact |
| 33 |
{ |
| 34 |
protected: |
| 35 |
// Hierarchy access methods |
| 36 |
virtual sal_uInt32 GetPaintObjectCount() const = 0; |
| 37 |
virtual ViewContact& GetPaintObjectViewContact(sal_uInt32 nIndex) = 0; |
| 38 |
|
| 39 |
public: |
| 40 |
// basic constructor/destructor |
| 41 |
ObjectContactPainter(); |
| 42 |
virtual ~ObjectContactPainter() override; |
| 43 |
}; |
| 44 |
|
| 45 |
// typedef for transferring SdrObject |
| 46 |
typedef ::std::vector< SdrObject* > SdrObjectVector; |
| 47 |
|
| 48 |
class SVXCORE_DLLPUBLIC ObjectContactOfObjListPainter final : public ObjectContactPainter |
| 49 |
{ |
| 50 |
// Target OutputDevice |
| 51 |
OutputDevice& mrTargetOutputDevice; |
| 52 |
|
| 53 |
// Set StartPoint for next run, also given in constructor |
| 54 |
SdrObjectVector maStartObjects; |
| 55 |
|
| 56 |
// the processed page which is the base e.g. for PageNumberFields |
| 57 |
const SdrPage* mpProcessedPage; |
| 58 |
|
| 59 |
// Hierarchy access methods |
| 60 |
virtual sal_uInt32 GetPaintObjectCount() const override; |
| 61 |
virtual ViewContact& GetPaintObjectViewContact(sal_uInt32 nIndex) override; |
| 62 |
|
| 63 |
public: |
| 64 |
// basic constructor/destructor |
| 65 |
ObjectContactOfObjListPainter( |
| 66 |
OutputDevice& rTargetDevice, |
| 67 |
SdrObjectVector&& rObjects, |
| 68 |
const SdrPage* pProcessedPage); |
| 69 |
virtual ~ObjectContactOfObjListPainter() override; |
| 70 |
|
| 71 |
// Process the whole displaying |
| 72 |
virtual void ProcessDisplay(DisplayInfo& rDisplayInfo) override; |
| 73 |
|
| 74 |
// recording MetaFile? Default is false |
| 75 |
virtual bool isOutputToRecordingMetaFile() const override; |
| 76 |
|
| 77 |
// pdf export? Default is false |
| 78 |
virtual bool isOutputToPDFFile() const override; |
| 79 |
virtual bool isExportTaggedPDF() const override; |
| 80 |
virtual ::vcl::PDFExtOutDevData const* GetPDFExtOutDevData() const override; |
| 81 |
|
| 82 |
virtual OutputDevice* TryToGetOutputDevice() const override; |
| 83 |
}; |
| 84 |
|
| 85 |
class ObjectContactOfPagePainter : public ObjectContactPainter |
| 86 |
{ |
| 87 |
// the original ObjectContact this painter is working on |
| 88 |
ObjectContact& mrOriginalObjectContact; |
| 89 |
|
| 90 |
// Set StartPoint for next run, also given in constructor |
| 91 |
unotools::WeakReference<SdrPage> mxStartPage; |
| 92 |
|
| 93 |
protected: |
| 94 |
// Hierarchy access methods |
| 95 |
virtual sal_uInt32 GetPaintObjectCount() const override; |
| 96 |
virtual ViewContact& GetPaintObjectViewContact(sal_uInt32 nIndex) override; |
| 97 |
|
| 98 |
public: |
| 99 |
// basic constructor |
| 100 |
ObjectContactOfPagePainter(ObjectContact& rOriginalObjectContact); |
| 101 |
virtual ~ObjectContactOfPagePainter() override; |
| 102 |
|
| 103 |
// set another page |
| 104 |
void SetStartPage(const SdrPage* pPage); |
| 105 |
const SdrPage* GetStartPage() const { return mxStartPage.get().get(); } |
| 106 |
SdrPage* GetStartPage() { return mxStartPage.get().get(); } |
| 107 |
|
| 108 |
virtual OutputDevice* TryToGetOutputDevice() const override; |
| 109 |
}; |
| 110 |
|
| 111 |
} |
| 112 |
|
| 113 |
|
| 114 |
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |