LibreOffice Module sd (master) 1
sdpage.hxx
Go to the documentation of this file.
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 INCLUDED_SD_INC_SDPAGE_HXX
21#define INCLUDED_SD_INC_SDPAGE_HXX
22
23#include <com/sun/star/drawing/XDrawPage.hpp>
24#include <com/sun/star/presentation/FadeEffect.hpp>
25#include <com/sun/star/office/XAnnotation.hpp>
26
27#include <memory>
28#include <string_view>
29#include <vector>
30#include <editeng/flditem.hxx>
31#include <svx/svdobj.hxx>
32#include <svx/fmpage.hxx>
33#include <xmloff/autolayout.hxx>
34#include "diadef.h"
35#include "pres.hxx"
36#include "shapelist.hxx"
37#include "misc/scopelock.hxx"
38#include "sddllapi.h"
39
41 class XAnimationNode;
42}
43
44class SfxStyleSheet;
45class SdDrawDocument;
46class SdrTextObj;
47class SdPageLink;
48class SfxItemSet;
49class Paragraph;
50class Outliner;
51class SdStyleSheet;
52class Graphic;
53
54namespace sd
55{
56 class MainSequence;
57}
58
59namespace sd {
60
62 {
64 OUString maHeaderText;
65
67 OUString maFooterText;
68
70
76
78
79 bool operator==( const HeaderFooterSettings& rSettings ) const;
80 };
81
82 typedef std::vector< css::uno::Reference< css::office::XAnnotation > > AnnotationVector;
83}
84
85namespace sd {
86 class UndoAnimation;
87 class UndoTransition;
88 class UndoGeoObject;
89 class UndoAttrObject;
90}
91
92class SD_DLLPUBLIC SdPage final : public FmFormPage, public SdrObjUserCall
93{
94 SdPage& operator=(const SdPage&) = delete;
95 SdPage(const SdPage&) = delete;
96
97friend class SdGenericDrawPage;
98friend class SdDrawPage;
99friend class sd::UndoAnimation;
102friend class sd::UndoGeoObject;
104
111 double mfTime;
114 OUString maLayoutName;
115 OUString maSoundFile;
119 OUString maFileName;
120 OUString maBookmarkName;
122 rtl_TextEncoding meCharSet;
123 sal_uInt16 mnPaperBin;
125
127
129 css::uno::Reference< css::animations::XAnimationNode > mxAnimationNode;
130
132 std::shared_ptr< sd::MainSequence > mpMainSequence;
133
134 virtual css::uno::Reference< css::uno::XInterface > createUnoPage() override;
135
136 std::unique_ptr<SfxItemSet> mpItems;
137
138 SfxItemSet* getOrCreateItems();
139
141
142 // new transition settings
148
149 void lateInit(const SdPage& rSrcPage);
150
151public:
152
153 SdPage(SdDrawDocument& rNewDoc, bool bMasterPage);
154 virtual ~SdPage() override;
155
156 virtual rtl::Reference<SdrPage> CloneSdrPage(SdrModel& rTargetModel) const override;
157
158 virtual void SetSize(const Size& aSize) override;
159 virtual void SetBorder(sal_Int32 nLft, sal_Int32 nUpp, sal_Int32 nRgt, sal_Int32 Lwr) override;
160 virtual void SetLeftBorder(sal_Int32 nBorder) override;
161 virtual void SetRightBorder(sal_Int32 nBorder) override;
162 virtual void SetUpperBorder(sal_Int32 nBorder) override;
163 virtual void SetLowerBorder(sal_Int32 nBorder) override;
164 virtual bool IsReadOnly() const override;
165
166 sd::ShapeList& GetPresentationShapeList() { return maPresentationShapeList; }
167
168 void EnsureMasterPageDefaultBackground();
169 SdrObject* CreatePresObj(PresObjKind eObjKind, bool bVertical, const ::tools::Rectangle& rRect);
170 rtl::Reference<SdrObject> CreateDefaultPresObj(PresObjKind eObjKind);
171 void DestroyDefaultPresObj(PresObjKind eObjKind);
172 SdrObject* GetPresObj(PresObjKind eObjKind, int nIndex = 1, bool bFuzzySearch = false );
173 PresObjKind GetPresObjKind(SdrObject* pObj) const;
174 OUString GetPresObjText(PresObjKind eObjKind) const;
175 SfxStyleSheet* GetStyleSheetForMasterPageBackground() const;
176 SfxStyleSheet* GetStyleSheetForPresObj(PresObjKind eObjKind) const;
177 sal_Int64 GetHashCode() const;
178 bool RestoreDefaultText( SdrObject* pObj );
179
181 bool IsPresObj(const SdrObject* pObj);
182
184 void RemovePresObj(const SdrObject* pObj);
185
187 void InsertPresObj(SdrObject* pObj, PresObjKind eKind );
188
189 void SetAutoLayout(AutoLayout eLayout, bool bInit=false, bool bCreate=false);
190 AutoLayout GetAutoLayout() const { return meAutoLayout; }
191 void CreateTitleAndLayout(bool bInit=false, bool bCreate=false);
192 SdrObject* InsertAutoLayoutShape(SdrObject* pObj, PresObjKind eObjKind, bool bVertical, const ::tools::Rectangle& rRect, bool bInit);
193
194 virtual void NbcInsertObject(SdrObject* pObj, size_t nPos=SAL_MAX_SIZE) override;
195 virtual rtl::Reference<SdrObject> NbcRemoveObject(size_t nObjNum) override;
196 virtual rtl::Reference<SdrObject> RemoveObject(size_t nObjNum) override;
197
200 virtual rtl::Reference<SdrObject> ReplaceObject(SdrObject* pNewObj, size_t nObjNum) override;
201
202 void SetObjText(SdrTextObj* pObj, SdrOutliner* pOutliner, PresObjKind eObjKind, std::u16string_view rStr );
203
204 void SetPageKind(PageKind ePgType) { mePageKind = ePgType; }
205 PageKind GetPageKind() const { return mePageKind; }
206
207 void SetSelected(bool bSel) { mbSelected = bSel; }
208 bool IsSelected() const { return mbSelected; }
209
210 void SetFadeEffect(css::presentation::FadeEffect eNewEffect);
211 css::presentation::FadeEffect GetFadeEffect() const;
212
213 void SetPresChange(PresChange eChange) { mePresChange = eChange; }
214 PresChange GetPresChange() const { return mePresChange; }
215
216 void SetTime(double fNewTime) { mfTime = fNewTime; }
217 double GetTime() const { return mfTime; }
218
219 void SetSound(bool bNewSoundOn) { mbSoundOn = bNewSoundOn; }
220 bool IsSoundOn() const { return mbSoundOn; }
221
222 void SetExcluded(bool bNewExcluded) { mbExcluded = bNewExcluded; }
223 bool IsExcluded() const { return mbExcluded; }
224
225 bool IsScaleObjects() const { return mbScaleObjects; }
226
227 void SetSoundFile(const OUString& rStr) { maSoundFile = rStr; }
228 const OUString& GetSoundFile() const { return maSoundFile; }
229
230 void SetLoopSound( bool bLoopSound ) { mbLoopSound = bLoopSound; }
231 bool IsLoopSound() const { return mbLoopSound; }
232
233 void SetStopSound( bool bStopSound ) { mbStopSound = bStopSound; }
234 bool IsStopSound() const { return mbStopSound; }
235
236 sal_Int16 getTransitionType() const { return mnTransitionType;}
237 void setTransitionType( sal_Int16 nTransitionType );
238
239 sal_Int16 getTransitionSubtype() const { return mnTransitionSubtype;}
240 void setTransitionSubtype( sal_Int16 nTransitionSubtype );
241
242 bool getTransitionDirection() const { return mbTransitionDirection;}
243 void setTransitionDirection( bool bTransitionbDirection );
244
246 void setTransitionFadeColor( sal_Int32 nTransitionFadeColor );
247
248 double getTransitionDuration() const { return mfTransitionDuration;}
249 void setTransitionDuration( double fTransitionDuration );
250
251 virtual void Changed(const SdrObject& rObj, SdrUserCallType eType,
252 const ::tools::Rectangle& rOldBoundRect) override;
253
254 void SetLayoutName(const OUString& aName);
255 virtual OUString GetLayoutName() const override { return maLayoutName; }
256
257 void SetFileName(const OUString& aName) { maFileName = aName; }
258 const OUString& GetFileName() const { return maFileName; }
259 void SetBookmarkName(const OUString& aName) { maBookmarkName = aName; }
260 const OUString& GetBookmarkName() const { return maBookmarkName; }
261
262 void ConnectLink();
263 void DisconnectLink();
264
265 void ScaleObjects(const Size& rNewPageSize, const ::tools::Rectangle& rNewBorderRect,
266 bool bScaleAllObj);
267
268 const OUString& GetName() const;
269 OUString const & GetRealName() const { return FmFormPage::GetName(); };
270
271 void SetPresentationLayout(std::u16string_view rLayoutName,
272 bool bReplaceStyleSheets = true,
273 bool bSetMasterPage = true,
274 bool bReverseOrder = false);
275 void EndListenOutlineText();
276
277 void SetPaperBin(sal_uInt16 nBin) { mnPaperBin = nBin; }
278 sal_uInt16 GetPaperBin() const { return mnPaperBin; }
279 virtual void SetOrientation(Orientation eOrient) override;
280 virtual Orientation GetOrientation() const override;
281
282 virtual SfxStyleSheet* GetTextStyleSheetForObject( SdrObject* pObj ) const override;
283
284 bool setAlienAttributes( const css::uno::Any& rAttributes );
285 void getAlienAttributes( css::uno::Any& rAttributes );
286
291 css::uno::Reference< css::animations::XAnimationNode > const & getAnimationNode();
292
297 void setAnimationNode( css::uno::Reference< css::animations::XAnimationNode > const & xNode );
298
300 std::shared_ptr< sd::MainSequence > const & getMainSequence();
301
306 bool hasAnimationNode() const;
307
309 static SdPage* getImplementation( const css::uno::Reference< css::drawing::XDrawPage >& xPage );
310
312 void removeAnimations( const SdrObject* pObj );
313
315 void notifyObjectRenamed(const SdrObject* pObj);
316
319 void SetName (const OUString& rName);
320
321 const sd::HeaderFooterSettings& getHeaderFooterSettings() const;
322 void setHeaderFooterSettings( const sd::HeaderFooterSettings& rNewSettings );
323
331 virtual bool checkVisibility(
332 const sdr::contact::ViewObjectContact& rOriginal,
333 const sdr::contact::DisplayInfo& rDisplayInfo,
334 bool bEdit ) override;
335
337 void onParagraphInserted( const ::Outliner* pOutliner, Paragraph const * pPara, SdrObject* pObj );
338
340 void onParagraphRemoving( const ::Outliner* pOutliner, Paragraph const * pPara, SdrObject* pObj );
341
343 void onEndTextEdit( SdrObject* pObj );
344
347 SdStyleSheet* getPresentationStyle( sal_uInt32 nHelpId ) const;
348
350 void RemoveEmptyPresentationObjects();
351
352 ::tools::Rectangle GetTitleRect() const;
353 ::tools::Rectangle GetLayoutRect() const;
354
355 static void CalculateHandoutAreas( SdDrawDocument& rModel, AutoLayout eLayout, bool bHorizontal, std::vector< ::tools::Rectangle >& rAreas );
356
359 void SetPrecious (const bool bIsPrecious);
360
368 bool IsPrecious() const { return mbIsPrecious; }
369
370 void createAnnotation( css::uno::Reference< css::office::XAnnotation >& xAnnotation );
371 void addAnnotation( const css::uno::Reference< css::office::XAnnotation >& xAnnotation, int nIndex );
372 void removeAnnotation( const css::uno::Reference< css::office::XAnnotation >& xAnnotation );
373 const sd::AnnotationVector& getAnnotations() const { return maAnnotations; }
374 bool Equals(const SdPage&) const;
375 virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override;
376 sal_uInt16 getPageId() const { return mnPageId; }
377
382 void getGraphicsForPrefetch(std::vector<Graphic*>& graphics) const;
383
384 static sal_uInt16 mnLastPageId;
385
386private:
388
389 // page id of this page
390 sal_uInt16 mnPageId;
391
396 void cloneAnimations( SdPage& rTargetPage ) const;
397
399 void onRemoveObject( SdrObject* pObject );
400};
401
402#endif // INCLUDED_SD_INC_SDPAGE_HXX
403
404/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
AutoLayout
const OUString & GetName() const
double mfTime
Display time in seconds.
Definition: sdpage.hxx:111
bool getTransitionDirection() const
Definition: sdpage.hxx:242
sal_uInt16 mnPageId
Definition: sdpage.hxx:390
AutoLayout meAutoLayout
AutoLayout.
Definition: sdpage.hxx:106
rtl_TextEncoding meCharSet
Text encoding.
Definition: sdpage.hxx:122
bool IsStopSound() const
Definition: sdpage.hxx:234
sal_Int16 getTransitionSubtype() const
Definition: sdpage.hxx:239
bool mbScaleObjects
Objects should be scaled.
Definition: sdpage.hxx:121
bool IsLoopSound() const
Definition: sdpage.hxx:231
PageKind GetPageKind() const
Definition: sdpage.hxx:205
const OUString & GetFileName() const
Definition: sdpage.hxx:258
OUString maLayoutName
Name of the layout.
Definition: sdpage.hxx:114
void SetTime(double fNewTime)
Definition: sdpage.hxx:216
static sal_uInt16 mnLastPageId
Definition: sdpage.hxx:384
const sd::AnnotationVector & getAnnotations() const
Definition: sdpage.hxx:373
sal_Int16 getTransitionType() const
Definition: sdpage.hxx:236
PresChange GetPresChange() const
Definition: sdpage.hxx:214
OUString maSoundFile
Path to sound file (MS-DOS notation).
Definition: sdpage.hxx:115
sd::AnnotationVector maAnnotations
Definition: sdpage.hxx:126
bool mbStopSound
Definition: sdpage.hxx:117
void SetExcluded(bool bNewExcluded)
Definition: sdpage.hxx:222
sd::ScopeLock maLockAutoLayoutArrangement
Definition: sdpage.hxx:108
SdPageLink * mpPageLink
Page link (at left sides only)
Definition: sdpage.hxx:124
OUString const & GetRealName() const
Definition: sdpage.hxx:269
SdPage & operator=(const SdPage &)=delete
double GetTime() const
Definition: sdpage.hxx:217
bool mbLoopSound
Definition: sdpage.hxx:116
bool IsScaleObjects() const
Definition: sdpage.hxx:225
std::unique_ptr< SfxItemSet > mpItems
Definition: sdpage.hxx:136
PageKind mePageKind
page type
Definition: sdpage.hxx:105
void SetBookmarkName(const OUString &aName)
Definition: sdpage.hxx:259
sal_uInt16 mnPaperBin
PaperBin.
Definition: sdpage.hxx:123
double getTransitionDuration() const
Definition: sdpage.hxx:248
bool IsPrecious() const
The "precious" flag is used for master pages to prevent some unused master pages from being deleted a...
Definition: sdpage.hxx:368
OUString maCreatedPageName
generated page name by GetPageName.
Definition: sdpage.hxx:118
bool mbSelected
selection identifier
Definition: sdpage.hxx:109
sd::ShapeList & GetPresentationShapeList()
Definition: sdpage.hxx:166
sd::HeaderFooterSettings maHeaderFooterSettings
Definition: sdpage.hxx:140
double mfTransitionDuration
Definition: sdpage.hxx:147
bool IsSelected() const
Definition: sdpage.hxx:208
bool IsSoundOn() const
Definition: sdpage.hxx:220
const OUString & GetSoundFile() const
Definition: sdpage.hxx:228
void SetPaperBin(sal_uInt16 nBin)
Definition: sdpage.hxx:277
void SetLoopSound(bool bLoopSound)
Definition: sdpage.hxx:230
std::shared_ptr< sd::MainSequence > mpMainSequence
a helper class to manipulate effects inside the main sequence
Definition: sdpage.hxx:132
bool IsExcluded() const
Definition: sdpage.hxx:223
css::uno::Reference< css::animations::XAnimationNode > mxAnimationNode
holds the smil animation sequences for this page
Definition: sdpage.hxx:129
bool mbTransitionDirection
Definition: sdpage.hxx:145
bool mbExcluded
will (not) be displayed during show.
Definition: sdpage.hxx:113
void SetFileName(const OUString &aName)
Definition: sdpage.hxx:257
const OUString & GetBookmarkName() const
Definition: sdpage.hxx:260
SdPage(const SdPage &)=delete
void SetPresChange(PresChange eChange)
Definition: sdpage.hxx:213
void SetSelected(bool bSel)
Definition: sdpage.hxx:207
OUString maBookmarkName
Bookmark name.
Definition: sdpage.hxx:120
sal_Int32 mnTransitionFadeColor
Definition: sdpage.hxx:146
virtual OUString GetLayoutName() const override
Definition: sdpage.hxx:255
void SetPageKind(PageKind ePgType)
Definition: sdpage.hxx:204
sal_Int16 mnTransitionSubtype
Definition: sdpage.hxx:144
void SetSoundFile(const OUString &rStr)
Definition: sdpage.hxx:227
sal_uInt16 GetPaperBin() const
Definition: sdpage.hxx:278
void SetStopSound(bool bStopSound)
Definition: sdpage.hxx:233
sal_uInt16 getPageId() const
Definition: sdpage.hxx:376
sal_Int32 getTransitionFadeColor() const
Definition: sdpage.hxx:245
PresChange mePresChange
manual / automatic / semi automatic
Definition: sdpage.hxx:110
AutoLayout GetAutoLayout() const
Definition: sdpage.hxx:190
sal_Int16 mnTransitionType
Definition: sdpage.hxx:143
OUString maFileName
file name.
Definition: sdpage.hxx:119
void SetSound(bool bNewSoundOn)
Definition: sdpage.hxx:219
bool mbIsPrecious
Definition: sdpage.hxx:387
sd::ShapeList maPresentationShapeList
presentation objects
Definition: sdpage.hxx:107
bool mbSoundOn
with / without sound.
Definition: sdpage.hxx:112
bool lateInit
PresChange
Definition: diadef.h:23
virtual OUString GetName() const override
constexpr OUStringLiteral IsReadOnly(u"IsReadOnly")
struct _xmlTextWriter * xmlTextWriterPtr
SvxTimeFormat
SvxDateFormat
OUString aName
std::vector< css::uno::Reference< css::office::XAnnotation > > AnnotationVector
Definition: sdpage.hxx:82
void createAnnotation(uno::Reference< office::XAnnotation > &xAnnotation, SdPage *pPage)
Definition: Annotation.cxx:111
PresObjKind
Definition: pres.hxx:22
PageKind
Definition: pres.hxx:45
Orientation
#define SD_DLLPUBLIC
Definition: sddllapi.h:27
sal_Int16 mnTransitionType
RGBColor mnTransitionFadeColor
SvxTimeFormat meTimeFormat
Definition: sdpage.hxx:75
SvxDateFormat meDateFormat
Definition: sdpage.hxx:74
SdrUserCallType
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)