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 "svx/svdglob.hxx" // Stringcache
23 #include "svx/svdstr.hrc" // the object's name
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 <svx/sdr/properties/pageproperties.hxx>
33 #include <svx/sdr/contact/viewcontactofpageobj.hxx>
35 ////////////////////////////////////////////////////////////////////////////////////////////////////
36 // BaseProperties section
38 sdr::properties::BaseProperties
* SdrPageObj::CreateObjectSpecificProperties()
40 return new sdr::properties::PageProperties(*this);
43 //////////////////////////////////////////////////////////////////////////////
44 // DrawContact section
46 sdr::contact::ViewContact
* SdrPageObj::CreateObjectSpecificViewContact()
48 return new sdr::contact::ViewContactOfPageObj(*this);
51 ////////////////////////////////////////////////////////////////////////////////////////////////////
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.
67 ////////////////////////////////////////////////////////////////////////////////////////////////////
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
=sal_False
;
140 rInfo
.bRotate90Allowed
=sal_False
;
141 rInfo
.bMirrorFreeAllowed
=sal_False
;
142 rInfo
.bMirror45Allowed
=sal_False
;
143 rInfo
.bMirror90Allowed
=sal_False
;
144 rInfo
.bTransparenceAllowed
= sal_False
;
145 rInfo
.bGradientAllowed
= sal_False
;
146 rInfo
.bShearAllowed
=sal_False
;
147 rInfo
.bEdgeRadiusAllowed
=sal_False
;
148 rInfo
.bNoOrthoDesired
=sal_False
;
149 rInfo
.bCanConvToPath
=sal_False
;
150 rInfo
.bCanConvToPoly
=sal_False
;
151 rInfo
.bCanConvToPathLineToArea
=sal_False
;
152 rInfo
.bCanConvToPolyLineToArea
=sal_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 void SdrPageObj::TakeObjNameSingul(XubString
& rName
) const
171 rName
=ImpGetResStr(STR_ObjNameSingulPAGE
);
173 String
aName( GetName() );
176 rName
+= sal_Unicode(' ');
177 rName
+= sal_Unicode('\'');
179 rName
+= sal_Unicode('\'');
183 void SdrPageObj::TakeObjNamePlural(XubString
& rName
) const
185 rName
=ImpGetResStr(STR_ObjNamePluralPAGE
);
188 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */