tdf#130857 qt weld: Implement QtInstanceWidget::get_text_height
[LibreOffice.git] / svx / inc / sdr / contact / viewcontactofsdrpage.hxx
blob98d6f577e86eea3318022995f895bf40d19f8394
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::contact {
30 class ViewContactOfSdrPage;
32 class ViewContactOfPageSubObject : public ViewContact
34 ViewContactOfSdrPage& mrParentViewContactOfSdrPage;
36 public:
37 explicit ViewContactOfPageSubObject(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
38 virtual ~ViewContactOfPageSubObject() override;
40 virtual ViewContact* GetParentContact() const override;
41 const SdrPage& getPage() const;
44 class ViewContactOfPageBackground final : public ViewContactOfPageSubObject
46 virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override;
47 virtual void createViewIndependentPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor) const override;
49 public:
50 explicit ViewContactOfPageBackground(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
51 virtual ~ViewContactOfPageBackground() override;
54 class ViewContactOfPageShadow final : public ViewContactOfPageSubObject
56 virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override;
57 virtual void createViewIndependentPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor) const override;
59 public:
60 explicit ViewContactOfPageShadow(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
61 virtual ~ViewContactOfPageShadow() override;
64 class ViewContactOfPageFill final : public ViewContactOfPageSubObject
66 virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override;
67 virtual void createViewIndependentPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor) const override;
69 public:
70 explicit ViewContactOfPageFill(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
71 virtual ~ViewContactOfPageFill() override;
74 class ViewContactOfMasterPage final : public ViewContactOfPageSubObject
76 virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override;
77 virtual void createViewIndependentPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor) const override;
79 public:
80 explicit ViewContactOfMasterPage(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
81 virtual ~ViewContactOfMasterPage() override;
84 class ViewContactOfOuterPageBorder final : public ViewContactOfPageSubObject
86 virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override;
87 virtual void createViewIndependentPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor) const override;
89 public:
90 explicit ViewContactOfOuterPageBorder(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
91 virtual ~ViewContactOfOuterPageBorder() override;
94 class ViewContactOfInnerPageBorder final : public ViewContactOfPageSubObject
96 virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override;
97 virtual void createViewIndependentPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor) const override;
99 public:
100 explicit ViewContactOfInnerPageBorder(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
101 virtual ~ViewContactOfInnerPageBorder() override;
105 * This view contact corresponds with all SdrObject instances in a single
106 * SdrPage. Its GetObjectCount() returns the number of SdrObject instances
107 * in the SdrPage that it represents, and its GetViewContact() returns the
108 * view contact of the SdrObject instance associated with the identifier
109 * passed to the method.
111 class ViewContactOfPageHierarchy final : public ViewContactOfPageSubObject
113 virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override;
114 virtual void createViewIndependentPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor) const override;
116 public:
117 explicit ViewContactOfPageHierarchy(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
118 virtual ~ViewContactOfPageHierarchy() override;
120 virtual sal_uInt32 GetObjectCount() const override;
121 virtual ViewContact& GetViewContact(sal_uInt32 nIndex) const override;
124 class ViewContactOfGrid final : public ViewContactOfPageSubObject
126 bool mbFront : 1;
128 virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override;
129 virtual void createViewIndependentPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor) const override;
131 public:
132 ViewContactOfGrid(ViewContactOfSdrPage& rParentViewContactOfSdrPage, bool bFront);
133 virtual ~ViewContactOfGrid() override;
135 bool getFront() const { return mbFront; }
138 class ViewContactOfHelplines final : public ViewContactOfPageSubObject
140 bool mbFront : 1;
142 virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override;
143 virtual void createViewIndependentPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor) const override;
145 public:
146 ViewContactOfHelplines(ViewContactOfSdrPage& rParentViewContactOfSdrPage, bool bFront);
147 virtual ~ViewContactOfHelplines() override;
149 bool getFront() const { return mbFront; }
152 class ViewContactOfSdrPage final : public ViewContact
154 // the owner of this ViewContact. Set from constructor and not
155 // to be changed in any way.
156 SdrPage& mrPage;
158 // helper viewContacts to build a clear paint hierarchy
159 ViewContactOfPageBackground maViewContactOfPageBackground;
160 ViewContactOfPageShadow maViewContactOfPageShadow;
161 ViewContactOfPageFill maViewContactOfPageFill;
162 ViewContactOfMasterPage maViewContactOfMasterPage;
163 ViewContactOfOuterPageBorder maViewContactOfOuterPageBorder;
164 ViewContactOfInnerPageBorder maViewContactOfInnerPageBorder;
165 ViewContactOfGrid maViewContactOfGridBack;
166 ViewContactOfHelplines maViewContactOfHelplinesBack;
167 ViewContactOfPageHierarchy maViewContactOfPageHierarchy;
168 ViewContactOfGrid maViewContactOfGridFront;
169 ViewContactOfHelplines maViewContactOfHelplinesFront;
171 // Create an Object-Specific ViewObjectContact, set ViewContact and
172 // ObjectContact. Always needs to return something. Default is to create
173 // a standard ViewObjectContact containing the given ObjectContact and *this
174 virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override;
176 public:
177 // access to SdrObject
178 SdrPage& GetSdrPage() const
180 return mrPage;
183 // basic constructor, used from SdrPage.
184 explicit ViewContactOfSdrPage(SdrPage& rObj);
185 virtual ~ViewContactOfSdrPage() override;
187 // Access to possible sub-hierarchy
188 virtual sal_uInt32 GetObjectCount() const override;
189 virtual ViewContact& GetViewContact(sal_uInt32 nIndex) const override;
191 // React on changes of the object of this ViewContact
192 virtual void ActionChanged() override;
194 private:
195 // This method is responsible for creating the graphical visualisation data
196 // ONLY based on model data
197 virtual void createViewIndependentPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor) const override;
202 #endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFSDRPAGE_HXX
204 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */