Version 6.1.4.1, tag libreoffice-6.1.4.1
[LibreOffice.git] / svx / inc / sdr / contact / viewcontactofsdrpage.hxx
blob0021148bc56c7d1efcc8e7a10ea405e35330d1df
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 .
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>
26 class SdrPage;
28 namespace sdr { namespace contact {
30 class ViewContactOfSdrPage;
32 class ViewContactOfPageSubObject : public ViewContact
34 protected:
35 ViewContactOfSdrPage& mrParentViewContactOfSdrPage;
37 public:
38 explicit ViewContactOfPageSubObject(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
39 virtual ~ViewContactOfPageSubObject() override;
41 virtual ViewContact* GetParentContact() const override;
42 const SdrPage& getPage() const;
45 class ViewContactOfPageBackground : public ViewContactOfPageSubObject
47 protected:
48 virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override;
49 virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override;
51 public:
52 explicit ViewContactOfPageBackground(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
53 virtual ~ViewContactOfPageBackground() override;
56 class ViewContactOfPageShadow : public ViewContactOfPageSubObject
58 protected:
59 virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override;
60 virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override;
62 public:
63 explicit ViewContactOfPageShadow(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
64 virtual ~ViewContactOfPageShadow() override;
67 class ViewContactOfPageFill : public ViewContactOfPageSubObject
69 protected:
70 virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override;
71 virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override;
73 public:
74 explicit ViewContactOfPageFill(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
75 virtual ~ViewContactOfPageFill() override;
78 class ViewContactOfMasterPage : public ViewContactOfPageSubObject
80 protected:
81 virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override;
82 virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override;
84 public:
85 explicit ViewContactOfMasterPage(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
86 virtual ~ViewContactOfMasterPage() override;
89 class ViewContactOfOuterPageBorder : public ViewContactOfPageSubObject
91 protected:
92 virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override;
93 virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override;
95 public:
96 explicit ViewContactOfOuterPageBorder(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
97 virtual ~ViewContactOfOuterPageBorder() override;
100 class ViewContactOfInnerPageBorder : public ViewContactOfPageSubObject
102 protected:
103 virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override;
104 virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override;
106 public:
107 explicit ViewContactOfInnerPageBorder(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
108 virtual ~ViewContactOfInnerPageBorder() override;
112 * This view contact corresponds with all SdrObject instances in a single
113 * SdrPage. Its GetObjectCount() returns the number of SdrObject instances
114 * in the SdrPage that it represents, and its GetViewContact() returns the
115 * view contact of the SdrObject instance associated with the identifier
116 * passed to the method.
118 class ViewContactOfPageHierarchy : public ViewContactOfPageSubObject
120 protected:
121 virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override;
122 virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override;
124 public:
125 explicit ViewContactOfPageHierarchy(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
126 virtual ~ViewContactOfPageHierarchy() override;
128 virtual sal_uInt32 GetObjectCount() const override;
129 virtual ViewContact& GetViewContact(sal_uInt32 nIndex) const override;
132 class ViewContactOfGrid final : public ViewContactOfPageSubObject
134 bool mbFront : 1;
136 virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override;
137 virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override;
139 public:
140 ViewContactOfGrid(ViewContactOfSdrPage& rParentViewContactOfSdrPage, bool bFront);
141 virtual ~ViewContactOfGrid() override;
143 bool getFront() const { return mbFront; }
146 class ViewContactOfHelplines final : public ViewContactOfPageSubObject
148 bool mbFront : 1;
150 virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override;
151 virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override;
153 public:
154 ViewContactOfHelplines(ViewContactOfSdrPage& rParentViewContactOfSdrPage, bool bFront);
155 virtual ~ViewContactOfHelplines() override;
157 bool getFront() const { return mbFront; }
160 class ViewContactOfSdrPage : public ViewContact
162 protected:
163 // the owner of this ViewContact. Set from constructor and not
164 // to be changed in any way.
165 SdrPage& mrPage;
167 // helper viewContacts to build a clear paint hierarchy
168 ViewContactOfPageBackground maViewContactOfPageBackground;
169 ViewContactOfPageShadow maViewContactOfPageShadow;
170 ViewContactOfPageFill maViewContactOfPageFill;
171 ViewContactOfMasterPage maViewContactOfMasterPage;
172 ViewContactOfOuterPageBorder maViewContactOfOuterPageBorder;
173 ViewContactOfInnerPageBorder maViewContactOfInnerPageBorder;
174 ViewContactOfGrid maViewContactOfGridBack;
175 ViewContactOfHelplines maViewContactOfHelplinesBack;
176 ViewContactOfPageHierarchy maViewContactOfPageHierarchy;
177 ViewContactOfGrid maViewContactOfGridFront;
178 ViewContactOfHelplines maViewContactOfHelplinesFront;
180 // Create a Object-Specific ViewObjectContact, set ViewContact and
181 // ObjectContact. Always needs to return something. Default is to create
182 // a standard ViewObjectContact containing the given ObjectContact and *this
183 virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override;
185 public:
186 // access to SdrObject
187 SdrPage& GetSdrPage() const
189 return mrPage;
192 // basic constructor, used from SdrPage.
193 explicit ViewContactOfSdrPage(SdrPage& rObj);
194 virtual ~ViewContactOfSdrPage() override;
196 // Access to possible sub-hierarchy
197 virtual sal_uInt32 GetObjectCount() const override;
198 virtual ViewContact& GetViewContact(sal_uInt32 nIndex) const override;
200 // React on changes of the object of this ViewContact
201 virtual void ActionChanged() override;
203 protected:
204 // This method is responsible for creating the graphical visualisation data
205 // ONLY based on model data
206 virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override;
211 #endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFSDRPAGE_HXX
213 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */