1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
20 #ifndef INCLUDED_SVX_SDR_CONTACT_OBJECTCONTACTOFOBJLISTPAINTER_HXX
21 #define INCLUDED_SVX_SDR_CONTACT_OBJECTCONTACTOFOBJLISTPAINTER_HXX
23 #include <svx/sdr/contact/objectcontact.hxx>
24 #include <svx/svxdllapi.h>
25 #include <svx/svdpage.hxx>
26 #include <tools/weakbase.hxx>
31 namespace sdr
{ namespace contact
{
33 class SVX_DLLPUBLIC ObjectContactPainter
: public ObjectContact
36 // Hierarchy access methods
37 virtual sal_uInt32
GetPaintObjectCount() const = 0;
38 virtual ViewContact
& GetPaintObjectViewContact(sal_uInt32 nIndex
) = 0;
41 // basic constructor/destructor
42 ObjectContactPainter();
43 virtual ~ObjectContactPainter() override
;
46 // typedef for transferring SdrObject
47 typedef ::std::vector
< SdrObject
* > SdrObjectVector
;
49 class SVX_DLLPUBLIC ObjectContactOfObjListPainter final
: public ObjectContactPainter
51 // Target OutputDevice
52 OutputDevice
& mrTargetOutputDevice
;
54 // Set StartPoint for next run, also given in constructor
55 SdrObjectVector maStartObjects
;
57 // the processed page which is the base e.g. for PageNumberFields
58 const SdrPage
* mpProcessedPage
;
60 // Hierarchy access methods
61 virtual sal_uInt32
GetPaintObjectCount() const override
;
62 virtual ViewContact
& GetPaintObjectViewContact(sal_uInt32 nIndex
) override
;
65 // basic constructor/destructor
66 ObjectContactOfObjListPainter(
67 OutputDevice
& rTargetDevice
,
68 const SdrObjectVector
& rObjects
,
69 const SdrPage
* pProcessedPage
);
70 virtual ~ObjectContactOfObjListPainter() override
;
72 // Process the whole displaying
73 virtual void ProcessDisplay(DisplayInfo
& rDisplayInfo
) override
;
75 // recording MetaFile? Default is false
76 virtual bool isOutputToRecordingMetaFile() const override
;
78 // pdf export? Default is false
79 virtual bool isOutputToPDFFile() const override
;
81 virtual OutputDevice
* TryToGetOutputDevice() const override
;
84 class ObjectContactOfPagePainter
: public ObjectContactPainter
86 // the original ObjectContact this painter is working on
87 ObjectContact
& mrOriginalObjectContact
;
89 // Set StartPoint for next run, also given in constructor
90 tools::WeakReference
<SdrPage
> mxStartPage
;
93 // Hierarchy access methods
94 virtual sal_uInt32
GetPaintObjectCount() const override
;
95 virtual ViewContact
& GetPaintObjectViewContact(sal_uInt32 nIndex
) override
;
99 ObjectContactOfPagePainter(ObjectContact
& rOriginalObjectContact
);
100 virtual ~ObjectContactOfPagePainter() override
;
103 void SetStartPage(const SdrPage
* pPage
);
104 const SdrPage
* GetStartPage() const { return mxStartPage
.get(); }
105 SdrPage
* GetStartPage() { return mxStartPage
.get(); }
107 virtual OutputDevice
* TryToGetOutputDevice() const override
;
113 #endif // INCLUDED_SVX_SDR_CONTACT_OBJECTCONTACTOFOBJLISTPAINTER_HXX
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */