Adjust includes
[LibreOffice.git] / svx / source / svdraw / svdopage.cxx
bloba2a6592037ee0a97aee3519f423b4f8ca22dd5e9
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/strings.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.
63 mpShownPage = nullptr;
68 SdrPageObj::SdrPageObj(SdrPage* pNewPage)
69 : mpShownPage(pNewPage)
71 if(mpShownPage)
73 mpShownPage->AddPageUser(*this);
77 SdrPageObj::SdrPageObj(const tools::Rectangle& rRect, SdrPage* pNewPage)
78 : mpShownPage(pNewPage)
80 if(mpShownPage)
82 mpShownPage->AddPageUser(*this);
85 aOutRect = rRect;
88 SdrPageObj::~SdrPageObj()
90 if(mpShownPage)
92 mpShownPage->RemovePageUser(*this);
97 void SdrPageObj::SetReferencedPage(SdrPage* pNewPage)
99 if(mpShownPage != pNewPage)
101 if(mpShownPage)
103 mpShownPage->RemovePageUser(*this);
106 mpShownPage = pNewPage;
108 if(mpShownPage)
110 mpShownPage->AddPageUser(*this);
113 SetChanged();
114 BroadcastObjectChange();
118 // #i96598#
119 void SdrPageObj::SetBoundRectDirty()
121 // avoid resetting aOutRect which in case of this object is model data,
122 // not re-creatable view data
125 sal_uInt16 SdrPageObj::GetObjIdentifier() const
127 return sal_uInt16(OBJ_PAGE);
130 void SdrPageObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
132 rInfo.bRotateFreeAllowed=false;
133 rInfo.bRotate90Allowed =false;
134 rInfo.bMirrorFreeAllowed=false;
135 rInfo.bMirror45Allowed =false;
136 rInfo.bMirror90Allowed =false;
137 rInfo.bTransparenceAllowed = false;
138 rInfo.bShearAllowed =false;
139 rInfo.bEdgeRadiusAllowed=false;
140 rInfo.bNoOrthoDesired =false;
141 rInfo.bCanConvToPath =false;
142 rInfo.bCanConvToPoly =false;
143 rInfo.bCanConvToPathLineToArea=false;
144 rInfo.bCanConvToPolyLineToArea=false;
147 SdrPageObj* SdrPageObj::Clone() const
149 return CloneHelper< SdrPageObj >();
152 SdrPageObj& SdrPageObj::operator=(const SdrPageObj& rObj)
154 if( this == &rObj )
155 return *this;
156 SdrObject::operator=(rObj);
157 SetReferencedPage( rObj.GetReferencedPage());
158 return *this;
161 OUString SdrPageObj::TakeObjNameSingul() const
163 OUStringBuffer sName(ImpGetResStr(STR_ObjNameSingulPAGE));
165 OUString aName(GetName());
166 if (!aName.isEmpty())
168 sName.append(' ');
169 sName.append('\'');
170 sName.append(aName);
171 sName.append('\'');
174 return sName.makeStringAndClear();
177 OUString SdrPageObj::TakeObjNamePlural() const
179 return ImpGetResStr(STR_ObjNamePluralPAGE);
182 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */