/src/libreoffice/include/svx/svdpage.hxx
Line | Count | Source |
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 <cppuhelper/weak.hxx> |
23 | | #include <svl/stylesheetuser.hxx> |
24 | | #include <vcl/prntypes.hxx> |
25 | | #include <svl/itemset.hxx> |
26 | | #include <svx/sdrpageuser.hxx> |
27 | | #include <svx/sdr/contact/viewobjectcontactredirector.hxx> |
28 | | #include <svx/sdrmasterpagedescriptor.hxx> |
29 | | #include <svx/svxdllapi.h> |
30 | | #include <com/sun/star/container/XIndexAccess.hpp> |
31 | | #include <com/sun/star/drawing/XDrawPage.hpp> |
32 | | #include <svx/svdobj.hxx> |
33 | | #include <unotools/weakref.hxx> |
34 | | #include <memory> |
35 | | #include <optional> |
36 | | #include <vector> |
37 | | #include <deque> |
38 | | #include <tools/UniqueID.hxx> |
39 | | |
40 | | // predefines |
41 | | namespace model { class Theme; } |
42 | | namespace reportdesign { class OSection; } |
43 | | namespace sdr::contact { class ViewContact; } |
44 | | namespace sdr::annotation { class Annotation; } |
45 | | class SdrPage; |
46 | | class SdrModel; |
47 | | class SdrPageView; |
48 | | class SdrLayerAdmin; |
49 | | class SdrLayerIDSet; |
50 | | class Color; |
51 | | class SfxStyleSheet; |
52 | | |
53 | | //////////////////////////////////////////////////////////////////////////////////////////////////// |
54 | | // |
55 | | // SdrObjList |
56 | | // E3dObjList |
57 | | // SdrPage -> see continuation there |
58 | | |
59 | | // class SdrObjList |
60 | | class SVXCORE_DLLPUBLIC SdrObjList |
61 | | { |
62 | | friend class SdrObjListIter; |
63 | | friend class SdrEditView; |
64 | | |
65 | | private: |
66 | | SdrObjList(const SdrObjList& rSrcList) = delete; |
67 | | SdrObjList &operator=(const SdrObjList& rSrcList) = delete; |
68 | | |
69 | | protected: |
70 | | SAL_DLLPRIVATE void RecalcRects(); |
71 | | |
72 | | private: |
73 | | /// simple ActionChildInserted forwarder to have it on a central place |
74 | | SAL_DLLPRIVATE static void impChildInserted(SdrObject const & rChild); |
75 | | |
76 | | // tdf#116879 Clear SdrObjList, no Undo done. Used from destructor, but also |
77 | | // from other places. |
78 | | SAL_DLLPRIVATE void impClearSdrObjList(); |
79 | | |
80 | | protected: |
81 | | // protected constructor to make clear that this class should only |
82 | | // be used as base for derivations, not naked. See getSdrModelFromSdrObjList |
83 | | // which is pure virtual to force this, too |
84 | | SAL_DLLPRIVATE SdrObjList(); |
85 | | SAL_DLLPRIVATE virtual ~SdrObjList(); |
86 | | |
87 | | public: |
88 | | // SdrModel/SdrPage access on SdrObjList level |
89 | | virtual SdrPage* getSdrPageFromSdrObjList() const; |
90 | | virtual SdrObject* getSdrObjectFromSdrObjList() const; |
91 | | |
92 | | SAL_DLLPRIVATE void CopyObjects(const SdrObjList& rSrcList); |
93 | | static OString GetObjectRectangles(const SdrObjList& rSrcList); |
94 | | |
95 | | // tdf#116879 clean up everything (without Undo), plus broadcasting |
96 | | // changes. Split to this call and a private one (impClearSdrObjList) |
97 | | // that allows cleanup without broadcasting in the destructor |
98 | | void ClearSdrObjList(); |
99 | | |
100 | | /// recalculate order numbers / ZIndex |
101 | | void RecalcObjOrdNums(); |
102 | 634k | bool IsObjOrdNumsDirty() const { return mbObjOrdNumsDirty; } |
103 | | virtual void NbcInsertObject(SdrObject* pObj, size_t nPos=SAL_MAX_SIZE); |
104 | | virtual void InsertObject(SdrObject* pObj, size_t nPos=SAL_MAX_SIZE); |
105 | | SAL_DLLPRIVATE void sort( std::vector<sal_Int32>& sortOrder ); |
106 | | |
107 | | void InsertObjectThenMakeNameUnique(SdrObject* pObj); |
108 | | void InsertObjectThenMakeNameUnique(SdrObject* pObj, std::unordered_set<rtl::OUString>& rNameSet, size_t nPos=SAL_MAX_SIZE); |
109 | | |
110 | | /// remove from list without delete |
111 | | virtual rtl::Reference<SdrObject> NbcRemoveObject(size_t nObjNum); |
112 | | virtual rtl::Reference<SdrObject> RemoveObject(size_t nObjNum); |
113 | | |
114 | | /// Replace existing object by different one. |
115 | | /// Same as Remove(old)+Insert(new) but faster because the order numbers |
116 | | /// do not have to be set dirty. |
117 | | virtual rtl::Reference<SdrObject> ReplaceObject(SdrObject* pNewObj, size_t nObjNum); |
118 | | |
119 | | /// Modify ZOrder of an SdrObject |
120 | | virtual SdrObject* SetObjectOrdNum(size_t nOldObjNum, size_t nNewObjNum); |
121 | | |
122 | | /// Modify ZOrder of an SdrObject, object must already be in the list |
123 | | SAL_DLLPRIVATE void SetExistingObjectOrdNum(SdrObject* pExistingObj, size_t nNewObjNum); |
124 | | |
125 | | void SetSdrObjListRectsDirty(); |
126 | | |
127 | | const tools::Rectangle& GetAllObjSnapRect() const; |
128 | | const tools::Rectangle& GetAllObjBoundRect() const; |
129 | | |
130 | | /// reformat all text objects, e.g. when changing printer |
131 | | SAL_DLLPRIVATE void NbcReformatAllTextObjects(); |
132 | | SAL_DLLPRIVATE void ReformatAllTextObjects(); |
133 | | |
134 | | /** #103122# reformats all edge objects that are connected to other objects */ |
135 | | SAL_DLLPRIVATE void ReformatAllEdgeObjects(); |
136 | | |
137 | | /// convert attributes of the style to hard formatting |
138 | | SAL_DLLPRIVATE void BurnInStyleSheetAttributes(); |
139 | | |
140 | | size_t GetObjCount() const; |
141 | | SdrObject* GetObj(size_t nNum) const; |
142 | | SdrObject* GetObjByName(std::u16string_view sName) const; |
143 | | |
144 | | /// linked page or linked group object |
145 | | virtual bool IsReadOnly() const; |
146 | | |
147 | | /** Makes the object list flat, i.e. the object list content are |
148 | | then tree leaves |
149 | | |
150 | | This method travels recursively over all group objects in this |
151 | | list, extracts the content, inserts it flat to the list and |
152 | | removes the group object afterwards. |
153 | | */ |
154 | | SAL_DLLPRIVATE void FlattenGroups(); |
155 | | |
156 | | /** Ungroup the object at the given index |
157 | | |
158 | | This method ungroups the content of the group object at the |
159 | | given index, i.e. the content is put flat into the object list |
160 | | (if the object at the given index is no group, this method is |
161 | | a no-op). If the group itself contains group objects, the |
162 | | operation is performed recursively, such that the content of |
163 | | the given object contains no groups afterwards. |
164 | | */ |
165 | | SAL_DLLPRIVATE void UnGroupObj( size_t nObjNum ); |
166 | | |
167 | | /** Return whether there is an explicit, user defined, object navigation |
168 | | order. When there is one this method returns <TRUE/> and the |
169 | | GetObjectForNavigationPosition() and |
170 | | SdrObject::GetNavigationPosition() methods will return values |
171 | | different from those returned by SdrObject::GetOrdNum() and |
172 | | GetObj(). |
173 | | */ |
174 | | bool HasObjectNavigationOrder() const; |
175 | | |
176 | | /** Set the navigation position of the given object to the specified |
177 | | value. Note that this changes the navigation position for all |
178 | | objects on or following the old or new position. |
179 | | */ |
180 | | void SetObjectNavigationPosition ( |
181 | | SdrObject& rObject, |
182 | | const sal_uInt32 nNewNavigationPosition); |
183 | | |
184 | | /** Return the object for the given navigation position. When there is |
185 | | a user defined navigation order, i.e. mxNavigationOrder is not NULL, |
186 | | then that is used to look up the object. Otherwise the z-order is |
187 | | used by looking up the object in maList. |
188 | | @param nNavigationPosition |
189 | | Valid values include 0 and are smaller than the number of |
190 | | objects as returned by GetObjCount(). |
191 | | @return |
192 | | The returned pointer is NULL for invalid positions. |
193 | | */ |
194 | | SAL_DLLPRIVATE SdrObject* GetObjectForNavigationPosition (const sal_uInt32 nNavigationPosition) const; |
195 | | |
196 | | /** Restore the navigation order to that defined by the z-order. |
197 | | */ |
198 | | void ClearObjectNavigationOrder(); |
199 | | |
200 | | /** Set the navigation position of all SdrObjects to their position in |
201 | | the mxNavigationOrder list. This method returns immediately when no |
202 | | update is necessary. |
203 | | @return |
204 | | This method returns <TRUE/> when the navigation positions stored |
205 | | in SdrObjects are up to date. |
206 | | It returns <FALSE/> when the navigation positions are not valid, |
207 | | for example because no explicit navigation order has been |
208 | | defined, i.e. HasObjectNavigationOrder() would return <FALSE/>. |
209 | | */ |
210 | | SAL_DLLPRIVATE bool RecalcNavigationPositions(); |
211 | | |
212 | | /** Set the navigation order to the one defined by the given list of |
213 | | XShape objects. |
214 | | @param rxOrder |
215 | | When this is an empty reference then the navigation order is |
216 | | reset to the z-order. The preferred way to do this, however, is |
217 | | to call ClearObjectNavigationOrder(). |
218 | | Otherwise this list is expected to contain all the shapes in the |
219 | | called SdrObjList. |
220 | | */ |
221 | | void SetNavigationOrder (const css::uno::Reference< |
222 | | css::container::XIndexAccess>& rxOrder); |
223 | | |
224 | | SAL_DLLPRIVATE virtual void dumpAsXml(xmlTextWriterPtr pWriter) const; |
225 | | |
226 | | typedef std::deque<rtl::Reference<SdrObject>> SdrObjectDeque; |
227 | | |
228 | 2.11M | SdrObjectDeque::const_iterator begin() const { return maList.begin(); } |
229 | 1.98M | SdrObjectDeque::const_iterator end() const { return maList.end(); } |
230 | 0 | SdrObjectDeque::const_reverse_iterator rbegin() const { return maList.rbegin(); } |
231 | 0 | SdrObjectDeque::const_reverse_iterator rend() const { return maList.rend(); } |
232 | | |
233 | | private: |
234 | | tools::Rectangle maSdrObjListOutRect; |
235 | | tools::Rectangle maSdrObjListSnapRect; |
236 | | SdrObjectDeque maList; |
237 | | /// This list, if it exists, defines the navigation order. If it does |
238 | | /// not exist then maList defines the navigation order. |
239 | | std::optional<std::vector<unotools::WeakReference<SdrObject>>> mxNavigationOrder; |
240 | | bool mbObjOrdNumsDirty; |
241 | | bool mbRectsDirty; |
242 | | /// This flag is <TRUE/> when the mpNavigation list has been changed but |
243 | | /// the indices of the referenced SdrObjects still have their old values. |
244 | | bool mbIsNavigationOrderDirty; |
245 | | |
246 | | /** Insert an SdrObject into maList. Do not modify the maList member |
247 | | directly. |
248 | | @param rObject |
249 | | The object to insert into the object list. |
250 | | @param nInsertPosition |
251 | | The given object is inserted before the object at this |
252 | | position. Valid values include 0 (the object is inserted at the |
253 | | head of the list) and the number of objects in the list as |
254 | | returned by GetObjCount() (the object is inserted at the end of |
255 | | the list.) |
256 | | */ |
257 | | SAL_DLLPRIVATE void InsertObjectIntoContainer ( |
258 | | SdrObject& rObject, |
259 | | const sal_uInt32 nInsertPosition); |
260 | | |
261 | | /** Replace an object in the object list. |
262 | | @param rObject |
263 | | The new object that replaces the one in the list at the |
264 | | specified position. |
265 | | @param nObjectPosition |
266 | | The object at this position in the object list is replaced by |
267 | | the given object. Valid values include 0 and are smaller than |
268 | | the number of objects in the list. |
269 | | */ |
270 | | SAL_DLLPRIVATE void ReplaceObjectInContainer ( |
271 | | SdrObject& rObject, |
272 | | const sal_uInt32 nObjectPosition); |
273 | | |
274 | | /** Remove an object from the object list. |
275 | | The object list has to contain at least one element. |
276 | | @param nObjectPosition |
277 | | The object at this position is removed from the object list. |
278 | | Valid values include 0 and are smaller than the number of |
279 | | objects in the list. |
280 | | */ |
281 | | SAL_DLLPRIVATE void RemoveObjectFromContainer ( |
282 | | const sal_uInt32 nObjectPosition); |
283 | | |
284 | | SAL_DLLPRIVATE void ImplReformatAllEdgeObjects(const SdrObjList& ); |
285 | | }; |
286 | | |
287 | | // Used for all methods which return a page number |
288 | 213k | #define SDRPAGE_NOTFOUND 0xFFFF |
289 | | |
290 | | /// for the snap-to-grid in Writer |
291 | | class SdrPageGridFrame |
292 | | { |
293 | | tools::Rectangle m_aPaper; |
294 | | tools::Rectangle m_aUserArea; |
295 | | public: |
296 | 0 | SdrPageGridFrame(const tools::Rectangle& rPaper, const tools::Rectangle& rUser): m_aPaper(rPaper), m_aUserArea(rUser) {} |
297 | 0 | const tools::Rectangle& GetPaperRect() const { return m_aPaper; } |
298 | 0 | const tools::Rectangle& GetUserArea() const { return m_aUserArea; } |
299 | | }; |
300 | | |
301 | | class SVXCORE_DLLPUBLIC SdrPageGridFrameList final |
302 | | { |
303 | | std::vector<SdrPageGridFrame*> m_aList; |
304 | | |
305 | | SdrPageGridFrameList(const SdrPageGridFrameList& rSrcList) = delete; |
306 | | void operator=(const SdrPageGridFrameList& rSrcList) = delete; |
307 | 0 | SdrPageGridFrame* GetObject(sal_uInt16 i) const { return m_aList[i]; } |
308 | | |
309 | | public: |
310 | 0 | SdrPageGridFrameList() {} |
311 | 0 | ~SdrPageGridFrameList() { Clear(); } |
312 | | void Clear(); |
313 | 0 | sal_uInt16 GetCount() const { return sal_uInt16(m_aList.size()); } |
314 | 0 | void Insert(const SdrPageGridFrame& rGF) { m_aList.push_back(new SdrPageGridFrame(rGF)); } |
315 | 0 | SdrPageGridFrame& operator[](sal_uInt16 nPos) { return *GetObject(nPos); } |
316 | 0 | const SdrPageGridFrame& operator[](sal_uInt16 nPos) const { return *GetObject(nPos); } |
317 | | }; |
318 | | |
319 | | // class SdrPageProperties |
320 | | class SVXCORE_DLLPUBLIC SdrPageProperties final : public SfxListener, public svl::StyleSheetUser |
321 | | { |
322 | | private: |
323 | | // data |
324 | | SdrPage& mrSdrPage; |
325 | | SfxStyleSheet* mpStyleSheet; |
326 | | std::shared_ptr<model::Theme> mpTheme; |
327 | | SfxItemSet maProperties; |
328 | | |
329 | | // internal helpers |
330 | | void ImpRemoveStyleSheet(); |
331 | | void ImpAddStyleSheet(SfxStyleSheet& rNewStyleSheet); |
332 | | |
333 | | SdrPageProperties& operator=(const SdrPageProperties& rCandidate) = delete; |
334 | | |
335 | | void sendLOKitThemeChangedCallback(); |
336 | | public: |
337 | | // construct/destruct |
338 | | SdrPageProperties(SdrPage& rSdrPage); |
339 | | virtual ~SdrPageProperties() override; |
340 | | |
341 | | // Notify(...) from baseclass SfxListener |
342 | | virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override; |
343 | | |
344 | | virtual bool isUsedByModel() const override; |
345 | | |
346 | | // data read/write |
347 | 228 | const SfxItemSet& GetItemSet() const { return maProperties;} |
348 | | void PutItemSet(const SfxItemSet& rSet); |
349 | | void PutItem(const SfxPoolItem& rItem); |
350 | | void ClearItem(const sal_uInt16 nWhich = 0); |
351 | | |
352 | | // StyleSheet access |
353 | | void SetStyleSheet(SfxStyleSheet* pStyleSheet); |
354 | 3.43k | SfxStyleSheet* GetStyleSheet() const { return mpStyleSheet;} |
355 | | |
356 | | void setTheme(std::shared_ptr<model::Theme> const& pTheme); |
357 | | std::shared_ptr<model::Theme> const& getTheme() const; |
358 | | |
359 | | void dumpAsXml(xmlTextWriterPtr pWriter) const; |
360 | | }; |
361 | | |
362 | | |
363 | | /** |
364 | | A SdrPage contains exactly one SdrObjList and a description of the physical |
365 | | page dimensions (size / margins). The latter is required to "catch" objects |
366 | | during drag-and-drop. |
367 | | The SdrPage allows (via SdrObjList) inserting and removing SdrObjects, |
368 | | as well as moving them into the foreground or background. |
369 | | Also it's possible to request and directly set the order number (ZOrder) |
370 | | of SdrObjects. |
371 | | */ |
372 | | |
373 | | //////////////////////////////////////////////////////////////////////////////////////////////////// |
374 | | // |
375 | | // SdrPage |
376 | | // DlgEdPage |
377 | | // FmFormPage |
378 | | // ScDrawPage |
379 | | // SdPage |
380 | | // SwDPage |
381 | | // OReportPage |
382 | | |
383 | | class SVXCORE_DLLPUBLIC SdrPage : public SdrObjList, public cppu::OWeakObject |
384 | | { |
385 | | // #i9076# |
386 | | friend class SdrModel; |
387 | | friend class SvxUnoDrawPagesAccess; |
388 | | |
389 | | // this class uses its own UNO wrapper |
390 | | // and thus has to set mxUnoPage (it also relies on mxUnoPage not being WeakRef) |
391 | | friend class reportdesign::OSection; |
392 | | |
393 | | SdrPage& operator=(const SdrPage&) = delete; |
394 | | SdrPage(const SdrPage&) = delete; |
395 | | |
396 | | // start PageUser section |
397 | | private: |
398 | | // #111111# PageUser section |
399 | | sdr::PageUserVector maPageUsers; |
400 | | |
401 | | std::unique_ptr<sdr::contact::ViewContact> mpViewContact; |
402 | | |
403 | | public: |
404 | | void AddPageUser(sdr::PageUser& rNewUser); |
405 | | void RemovePageUser(sdr::PageUser& rOldUser); |
406 | 0 | const sdr::PageUserVector& GetPageUsers() const { return maPageUsers; }; |
407 | | |
408 | | // SdrModel access on SdrPage level |
409 | 25.3M | SdrModel& getSdrModelFromSdrPage() const { return mrSdrModelFromSdrPage; } |
410 | | |
411 | | protected: |
412 | | std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact(); |
413 | | public: |
414 | | const sdr::contact::ViewContact& GetViewContact() const; |
415 | | sdr::contact::ViewContact& GetViewContact(); |
416 | | |
417 | | // #110094# DrawContact support: Methods for handling Page changes |
418 | | void ActionChanged(); |
419 | | |
420 | | private: |
421 | | // the SdrModel this page was created with, unchanged during SdrPage lifetime |
422 | | SdrModel& mrSdrModelFromSdrPage; |
423 | | |
424 | | protected: |
425 | | std::vector<rtl::Reference<sdr::annotation::Annotation>> maAnnotations; |
426 | | |
427 | | private: |
428 | | tools::Long mnWidth; // page size |
429 | | tools::Long mnHeight; // page size |
430 | | sal_Int32 mnBorderLeft; // left page margin |
431 | | sal_Int32 mnBorderUpper; // top page margin |
432 | | sal_Int32 mnBorderRight; // right page margin |
433 | | sal_Int32 mnBorderLower; // bottom page margin |
434 | | UniqueID maUniqueID; |
435 | | bool mbBackgroundFullSize = false; ///< Background object to represent the whole page. |
436 | | |
437 | | std::unique_ptr<SdrLayerAdmin> mpLayerAdmin; |
438 | | std::unique_ptr<SdrPageProperties> mpSdrPageProperties; |
439 | | css::uno::Reference< css::uno::XInterface > mxUnoPage; |
440 | | |
441 | | public: |
442 | | SdrPageProperties& getSdrPageProperties(); |
443 | | const SdrPageProperties& getSdrPageProperties() const; |
444 | | const SdrPageProperties* getCorrectSdrPageProperties() const; |
445 | | |
446 | | protected: |
447 | | // new MasterPageDescriptorVector |
448 | | std::unique_ptr<sdr::MasterPageDescriptor> mpMasterPageDescriptor; |
449 | | |
450 | | sal_uInt16 m_nPageNum; |
451 | | |
452 | | bool mbMaster : 1; // flag if this is a MasterPage |
453 | | bool mbInserted : 1; |
454 | | bool mbObjectsNotPersistent : 1; |
455 | | |
456 | | // #i93597# |
457 | | bool mbPageBorderOnlyLeftRight : 1; |
458 | | |
459 | | void SetUnoPage(css::uno::Reference<css::drawing::XDrawPage> const&); |
460 | | virtual css::uno::Reference< css::uno::XInterface > createUnoPage(); |
461 | | |
462 | | // Copying of pages is split into two parts: construction and copying of page objects, |
463 | | // because the copying might need access to fully initialized page. CloneSdrPage() is responsible |
464 | | // to call lateInit() after copy-construction of a new object. Any initialization in derived |
465 | | // classes that needs access to the page objects must be deferred to lateInit. And it must |
466 | | // call lateInit() of its parent class. |
467 | | void lateInit(const SdrPage& rSrcPage); |
468 | | |
469 | | public: |
470 | | explicit SdrPage(SdrModel& rModel, bool bMasterPage=false); |
471 | | virtual ~SdrPage() override; |
472 | | |
473 | | virtual rtl::Reference<SdrPage> CloneSdrPage(SdrModel& rTargetModel) const; |
474 | 3.87M | bool IsMasterPage() const { return mbMaster; } |
475 | | void SetInserted(bool bNew = true); |
476 | 409M | bool IsInserted() const { return mbInserted; } |
477 | | void SetChanged(); |
478 | | |
479 | | // derived from SdrObjList, returns this |
480 | | virtual SdrPage* getSdrPageFromSdrObjList() const override; |
481 | | |
482 | | // #i68775# React on PageNum changes (from Model in most cases) |
483 | | void SetPageNum(sal_uInt16 nNew); |
484 | | sal_uInt16 GetPageNum() const; |
485 | | |
486 | | // #i93597# Allow page border definition to not be the full rectangle but to |
487 | | // use only the left and right vertical edges (reportdesigner) |
488 | 0 | void setPageBorderOnlyLeftRight(bool bNew) { mbPageBorderOnlyLeftRight = bNew; } |
489 | 0 | bool getPageBorderOnlyLeftRight() const { return mbPageBorderOnlyLeftRight; } |
490 | | |
491 | | virtual void SetSize(const Size& aSiz); |
492 | | Size GetSize() const; |
493 | | virtual void SetOrientation(Orientation eOri); |
494 | | virtual Orientation GetOrientation() const; |
495 | | tools::Long GetWidth() const; |
496 | | tools::Long GetHeight() const; |
497 | | virtual void SetBorder(sal_Int32 nLft, sal_Int32 nUpp, sal_Int32 nRgt, sal_Int32 Lwr); |
498 | | virtual void SetLeftBorder(sal_Int32 nBorder); |
499 | | virtual void SetUpperBorder(sal_Int32 nBorder); |
500 | | virtual void SetRightBorder(sal_Int32 nBorder); |
501 | | virtual void SetLowerBorder(sal_Int32 nBorder); |
502 | | sal_Int32 GetLeftBorder() const; |
503 | | sal_Int32 GetUpperBorder() const; |
504 | | sal_Int32 GetRightBorder() const; |
505 | | sal_Int32 GetLowerBorder() const; |
506 | 0 | sal_uInt64 GetUniqueID() const { return maUniqueID.getID(); } |
507 | | void SetBackgroundFullSize(bool bIn); |
508 | | bool IsBackgroundFullSize() const; |
509 | | |
510 | | // New MasterPage interface |
511 | 7.44M | bool TRG_HasMasterPage() const { return (nullptr != mpMasterPageDescriptor); } |
512 | | void TRG_SetMasterPage(SdrPage& rNew); |
513 | | void TRG_ClearMasterPage(); |
514 | | SdrPage& TRG_GetMasterPage() const; |
515 | | const SdrLayerIDSet& TRG_GetMasterPageVisibleLayers() const; |
516 | | void TRG_SetMasterPageVisibleLayers(const SdrLayerIDSet& rNew); |
517 | | sdr::contact::ViewContact& TRG_GetMasterPageDescriptorViewContact() const; |
518 | | |
519 | | void MakePageObjectsNamesUnique(); |
520 | | |
521 | | virtual bool RestoreDefaultText(SdrObject* pObj, const OUString& rStr); |
522 | | |
523 | | protected: |
524 | | void TRG_ImpMasterPageRemoved(const SdrPage& rRemovedPage); |
525 | | |
526 | | public: |
527 | | /// changing the layers does not set the modified-flag! |
528 | | const SdrLayerAdmin& GetLayerAdmin() const; |
529 | | SdrLayerAdmin& GetLayerAdmin(); |
530 | | |
531 | | /// for snap-to-grid in Writer, also for AlignObjects if 1 object is marked |
532 | | /// if pRect != null, then the pages that are intersected by this Rect, |
533 | | /// otherwise the visible pages |
534 | | virtual const SdrPageGridFrameList* GetGridFrameList(const SdrPageView* pPV, const tools::Rectangle* pRect) const; |
535 | | |
536 | | css::uno::Reference< css::uno::XInterface > const & getUnoPage(); |
537 | | |
538 | | virtual SfxStyleSheet* GetTextStyleSheetForObject( SdrObject* pObj ) const; |
539 | | |
540 | | /** *deprecated* returns an averaged background color of this page */ |
541 | | // #i75566# GetBackgroundColor -> GetPageBackgroundColor |
542 | | Color GetPageBackgroundColor() const; |
543 | | |
544 | | /** *deprecated* returns an averaged background color of this page */ |
545 | | // #i75566# GetBackgroundColor -> GetPageBackgroundColor and bScreenDisplay hint value |
546 | | Color GetPageBackgroundColor( SdrPageView const * pView, bool bScreenDisplay = true) const; |
547 | | |
548 | | /** this method returns true if the object from the ViewObjectContact should |
549 | | be visible on this page while rendering. |
550 | | bEdit selects if visibility test is for an editing view or a final render, |
551 | | like printing. |
552 | | */ |
553 | | virtual bool checkVisibility( |
554 | | const sdr::contact::ViewObjectContact& rOriginal, |
555 | | const sdr::contact::DisplayInfo& rDisplayInfo, |
556 | | bool bEdit ); |
557 | | |
558 | | void dumpAsXml(xmlTextWriterPtr pWriter) const override; |
559 | | |
560 | | // Annotations |
561 | | virtual rtl::Reference<sdr::annotation::Annotation> createAnnotation(); |
562 | | virtual void addAnnotation(rtl::Reference<sdr::annotation::Annotation> const& xAnnotation, int nIndex = -1); |
563 | | virtual void addAnnotationNoNotify(rtl::Reference<sdr::annotation::Annotation> const& xAnnotation, int nIndex = -1); |
564 | | virtual void removeAnnotation(rtl::Reference<sdr::annotation::Annotation> const& xAnnotation); |
565 | | virtual void removeAnnotationNoNotify(rtl::Reference<sdr::annotation::Annotation> const& xAnnotation); |
566 | | |
567 | | std::vector<rtl::Reference<sdr::annotation::Annotation>> const& getAnnotations() const; |
568 | | }; |
569 | | |
570 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |