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 .
21 #include <svx/svdopage.hxx>
22 #include "svdglob.hxx"
23 #include "svx/svdstr.hrc"
24 #include <svx/svdtrans.hxx>
25 #include <svx/svdetc.hxx>
26 #include <svx/svdmodel.hxx>
27 #include <svx/svdpage.hxx>
28 #include <svx/svdpagv.hxx>
29 #include <svx/svdoutl.hxx>
30 #include <svtools/colorcfg.hxx>
31 #include <svl/itemset.hxx>
32 #include <sdr/properties/pageproperties.hxx>
33 #include <svx/sdr/contact/viewcontactofpageobj.hxx>
36 // BaseProperties section
38 sdr::properties::BaseProperties
* SdrPageObj::CreateObjectSpecificProperties()
40 return new sdr::properties::PageProperties(*this);
44 // DrawContact section
46 sdr::contact::ViewContact
* SdrPageObj::CreateObjectSpecificViewContact()
48 return new sdr::contact::ViewContactOfPageObj(*this);
52 // this method is called form the destructor of the referenced page.
53 // do all necessary action to forget the page. It is not necessary to call
54 // RemovePageUser(), that is done form the destructor.
55 void SdrPageObj::PageInDestruction(const SdrPage
& rPage
)
57 if(mpShownPage
&& mpShownPage
== &rPage
)
59 // #i58769# Do not call ActionChanged() here, because that would
60 // lead to the construction of a view contact object for a page that
61 // is being destroyed.
69 TYPEINIT1(SdrPageObj
,SdrObject
);
71 SdrPageObj::SdrPageObj(SdrPage
* pNewPage
)
72 : mpShownPage(pNewPage
)
76 mpShownPage
->AddPageUser(*this);
80 SdrPageObj::SdrPageObj(const Rectangle
& rRect
, SdrPage
* pNewPage
)
81 : mpShownPage(pNewPage
)
85 mpShownPage
->AddPageUser(*this);
91 SdrPageObj::~SdrPageObj()
95 mpShownPage
->RemovePageUser(*this);
99 SdrPage
* SdrPageObj::GetReferencedPage() const
104 void SdrPageObj::SetReferencedPage(SdrPage
* pNewPage
)
106 if(mpShownPage
!= pNewPage
)
110 mpShownPage
->RemovePageUser(*this);
113 mpShownPage
= pNewPage
;
117 mpShownPage
->AddPageUser(*this);
121 BroadcastObjectChange();
126 void SdrPageObj::SetBoundRectDirty()
128 // avoid resetting aOutRect which in case of this object is model data,
129 // not re-creatable view data
132 sal_uInt16
SdrPageObj::GetObjIdentifier() const
134 return sal_uInt16(OBJ_PAGE
);
137 void SdrPageObj::TakeObjInfo(SdrObjTransformInfoRec
& rInfo
) const
139 rInfo
.bRotateFreeAllowed
=false;
140 rInfo
.bRotate90Allowed
=false;
141 rInfo
.bMirrorFreeAllowed
=false;
142 rInfo
.bMirror45Allowed
=false;
143 rInfo
.bMirror90Allowed
=false;
144 rInfo
.bTransparenceAllowed
= false;
145 rInfo
.bGradientAllowed
= false;
146 rInfo
.bShearAllowed
=false;
147 rInfo
.bEdgeRadiusAllowed
=false;
148 rInfo
.bNoOrthoDesired
=false;
149 rInfo
.bCanConvToPath
=false;
150 rInfo
.bCanConvToPoly
=false;
151 rInfo
.bCanConvToPathLineToArea
=false;
152 rInfo
.bCanConvToPolyLineToArea
=false;
155 SdrPageObj
* SdrPageObj::Clone() const
157 return CloneHelper
< SdrPageObj
>();
160 SdrPageObj
& SdrPageObj::operator=(const SdrPageObj
& rObj
)
164 SdrObject::operator=(rObj
);
165 SetReferencedPage( rObj
.GetReferencedPage());
169 OUString
SdrPageObj::TakeObjNameSingul() const
171 OUStringBuffer
sName(ImpGetResStr(STR_ObjNameSingulPAGE
));
173 OUString
aName(GetName());
174 if (!aName
.isEmpty())
182 return sName
.makeStringAndClear();
185 OUString
SdrPageObj::TakeObjNamePlural() const
187 return ImpGetResStr(STR_ObjNamePluralPAGE
);
190 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */