LibreOffice Module sw (master) 1
flyfrms.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#ifndef INCLUDED_SW_SOURCE_CORE_INC_FLYFRMS_HXX
20#define INCLUDED_SW_SOURCE_CORE_INC_FLYFRMS_HXX
21
22#include <sal/config.h>
23
24#include "flyfrm.hxx"
25#include "flowfrm.hxx"
26
27class SwNoTextFrame;
28
30
31// Base class for those Flys that can "move freely" or better that are not
32// bound in Content.
34{
35private:
36 // #i34753# - flag for at-page anchored Writer fly frames
37 // to prevent a positioning - call of method <MakeObjPos()> -, if Writer
38 // fly frame is already clipped during its format by the object formatter.
39 bool mbNoMakePos : 1;
40
41 // #i37068# - flag to prevent move in method <CheckClip(..)>
43
45
46 // RotateFlyFrame3 add TransformableSwFrame
47 std::unique_ptr< TransformableSwFrame > mpTransformableSwFrame;
48
49 void CheckClip( const SwFormatFrameSize &rSz ); //'Emergency' Clipping.
50
61 bool HasEnvironmentAutoSize() const;
62
63 // RotateFlyFrame3 - Support for outer Frame of a SwGrfNode
64 // Only for local data extraction. To uniquely access information
65 // for local transformation, use getFrameArea(Print)Transformation
66 double getLocalFrameRotation() const;
67
68protected:
69 // #i28701# - new friend class <SwFlyNotify> for access to
70 // method <NotifyBackground>
71 friend class SwFlyNotify;
72 virtual void NotifyBackground( SwPageFrame *pPage,
73 const SwRect& rRect, PrepareHint eHint) override;
75
76 virtual void DestroyImpl() override;
77 virtual ~SwFlyFreeFrame() override;
78
79public:
80 // #i28701#
81
82 virtual void MakeAll(vcl::RenderContext* pRenderContext) override;
83
84 // #i37068# - accessors for member <mbNoMoveOnCheckClip>
85 void SetNoMoveOnCheckClip( const bool _bNewNoMoveOnCheckClip )
86 {
87 mbNoMoveOnCheckClip = _bNewNoMoveOnCheckClip;
88 }
90 {
92 }
93 // #i34753# - accessors for member <mbNoMakePos>
94 void SetNoMakePos( const bool _bNoMakePos )
95 {
96 if ( IsFlyLayFrame() )
97 {
98 mbNoMakePos = _bNoMakePos;
99 }
100 }
101 bool IsNoMakePos() const
102 {
103 if ( IsFlyLayFrame() )
104 {
105 return mbNoMakePos;
106 }
107 else
108 {
109 return false;
110 }
111 }
112
113 const SwRect& GetUnclippedFrame( ) const
114 {
115 if ( maUnclippedFrame.HasArea( ) )
116 return maUnclippedFrame;
117 else
118 return getFrameArea();
119 }
120
129 virtual bool IsFormatPossible() const override;
130
131 // RotateFlyFrame3 - Support for Transformations
132 bool isTransformableSwFrame() const { return bool(mpTransformableSwFrame); }
135
136 // RotateFlyFrame3 - Support for AutoContour
137 bool supportsAutoContour() const;
138
139 // RotateFlyFrame3 - Support for Transformations
140 virtual basegfx::B2DHomMatrix getFrameAreaTransformation() const override;
142
143 // RotateFlyFrame3 - Support for Transformations
144 virtual void transform_translate(const Point& rOffset) override;
145};
146
147// Flys that are bound to LayoutFrames and not to Content
148class SwFlyLayFrame final: public SwFlyFreeFrame
149{
150public:
151 // #i28701#
152
154
155 virtual void RegisterAtPage(SwPageFrame &) override;
156 virtual void SwClientNotify(const SwModify&, const SfxHint&) override;
157};
158
159// Flys that are bound to Content but not in Content
161{
162 virtual void MakeAll(vcl::RenderContext* pRenderContext) override;
163
164 // #i28701#
165 virtual bool InvalidationAllowed( const InvalidationType _nInvalid ) const override;
166
172 virtual void RegisterAtCorrectPage() override;
173 virtual void RegisterAtPage(SwPageFrame &) override;
174 virtual void SwClientNotify(const SwModify&, const SfxHint&) override;
175 bool ShouldBwdMoved(SwLayoutFrame* pNewUpper, bool& rReformat) override;
176
177public:
178 // #i28701#
179
182
183 void SetAbsPos( const Point &rNew );
184
185 // #i26791#
186 virtual void MakeObjPos() override;
187
195 virtual bool IsFormatPossible() const override;
196 const SwFlyAtContentFrame* GetFollow() const;
198};
199
200// Flys that are bound to a character in Content
202{
203 Point m_aRef; // relative to this point AbsPos is being calculated
204
205 virtual void DestroyImpl() override;
206 virtual ~SwFlyInContentFrame() override;
207
208 virtual void NotifyBackground(SwPageFrame *pPage, const SwRect& rRect, PrepareHint eHint) override;
209 virtual void MakeAll(vcl::RenderContext* pRenderContext) override;
210 virtual void SwClientNotify(const SwModify&, const SfxHint&) override;
211
212public:
213 // #i28701#
214
216
217 virtual void Format( vcl::RenderContext* pRenderContext, const SwBorderAttrs *pAttrs = nullptr ) override;
218
219 void SetRefPoint( const Point& rPoint, const Point &rRelAttr,
220 const Point &rRelPos );
221 const Point &GetRefPoint() const { return m_aRef; }
222 Point const & GetRelPos() const;
223
224 // (26.11.93, see tabfrm.hxx, but might also be valid for others)
225 // For creation of a Fly after a FlyCnt was created _and_ inserted.
226 // Must be called by creator because can be pasted only after creation.
227 // Sometimes the page for registering the Flys is not visible until then
228 // as well.
229 void RegistFlys();
230
231 //see layact.cxx
232 void AddRefOfst( tools::Long nOfst ) { m_aRef.AdjustY( nOfst ); }
233 void AddRefOfst(Point const& rOfst) { m_aRef += rOfst; }
234
235 // #i26791#
236 virtual void MakeObjPos() override;
237
238 // invalidate anchor frame on invalidation of the position, because the
239 // position is calculated during the format of the anchor frame
240 virtual void ActionOnInvalidation( const InvalidationType _nInvalid ) override;
241};
242
243#endif
244
245/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual bool InvalidationAllowed(const InvalidationType _nInvalid) const override
method to determine, if an invalidation is allowed.
Definition: flycnt.cxx:1514
virtual void MakeAll(vcl::RenderContext *pRenderContext) override
|* With a paragraph-anchored fly it's absolutely possible that |* the anchor reacts to changes of the...
Definition: flycnt.cxx:325
bool ShouldBwdMoved(SwLayoutFrame *pNewUpper, bool &rReformat) override
Definition: flycnt.cxx:1531
virtual void MakeObjPos() override
method to determine position for the object and set the position at the object
Definition: flycnt.cxx:1483
void SetAbsPos(const Point &rNew)
Definition: flycnt.cxx:1232
virtual void RegisterAtCorrectPage() override
method to assure that anchored object is registered at the correct page frame
Definition: flycnt.cxx:1456
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: flycnt.cxx:95
const SwFlyAtContentFrame * GetFollow() const
Definition: flycnt.cxx:1536
SwFlyAtContentFrame(SwFlyFrameFormat *, SwFrame *, SwFrame *pAnchor)
Definition: flycnt.cxx:77
virtual bool IsFormatPossible() const override
method to determine, if a format on the Writer fly frame is possible
Definition: flycnt.cxx:585
virtual void RegisterAtPage(SwPageFrame &) override
Definition: flycnt.cxx:1469
general base class for all free-flowing frames
Definition: flyfrm.hxx:79
bool IsFlyLayFrame() const
Definition: flyfrm.hxx:220
bool HasEnvironmentAutoSize() const
determines, if direct environment of fly frame has 'auto' size
Definition: flylay.cxx:445
virtual void MakeAll(vcl::RenderContext *pRenderContext) override
Definition: flylay.cxx:113
SwFlyFreeFrame(SwFlyFrameFormat *, SwFrame *, SwFrame *pAnchor)
Definition: flylay.cxx:55
virtual ~SwFlyFreeFrame() override
Definition: flylay.cxx:92
void SetNoMoveOnCheckClip(const bool _bNewNoMoveOnCheckClip)
Definition: flyfrms.hxx:85
bool isTransformableSwFrame() const
Definition: flyfrms.hxx:132
bool mbNoMoveOnCheckClip
Definition: flyfrms.hxx:42
std::unique_ptr< TransformableSwFrame > mpTransformableSwFrame
Definition: flyfrms.hxx:47
SwRect maUnclippedFrame
Definition: flyfrms.hxx:44
void SetNoMakePos(const bool _bNoMakePos)
Definition: flyfrms.hxx:94
const SwRect & GetUnclippedFrame() const
Definition: flyfrms.hxx:113
virtual void DestroyImpl() override
Definition: flylay.cxx:64
virtual basegfx::B2DHomMatrix getFrameAreaTransformation() const override
Definition: flylay.cxx:371
const TransformableSwFrame * getTransformableSwFrame() const
Definition: flyfrms.hxx:134
double getLocalFrameRotation() const
Definition: flylay.cxx:420
bool IsNoMakePos() const
Definition: flyfrms.hxx:101
bool supportsAutoContour() const
Definition: flylay.cxx:302
virtual void NotifyBackground(SwPageFrame *pPage, const SwRect &rRect, PrepareHint eHint) override
Notifies the background (all ContentFrames that currently are overlapping).
Definition: flylay.cxx:107
bool IsNoMoveOnCheckClip() const
Definition: flyfrms.hxx:89
void CheckClip(const SwFormatFrameSize &rSz)
Definition: flylay.cxx:471
virtual basegfx::B2DHomMatrix getFramePrintAreaTransformation() const override
Definition: flylay.cxx:383
virtual void transform_translate(const Point &rOffset) override
Definition: flylay.cxx:396
bool mbNoMakePos
Definition: flyfrms.hxx:39
virtual bool IsFormatPossible() const override
method to determine, if a format on the Writer fly frame is possible
Definition: flylay.cxx:710
TransformableSwFrame * getTransformableSwFrame()
Definition: flyfrms.hxx:133
virtual void NotifyBackground(SwPageFrame *pPage, const SwRect &rRect, PrepareHint eHint) override
method to trigger notification of 'background'
Definition: flyincnt.cxx:191
virtual ~SwFlyInContentFrame() override
Definition: flyincnt.cxx:57
const Point & GetRefPoint() const
Definition: flyfrms.hxx:221
void AddRefOfst(Point const &rOfst)
Definition: flyfrms.hxx:233
SwFlyInContentFrame(SwFlyFrameFormat *, SwFrame *, SwFrame *pAnchor)
Definition: flyincnt.cxx:32
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: flyincnt.cxx:95
virtual void ActionOnInvalidation(const InvalidationType _nInvalid) override
method to perform additional actions on an invalidation
Definition: flyincnt.cxx:185
virtual void MakeObjPos() override
Calculate object position.
Definition: flyincnt.cxx:162
void AddRefOfst(tools::Long nOfst)
Definition: flyfrms.hxx:232
Point const & GetRelPos() const
Definition: flyincnt.cxx:200
virtual void MakeAll(vcl::RenderContext *pRenderContext) override
Definition: flyincnt.cxx:214
void SetRefPoint(const Point &rPoint, const Point &rRelAttr, const Point &rRelPos)
Definition: flyincnt.cxx:63
virtual void DestroyImpl() override
Definition: flyincnt.cxx:46
virtual void Format(vcl::RenderContext *pRenderContext, const SwBorderAttrs *pAttrs=nullptr) override
Here the content gets formatted initially.
Definition: flyincnt.cxx:142
virtual void RegisterAtPage(SwPageFrame &) override
Definition: flylay.cxx:723
SwFlyLayFrame(SwFlyFrameFormat *, SwFrame *, SwFrame *pAnchor)
Definition: flylay.cxx:717
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: flylay.cxx:738
const SwRect & getFrameArea() const
Definition: frame.hxx:179
Base class of the Writer layout elements.
Definition: frame.hxx:315
InvalidationType
enumeration for the different invalidations #i28701#
Definition: frame.hxx:489
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame.
Definition: layfrm.hxx:36
friend class SwFlowFrame
Definition: layfrm.hxx:38
A page of the document layout.
Definition: pagefrm.hxx:58
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
bool HasArea() const
Definition: swrect.hxx:300
RotateFlyFrame3: Helper class when you want to make your SwFrame derivate transformable.
Definition: frame.hxx:236
double getLocalFrameRotation_from_SwNoTextFrame(const SwNoTextFrame &rNoTextFrame)
Definition: flylay.cxx:415
long Long
PrepareHint
Definition: swtypes.hxx:206