Branch data Line data Source code
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 _SDR_CONTACT_OBJECTCONTACTOFOBJLISTPAINTER_HXX
21 : : #define _SDR_CONTACT_OBJECTCONTACTOFOBJLISTPAINTER_HXX
22 : :
23 : : #include <svx/sdr/contact/objectcontact.hxx>
24 : : #include "svx/svxdllapi.h"
25 : : #include <svx/svdpage.hxx>
26 : :
27 : : //////////////////////////////////////////////////////////////////////////////
28 : : // predeclarations
29 : :
30 : : class SdrPage;
31 : : class SdrObject;
32 : :
33 : : //////////////////////////////////////////////////////////////////////////////
34 : :
35 : : namespace sdr
36 : : {
37 : : namespace contact
38 : : {
39 : : class SVX_DLLPUBLIC ObjectContactPainter : public ObjectContact
40 : : {
41 : : protected:
42 : : // Hierarchy access methods
43 : : virtual sal_uInt32 GetPaintObjectCount() const = 0;
44 : : virtual ViewContact& GetPaintObjectViewContact(sal_uInt32 nIndex) const = 0;
45 : :
46 : : public:
47 : : // basic constructor/destructor
48 : : ObjectContactPainter();
49 : : virtual ~ObjectContactPainter();
50 : : };
51 : : } // end of namespace contact
52 : : } // end of namespace sdr
53 : :
54 : : //////////////////////////////////////////////////////////////////////////////
55 : :
56 : : namespace sdr
57 : : {
58 : : namespace contact
59 : : {
60 : : // typedef for transferring SdrObject
61 : : typedef ::std::vector< SdrObject* > SdrObjectVector;
62 : :
63 : : class SVX_DLLPUBLIC ObjectContactOfObjListPainter : public ObjectContactPainter
64 : : {
65 : : protected:
66 : : // Target OutputDevice
67 : : OutputDevice& mrTargetOutputDevice;
68 : :
69 : : // Set StartPoint for next run, also given in constructor
70 : : SdrObjectVector maStartObjects;
71 : :
72 : : // the processed page which is the base e.g. for PageNumberFields
73 : : const SdrPage* mpProcessedPage;
74 : :
75 : : // Hierarchy access methods
76 : : virtual sal_uInt32 GetPaintObjectCount() const;
77 : : virtual ViewContact& GetPaintObjectViewContact(sal_uInt32 nIndex) const;
78 : :
79 : : public:
80 : : // basic constructor/destructor
81 : : ObjectContactOfObjListPainter(
82 : : OutputDevice& rTargetDevice,
83 : : const SdrObjectVector& rObjects,
84 : : const SdrPage* pProcessedPage);
85 : : virtual ~ObjectContactOfObjListPainter();
86 : :
87 : : // Process the whole displaying
88 : : virtual void ProcessDisplay(DisplayInfo& rDisplayInfo);
89 : :
90 : : // VirtualDevice? Default is false
91 : : virtual bool isOutputToVirtualDevice() const;
92 : :
93 : : // recording MetaFile? Default is false
94 : : virtual bool isOutputToRecordingMetaFile() const;
95 : :
96 : : // pdf export? Default is false
97 : : virtual bool isOutputToPDFFile() const;
98 : :
99 : : // access to OutputDevice. May return 0L like the default implementations do. Needs to be overloaded as needed.
100 : : virtual OutputDevice* TryToGetOutputDevice() const;
101 : : };
102 : : } // end of namespace contact
103 : : } // end of namespace sdr
104 : :
105 : : //////////////////////////////////////////////////////////////////////////////
106 : :
107 : : namespace sdr
108 : : {
109 : : namespace contact
110 : : {
111 : : class ObjectContactOfPagePainter : public ObjectContactPainter
112 : : {
113 : : protected:
114 : : // the original ObjectContact this painter is working on
115 : : ObjectContact& mrOriginalObjectContact;
116 : :
117 : : // Set StartPoint for next run, also given in constructor
118 : : SdrPageWeakRef mxStartPage;
119 : :
120 : : // Hierarchy access methods
121 : : virtual sal_uInt32 GetPaintObjectCount() const;
122 : : virtual ViewContact& GetPaintObjectViewContact(sal_uInt32 nIndex) const;
123 : :
124 : : public:
125 : : // basic constructor
126 : : ObjectContactOfPagePainter(
127 : : const SdrPage* pPage,
128 : : ObjectContact& rOriginalObjectContact);
129 : : virtual ~ObjectContactOfPagePainter();
130 : :
131 : : // set another page
132 : : void SetStartPage(const SdrPage* pPage);
133 : 11 : const SdrPage* GetStartPage() const { return mxStartPage.get(); }
134 : :
135 : : // access to OutputDevice. May return 0L like the default implementations do. Needs to be overloaded as needed.
136 : : virtual OutputDevice* TryToGetOutputDevice() const;
137 : : };
138 : : } // end of namespace contact
139 : : } // end of namespace sdr
140 : :
141 : : //////////////////////////////////////////////////////////////////////////////
142 : :
143 : : #endif //_SDR_CONTACT_OBJECTCONTACTOFOBJLISTPAINTER_HXX
144 : :
145 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|