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
26class SwNoTextFrame;
27
29
30// Base class for those Flys that can "move freely" or better that are not
31// bound in Content.
33{
34private:
35 // #i34753# - flag for at-page anchored Writer fly frames
36 // to prevent a positioning - call of method <MakeObjPos()> -, if Writer
37 // fly frame is already clipped during its format by the object formatter.
38 bool mbNoMakePos : 1;
39
40 // #i37068# - flag to prevent move in method <CheckClip(..)>
42
44
45 // RotateFlyFrame3 add TransformableSwFrame
46 std::unique_ptr< TransformableSwFrame > mpTransformableSwFrame;
47
48 void CheckClip( const SwFormatFrameSize &rSz ); //'Emergency' Clipping.
49
60 bool HasEnvironmentAutoSize() const;
61
62 // RotateFlyFrame3 - Support for outer Frame of a SwGrfNode
63 // Only for local data extraction. To uniquely access information
64 // for local transformation, use getFrameArea(Print)Transformation
65 double getLocalFrameRotation() const;
66
67protected:
68 // #i28701# - new friend class <SwFlyNotify> for access to
69 // method <NotifyBackground>
70 friend class SwFlyNotify;
71 virtual void NotifyBackground( SwPageFrame *pPage,
72 const SwRect& rRect, PrepareHint eHint) override;
74
75 virtual void DestroyImpl() override;
76 virtual ~SwFlyFreeFrame() override;
77
78public:
79 // #i28701#
80
81 virtual void MakeAll(vcl::RenderContext* pRenderContext) override;
82
83 // #i37068# - accessors for member <mbNoMoveOnCheckClip>
84 void SetNoMoveOnCheckClip( const bool _bNewNoMoveOnCheckClip )
85 {
86 mbNoMoveOnCheckClip = _bNewNoMoveOnCheckClip;
87 }
89 {
91 }
92 // #i34753# - accessors for member <mbNoMakePos>
93 void SetNoMakePos( const bool _bNoMakePos )
94 {
95 if ( IsFlyLayFrame() )
96 {
97 mbNoMakePos = _bNoMakePos;
98 }
99 }
100 bool IsNoMakePos() const
101 {
102 if ( IsFlyLayFrame() )
103 {
104 return mbNoMakePos;
105 }
106 else
107 {
108 return false;
109 }
110 }
111
112 const SwRect& GetUnclippedFrame( ) const
113 {
114 if ( maUnclippedFrame.HasArea( ) )
115 return maUnclippedFrame;
116 else
117 return getFrameArea();
118 }
119
128 virtual bool IsFormatPossible() const override;
129
130 // RotateFlyFrame3 - Support for Transformations
131 bool isTransformableSwFrame() const { return bool(mpTransformableSwFrame); }
134
135 // RotateFlyFrame3 - Support for AutoContour
136 bool supportsAutoContour() const;
137
138 // RotateFlyFrame3 - Support for Transformations
139 virtual basegfx::B2DHomMatrix getFrameAreaTransformation() const override;
141
142 // RotateFlyFrame3 - Support for Transformations
143 virtual void transform_translate(const Point& rOffset) override;
144};
145
146// Flys that are bound to LayoutFrames and not to Content
147class SwFlyLayFrame final: public SwFlyFreeFrame
148{
149public:
150 // #i28701#
151
153 virtual void SwClientNotify(const SwModify&, const SfxHint&) override;
154};
155
156// Flys that are bound to Content but not in Content
158{
159 virtual void MakeAll(vcl::RenderContext* pRenderContext) override;
160
161 // #i28701#
162 virtual bool InvalidationAllowed( const InvalidationType _nInvalid ) const override;
163
169 virtual void RegisterAtCorrectPage() override;
170 virtual void RegisterAtPage(SwPageFrame &) override;
171 virtual void SwClientNotify(const SwModify&, const SfxHint&) override;
172
173public:
174 // #i28701#
175
177
178 void SetAbsPos( const Point &rNew );
179
180 // #i26791#
181 virtual void MakeObjPos() override;
182
190 virtual bool IsFormatPossible() const override;
191};
192
193// Flys that are bound to a character in Content
195{
196 Point m_aRef; // relative to this point AbsPos is being calculated
197
198 virtual void DestroyImpl() override;
199 virtual ~SwFlyInContentFrame() override;
200
201 virtual void NotifyBackground(SwPageFrame *pPage, const SwRect& rRect, PrepareHint eHint) override;
202 virtual void MakeAll(vcl::RenderContext* pRenderContext) override;
203 virtual void SwClientNotify(const SwModify&, const SfxHint&) override;
204
205public:
206 // #i28701#
207
209
210 virtual void Format( vcl::RenderContext* pRenderContext, const SwBorderAttrs *pAttrs = nullptr ) override;
211
212 void SetRefPoint( const Point& rPoint, const Point &rRelAttr,
213 const Point &rRelPos );
214 const Point &GetRefPoint() const { return m_aRef; }
215 Point const & GetRelPos() const;
216
217 // (26.11.93, see tabfrm.hxx, but might also be valid for others)
218 // For creation of a Fly after a FlyCnt was created _and_ inserted.
219 // Must be called by creator because can be pasted only after creation.
220 // Sometimes the page for registering the Flys is not visible until then
221 // as well.
222 void RegistFlys();
223
224 //see layact.cxx
225 void AddRefOfst( tools::Long nOfst ) { m_aRef.AdjustY( nOfst ); }
226 void AddRefOfst(Point const& rOfst) { m_aRef += rOfst; }
227
228 // #i26791#
229 virtual void MakeObjPos() override;
230
231 // invalidate anchor frame on invalidation of the position, because the
232 // position is calculated during the format of the anchor frame
233 virtual void ActionOnInvalidation( const InvalidationType _nInvalid ) override;
234};
235
236#endif
237
238/* 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:1505
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:315
virtual void MakeObjPos() override
method to determine position for the object and set the position at the object
Definition: flycnt.cxx:1474
void SetAbsPos(const Point &rNew)
Definition: flycnt.cxx:1222
virtual void RegisterAtCorrectPage() override
method to assure that anchored object is registered at the correct page frame
Definition: flycnt.cxx:1447
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: flycnt.cxx:85
SwFlyAtContentFrame(SwFlyFrameFormat *, SwFrame *, SwFrame *pAnchor)
Definition: flycnt.cxx:76
virtual bool IsFormatPossible() const override
method to determine, if a format on the Writer fly frame is possible
Definition: flycnt.cxx:575
virtual void RegisterAtPage(SwPageFrame &) override
Definition: flycnt.cxx:1460
general base class for all free-flowing frames
Definition: flyfrm.hxx:79
bool IsFlyLayFrame() const
Definition: flyfrm.hxx:217
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:84
bool isTransformableSwFrame() const
Definition: flyfrms.hxx:131
bool mbNoMoveOnCheckClip
Definition: flyfrms.hxx:41
std::unique_ptr< TransformableSwFrame > mpTransformableSwFrame
Definition: flyfrms.hxx:46
SwRect maUnclippedFrame
Definition: flyfrms.hxx:43
void SetNoMakePos(const bool _bNoMakePos)
Definition: flyfrms.hxx:93
const SwRect & GetUnclippedFrame() const
Definition: flyfrms.hxx:112
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:133
double getLocalFrameRotation() const
Definition: flylay.cxx:420
bool IsNoMakePos() const
Definition: flyfrms.hxx:100
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:88
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:38
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:132
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:214
void AddRefOfst(Point const &rOfst)
Definition: flyfrms.hxx:226
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:225
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
SwFlyLayFrame(SwFlyFrameFormat *, SwFrame *, SwFrame *pAnchor)
Definition: flylay.cxx:717
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: flylay.cxx:725
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 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:194