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 INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFSDRPAGE_HXX
21 #define INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFSDRPAGE_HXX
23 #include <sal/types.h>
24 #include <svx/sdr/contact/viewcontact.hxx>
28 namespace sdr
{ namespace contact
{
30 class ViewContactOfSdrPage
;
32 class ViewContactOfPageSubObject
: public ViewContact
34 ViewContactOfSdrPage
& mrParentViewContactOfSdrPage
;
37 explicit ViewContactOfPageSubObject(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
);
38 virtual ~ViewContactOfPageSubObject() override
;
40 virtual ViewContact
* GetParentContact() const override
;
41 const SdrPage
& getPage() const;
44 class ViewContactOfPageBackground
: public ViewContactOfPageSubObject
47 virtual ViewObjectContact
& CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
) override
;
48 virtual drawinglayer::primitive2d::Primitive2DContainer
createViewIndependentPrimitive2DSequence() const override
;
51 explicit ViewContactOfPageBackground(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
);
52 virtual ~ViewContactOfPageBackground() override
;
55 class ViewContactOfPageShadow
: public ViewContactOfPageSubObject
58 virtual ViewObjectContact
& CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
) override
;
59 virtual drawinglayer::primitive2d::Primitive2DContainer
createViewIndependentPrimitive2DSequence() const override
;
62 explicit ViewContactOfPageShadow(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
);
63 virtual ~ViewContactOfPageShadow() override
;
66 class ViewContactOfPageFill
: public ViewContactOfPageSubObject
69 virtual ViewObjectContact
& CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
) override
;
70 virtual drawinglayer::primitive2d::Primitive2DContainer
createViewIndependentPrimitive2DSequence() const override
;
73 explicit ViewContactOfPageFill(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
);
74 virtual ~ViewContactOfPageFill() override
;
77 class ViewContactOfMasterPage
: public ViewContactOfPageSubObject
80 virtual ViewObjectContact
& CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
) override
;
81 virtual drawinglayer::primitive2d::Primitive2DContainer
createViewIndependentPrimitive2DSequence() const override
;
84 explicit ViewContactOfMasterPage(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
);
85 virtual ~ViewContactOfMasterPage() override
;
88 class ViewContactOfOuterPageBorder
: public ViewContactOfPageSubObject
91 virtual ViewObjectContact
& CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
) override
;
92 virtual drawinglayer::primitive2d::Primitive2DContainer
createViewIndependentPrimitive2DSequence() const override
;
95 explicit ViewContactOfOuterPageBorder(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
);
96 virtual ~ViewContactOfOuterPageBorder() override
;
99 class ViewContactOfInnerPageBorder
: public ViewContactOfPageSubObject
102 virtual ViewObjectContact
& CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
) override
;
103 virtual drawinglayer::primitive2d::Primitive2DContainer
createViewIndependentPrimitive2DSequence() const override
;
106 explicit ViewContactOfInnerPageBorder(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
);
107 virtual ~ViewContactOfInnerPageBorder() override
;
111 * This view contact corresponds with all SdrObject instances in a single
112 * SdrPage. Its GetObjectCount() returns the number of SdrObject instances
113 * in the SdrPage that it represents, and its GetViewContact() returns the
114 * view contact of the SdrObject instance associated with the identifier
115 * passed to the method.
117 class ViewContactOfPageHierarchy
: public ViewContactOfPageSubObject
120 virtual ViewObjectContact
& CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
) override
;
121 virtual drawinglayer::primitive2d::Primitive2DContainer
createViewIndependentPrimitive2DSequence() const override
;
124 explicit ViewContactOfPageHierarchy(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
);
125 virtual ~ViewContactOfPageHierarchy() override
;
127 virtual sal_uInt32
GetObjectCount() const override
;
128 virtual ViewContact
& GetViewContact(sal_uInt32 nIndex
) const override
;
131 class ViewContactOfGrid final
: public ViewContactOfPageSubObject
133 bool const mbFront
: 1;
135 virtual ViewObjectContact
& CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
) override
;
136 virtual drawinglayer::primitive2d::Primitive2DContainer
createViewIndependentPrimitive2DSequence() const override
;
139 ViewContactOfGrid(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
, bool bFront
);
140 virtual ~ViewContactOfGrid() override
;
142 bool getFront() const { return mbFront
; }
145 class ViewContactOfHelplines final
: public ViewContactOfPageSubObject
147 bool const mbFront
: 1;
149 virtual ViewObjectContact
& CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
) override
;
150 virtual drawinglayer::primitive2d::Primitive2DContainer
createViewIndependentPrimitive2DSequence() const override
;
153 ViewContactOfHelplines(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
, bool bFront
);
154 virtual ~ViewContactOfHelplines() override
;
156 bool getFront() const { return mbFront
; }
159 class ViewContactOfSdrPage
: public ViewContact
161 // the owner of this ViewContact. Set from constructor and not
162 // to be changed in any way.
165 // helper viewContacts to build a clear paint hierarchy
166 ViewContactOfPageBackground maViewContactOfPageBackground
;
167 ViewContactOfPageShadow maViewContactOfPageShadow
;
168 ViewContactOfPageFill maViewContactOfPageFill
;
169 ViewContactOfMasterPage maViewContactOfMasterPage
;
170 ViewContactOfOuterPageBorder maViewContactOfOuterPageBorder
;
171 ViewContactOfInnerPageBorder maViewContactOfInnerPageBorder
;
172 ViewContactOfGrid maViewContactOfGridBack
;
173 ViewContactOfHelplines maViewContactOfHelplinesBack
;
174 ViewContactOfPageHierarchy maViewContactOfPageHierarchy
;
175 ViewContactOfGrid maViewContactOfGridFront
;
176 ViewContactOfHelplines maViewContactOfHelplinesFront
;
179 // Create an Object-Specific ViewObjectContact, set ViewContact and
180 // ObjectContact. Always needs to return something. Default is to create
181 // a standard ViewObjectContact containing the given ObjectContact and *this
182 virtual ViewObjectContact
& CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
) override
;
185 // access to SdrObject
186 SdrPage
& GetSdrPage() const
191 // basic constructor, used from SdrPage.
192 explicit ViewContactOfSdrPage(SdrPage
& rObj
);
193 virtual ~ViewContactOfSdrPage() override
;
195 // Access to possible sub-hierarchy
196 virtual sal_uInt32
GetObjectCount() const override
;
197 virtual ViewContact
& GetViewContact(sal_uInt32 nIndex
) const override
;
199 // React on changes of the object of this ViewContact
200 virtual void ActionChanged() override
;
203 // This method is responsible for creating the graphical visualisation data
204 // ONLY based on model data
205 virtual drawinglayer::primitive2d::Primitive2DContainer
createViewIndependentPrimitive2DSequence() const override
;
210 #endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFSDRPAGE_HXX
212 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */