LibreOffice Module sw (master) 1
notxtfrm.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_NOTXTFRM_HXX
20#define INCLUDED_SW_SOURCE_CORE_INC_NOTXTFRM_HXX
21
22#include "cntfrm.hxx"
23#include <node.hxx>
24// MM02
26
27class SwNoTextNode;
28class OutputDevice;
29class SwBorderAttrs;
31
32class SwNoTextFrame final : public SwContentFrame
33{
34private:
35 friend void FrameFinit();
36 const Size& GetSize() const;
37
38 void Format ( vcl::RenderContext* pRenderContext, const SwBorderAttrs *pAttrs = nullptr ) override;
39 void PaintPicture( vcl::RenderContext*, const SwRect& ) const;
40
41 virtual void DestroyImpl() override;
42 virtual ~SwNoTextFrame() override;
43
44 // RotateFlyFrame3 add TransformableSwFrame
45 std::unique_ptr< TransformableSwFrame > mpTransformableSwFrame;
46
47 // RotateFlyFrame3 - Support for inner frame of a SwGrfNode.
48 // Only for local data extraction. To uniquely access information
49 // for local transformation, use getFrameArea(Print)Transformation.
50 friend double getLocalFrameRotation_from_SwNoTextFrame(const SwNoTextFrame& rNoTextFrame);
51 double getLocalFrameRotation() const;
52
53 void ClearCache();
54
55 // MM02
56 std::unique_ptr<sdr::contact::ViewContact> mpViewContact;
58 void OnGraphicArrived();
59
60 virtual void MakeAll(vcl::RenderContext* pRenderContext) override;
61 virtual void SwClientNotify(const SwModify&, const SfxHint&) override;
62
64 SwGrfNode* pGrfNd, bool bPrn,
65 const SwRect& rAlignedGrfArea, SwViewShell* pShell, SwNoTextNode& rNoTNd ) const;
67 SwOLENode* pOLENd, bool bIsChart, bool bPrn,
68 const SwRect& rAlignedGrfArea, SwViewShell* pShell ) const;
70 SwGrfNode* pGrfNd, const SwRect& rAlignedGrfArea) const;
71 void ImplPaintPictureReplacement(const GraphicObject& rGrfObj, SwGrfNode* pGrfNd,
72 const SwRect& rAlignedGrfArea, SwViewShell* pShell) const;
73
74public:
76
77 const SwContentNode *GetNode() const
78 { return static_cast<SwContentNode const*>(GetDep()); }
80 { return static_cast<SwContentNode *>(GetDep()); }
81
82 virtual bool LeftMargin(SwPaM *) const override;
83 virtual bool RightMargin(SwPaM *, bool bAPI = false) const override;
84
85 virtual void PaintSwFrame( vcl::RenderContext& rRenderContext, SwRect const&,
86 SwPrintData const*const pPrintData = nullptr ) const override;
87 virtual bool GetCharRect( SwRect &, const SwPosition&,
88 SwCursorMoveState* = nullptr, bool bAllowFarAway = true ) const override;
89 virtual bool GetModelPositionForViewPoint(SwPosition* pPos, Point& aPoint,
90 SwCursorMoveState* = nullptr, bool bTestBackground = false) const override;
91
92 void GetGrfArea( SwRect &rRect, SwRect * ) const;
93
94 bool IsTransparent() const;
95
96 void StopAnimation( const OutputDevice* = nullptr ) const;
97 bool HasAnimation() const;
98
99 // RotateFlyFrame3 - Support for Transformations
100 bool isTransformableSwFrame() const { return bool(mpTransformableSwFrame); }
103
104 // RotateFlyFrame3 - Support for Transformations
105 virtual basegfx::B2DHomMatrix getFrameAreaTransformation() const override;
107
108 // RotateFlyFrame3 - Support for Transformations
109 virtual void transform_translate(const Point& rOffset) override;
110
111 void dumpAsXml(xmlTextWriterPtr writer = nullptr) const override;
112};
113
114#endif
115
116/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
Definition: cntfrm.hxx:59
Base class of the Writer layout elements.
Definition: frame.hxx:315
sw::BroadcastingModify * GetDep()
use these so we can grep for SwFrame's GetRegisteredIn accesses beware that SwTextFrame may return sw...
Definition: frame.hxx:478
SwContentNode * GetNode()
Definition: notxtfrm.hxx:79
friend double getLocalFrameRotation_from_SwNoTextFrame(const SwNoTextFrame &rNoTextFrame)
Definition: flylay.cxx:415
virtual void PaintSwFrame(vcl::RenderContext &rRenderContext, SwRect const &, SwPrintData const *const pPrintData=nullptr) const override
Definition: notxtfrm.cxx:214
virtual void DestroyImpl() override
Definition: notxtfrm.cxx:158
TransformableSwFrame * getTransformableSwFrame()
Definition: notxtfrm.hxx:101
bool HasAnimation() const
Definition: notxtfrm.cxx:1496
std::unique_ptr< TransformableSwFrame > mpTransformableSwFrame
Definition: notxtfrm.hxx:45
virtual void transform_translate(const Point &rOffset) override
Definition: notxtfrm.cxx:609
bool isTransformableSwFrame() const
Definition: notxtfrm.hxx:100
void GetGrfArea(SwRect &rRect, SwRect *) const
Calculate the Bitmap's position and the size within the passed rectangle.
Definition: notxtfrm.cxx:347
void ImplPaintPictureBitmap(vcl::RenderContext *pOut, SwOLENode *pOLENd, bool bIsChart, bool bPrn, const SwRect &rAlignedGrfArea, SwViewShell *pShell) const
Definition: notxtfrm.cxx:1368
void OnGraphicArrived()
Definition: notxtfrm.cxx:729
std::unique_ptr< sdr::contact::ViewContact > mpViewContact
Definition: notxtfrm.hxx:56
const SwContentNode * GetNode() const
Definition: notxtfrm.hxx:77
virtual basegfx::B2DHomMatrix getFramePrintAreaTransformation() const override
Definition: notxtfrm.cxx:596
void StopAnimation(const OutputDevice *=nullptr) const
Definition: notxtfrm.cxx:1485
void ImplPaintPictureGraphic(vcl::RenderContext *pOut, SwGrfNode *pGrfNd, bool bPrn, const SwRect &rAlignedGrfArea, SwViewShell *pShell, SwNoTextNode &rNoTNd) const
Definition: notxtfrm.cxx:1179
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: notxtfrm.cxx:744
const TransformableSwFrame * getTransformableSwFrame() const
Definition: notxtfrm.hxx:102
SwNoTextFrame(SwNoTextNode *const, SwFrame *)
Definition: notxtfrm.cxx:147
void ImplPaintPictureReplacement(const GraphicObject &rGrfObj, SwGrfNode *pGrfNd, const SwRect &rAlignedGrfArea, SwViewShell *pShell) const
Definition: notxtfrm.cxx:1345
virtual bool RightMargin(SwPaM *, bool bAPI=false) const override
Definition: trvlfrm.cxx:625
const Size & GetSize() const
By returning the surrounding Fly's size which equals the graphic's size.
Definition: notxtfrm.cxx:469
virtual bool LeftMargin(SwPaM *) const override
Layout dependent cursor travelling.
Definition: trvlfrm.cxx:617
void PaintPicture(vcl::RenderContext *, const SwRect &) const
Paint the graphic.
Definition: notxtfrm.cxx:1106
sdr::contact::ViewContact & GetViewContact() const
Definition: notxtfrm.cxx:1088
virtual bool GetCharRect(SwRect &, const SwPosition &, SwCursorMoveState *=nullptr, bool bAllowFarAway=true) const override
Definition: notxtfrm.cxx:679
void ImplPaintPictureAnimate(vcl::RenderContext *pOut, SwViewShell *pShell, SwGrfNode *pGrfNd, const SwRect &rAlignedGrfArea) const
Definition: notxtfrm.cxx:1319
virtual void MakeAll(vcl::RenderContext *pRenderContext) override
Definition: notxtfrm.cxx:478
void dumpAsXml(xmlTextWriterPtr writer=nullptr) const override
Definition: notxtfrm.cxx:651
friend void FrameFinit()
Definition: newfrm.cxx:307
bool IsTransparent() const
Definition: notxtfrm.cxx:1439
void ClearCache()
Definition: notxtfrm.cxx:719
void Format(vcl::RenderContext *pRenderContext, const SwBorderAttrs *pAttrs=nullptr) override
Calculate the Bitmap's site, if needed.
Definition: notxtfrm.cxx:665
virtual basegfx::B2DHomMatrix getFrameAreaTransformation() const override
Definition: notxtfrm.cxx:584
virtual ~SwNoTextFrame() override
Definition: notxtfrm.cxx:165
double getLocalFrameRotation() const
Definition: notxtfrm.cxx:629
virtual bool GetModelPositionForViewPoint(SwPosition *pPos, Point &aPoint, SwCursorMoveState *=nullptr, bool bTestBackground=false) const override
Definition: notxtfrm.cxx:712
Layout frame for SwNoTextNode, i.e. graphics and OLE nodes (including charts).
Definition: ndnotxt.hxx:30
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:188
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
RotateFlyFrame3: Helper class when you want to make your SwFrame derivate transformable.
Definition: frame.hxx:236
struct _xmlTextWriter * xmlTextWriterPtr
Marks a position in the document model.
Definition: pam.hxx:38