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 .
20 #ifndef _SDR_CONTACT_VIEWCONTACTOFSDRPAGE_HXX
21 #define _SDR_CONTACT_VIEWCONTACTOFSDRPAGE_HXX
23 #include <sal/types.h>
24 #include <svx/sdr/contact/viewcontact.hxx>
26 //////////////////////////////////////////////////////////////////////////////
30 namespace sdr
{ namespace contact
{
31 class ViewContactOfSdrPage
;
34 //////////////////////////////////////////////////////////////////////////////
40 class ViewContactOfPageSubObject
: public ViewContact
43 ViewContactOfSdrPage
& mrParentViewContactOfSdrPage
;
46 explicit ViewContactOfPageSubObject(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
);
47 virtual ~ViewContactOfPageSubObject();
49 virtual ViewContact
* GetParentContact() const;
50 const SdrPage
& getPage() const;
52 } // end of namespace contact
53 } // end of namespace sdr
55 //////////////////////////////////////////////////////////////////////////////
61 class ViewContactOfPageBackground
: public ViewContactOfPageSubObject
64 virtual ViewObjectContact
& CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
);
65 virtual drawinglayer::primitive2d::Primitive2DSequence
createViewIndependentPrimitive2DSequence() const;
68 explicit ViewContactOfPageBackground(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
);
69 virtual ~ViewContactOfPageBackground();
71 } // end of namespace contact
72 } // end of namespace sdr
74 //////////////////////////////////////////////////////////////////////////////
80 class ViewContactOfPageShadow
: public ViewContactOfPageSubObject
83 virtual ViewObjectContact
& CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
);
84 virtual drawinglayer::primitive2d::Primitive2DSequence
createViewIndependentPrimitive2DSequence() const;
87 explicit ViewContactOfPageShadow(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
);
88 virtual ~ViewContactOfPageShadow();
90 } // end of namespace contact
91 } // end of namespace sdr
93 //////////////////////////////////////////////////////////////////////////////
99 class ViewContactOfPageFill
: public ViewContactOfPageSubObject
102 virtual ViewObjectContact
& CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
);
103 virtual drawinglayer::primitive2d::Primitive2DSequence
createViewIndependentPrimitive2DSequence() const;
106 explicit ViewContactOfPageFill(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
);
107 virtual ~ViewContactOfPageFill();
109 } // end of namespace contact
110 } // end of namespace sdr
112 //////////////////////////////////////////////////////////////////////////////
118 class ViewContactOfMasterPage
: public ViewContactOfPageSubObject
121 virtual ViewObjectContact
& CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
);
122 virtual drawinglayer::primitive2d::Primitive2DSequence
createViewIndependentPrimitive2DSequence() const;
125 explicit ViewContactOfMasterPage(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
);
126 virtual ~ViewContactOfMasterPage();
128 } // end of namespace contact
129 } // end of namespace sdr
131 //////////////////////////////////////////////////////////////////////////////
137 class ViewContactOfOuterPageBorder
: public ViewContactOfPageSubObject
140 virtual ViewObjectContact
& CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
);
141 virtual drawinglayer::primitive2d::Primitive2DSequence
createViewIndependentPrimitive2DSequence() const;
144 explicit ViewContactOfOuterPageBorder(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
);
145 virtual ~ViewContactOfOuterPageBorder();
147 } // end of namespace contact
148 } // end of namespace sdr
150 //////////////////////////////////////////////////////////////////////////////
156 class ViewContactOfInnerPageBorder
: public ViewContactOfPageSubObject
159 virtual ViewObjectContact
& CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
);
160 virtual drawinglayer::primitive2d::Primitive2DSequence
createViewIndependentPrimitive2DSequence() const;
163 explicit ViewContactOfInnerPageBorder(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
);
164 virtual ~ViewContactOfInnerPageBorder();
166 } // end of namespace contact
167 } // end of namespace sdr
169 //////////////////////////////////////////////////////////////////////////////
175 class ViewContactOfPageHierarchy
: public ViewContactOfPageSubObject
178 virtual ViewObjectContact
& CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
);
179 virtual drawinglayer::primitive2d::Primitive2DSequence
createViewIndependentPrimitive2DSequence() const;
182 explicit ViewContactOfPageHierarchy(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
);
183 virtual ~ViewContactOfPageHierarchy();
185 virtual sal_uInt32
GetObjectCount() const;
186 virtual ViewContact
& GetViewContact(sal_uInt32 nIndex
) const;
188 } // end of namespace contact
189 } // end of namespace sdr
191 //////////////////////////////////////////////////////////////////////////////
197 class ViewContactOfGrid
: public ViewContactOfPageSubObject
201 unsigned mbFront
: 1;
203 virtual ViewObjectContact
& CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
);
204 virtual drawinglayer::primitive2d::Primitive2DSequence
createViewIndependentPrimitive2DSequence() const;
207 ViewContactOfGrid(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
, bool bFront
);
208 virtual ~ViewContactOfGrid();
210 bool getFront() const { return mbFront
; }
212 } // end of namespace contact
213 } // end of namespace sdr
215 //////////////////////////////////////////////////////////////////////////////
221 class ViewContactOfHelplines
: public ViewContactOfPageSubObject
225 unsigned mbFront
: 1;
227 virtual ViewObjectContact
& CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
);
228 virtual drawinglayer::primitive2d::Primitive2DSequence
createViewIndependentPrimitive2DSequence() const;
231 ViewContactOfHelplines(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
, bool bFront
);
232 virtual ~ViewContactOfHelplines();
234 bool getFront() const { return mbFront
; }
236 } // end of namespace contact
237 } // end of namespace sdr
239 //////////////////////////////////////////////////////////////////////////////
245 class ViewContactOfSdrPage
: public ViewContact
248 // the owner of this ViewContact. Set from constructor and not
249 // to be changed in any way.
252 // helper viewContacts to build a clear paint hierarchy
253 ViewContactOfPageBackground maViewContactOfPageBackground
;
254 ViewContactOfPageShadow maViewContactOfPageShadow
;
255 ViewContactOfPageFill maViewContactOfPageFill
;
256 ViewContactOfMasterPage maViewContactOfMasterPage
;
257 ViewContactOfOuterPageBorder maViewContactOfOuterPageBorder
;
258 ViewContactOfInnerPageBorder maViewContactOfInnerPageBorder
;
259 ViewContactOfGrid maViewContactOfGridBack
;
260 ViewContactOfHelplines maViewContactOfHelplinesBack
;
261 ViewContactOfPageHierarchy maViewContactOfPageHierarchy
;
262 ViewContactOfGrid maViewContactOfGridFront
;
263 ViewContactOfHelplines maViewContactOfHelplinesFront
;
265 // Create a Object-Specific ViewObjectContact, set ViewContact and
266 // ObjectContact. Always needs to return something. Default is to create
267 // a standard ViewObjectContact containing the given ObjectContact and *this
268 virtual ViewObjectContact
& CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
);
271 // access to SdrObject
272 SdrPage
& GetSdrPage() const
277 // basic constructor, used from SdrPage.
278 explicit ViewContactOfSdrPage(SdrPage
& rObj
);
279 virtual ~ViewContactOfSdrPage();
281 // Access to possible sub-hierarchy
282 virtual sal_uInt32
GetObjectCount() const;
283 virtual ViewContact
& GetViewContact(sal_uInt32 nIndex
) const;
285 // React on changes of the object of this ViewContact
286 virtual void ActionChanged();
288 // overload for acessing the SdrPage
289 virtual SdrPage
* TryToGetSdrPage() const;
292 // This method is responsible for creating the graphical visualisation data
293 // ONLY based on model data
294 virtual drawinglayer::primitive2d::Primitive2DSequence
createViewIndependentPrimitive2DSequence() const;
296 } // end of namespace contact
297 } // end of namespace sdr
299 //////////////////////////////////////////////////////////////////////////////
301 #endif //_SDR_CONTACT_VIEWCONTACTOFSDRPAGE_HXX
303 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */