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 
27 class SwNoTextNode;
28 class OutputDevice;
29 class SwBorderAttrs;
30 struct SwCursorMoveState;
31 
33 {
34 private:
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 
59 protected:
60  virtual void MakeAll(vcl::RenderContext* pRenderContext) override;
61  virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ) override;
62 
63 public:
64  SwNoTextFrame( SwNoTextNode * const, SwFrame* );
65 
66  const SwContentNode *GetNode() const
67  { return static_cast<SwContentNode const*>(GetDep()); }
69  { return static_cast<SwContentNode *>(GetDep()); }
70 
71  virtual bool LeftMargin(SwPaM *) const override;
72  virtual bool RightMargin(SwPaM *, bool bAPI = false) const override;
73 
74  virtual void PaintSwFrame( vcl::RenderContext& rRenderContext, SwRect const&,
75  SwPrintData const*const pPrintData = nullptr ) const override;
76  virtual bool GetCharRect( SwRect &, const SwPosition&,
77  SwCursorMoveState* = nullptr, bool bAllowFarAway = true ) const override;
78  virtual bool GetModelPositionForViewPoint(SwPosition* pPos, Point& aPoint,
79  SwCursorMoveState* = nullptr, bool bTestBackground = false) const override;
80 
81  void GetGrfArea( SwRect &rRect, SwRect * ) const;
82 
83  bool IsTransparent() const;
84 
85  void StopAnimation( OutputDevice* = nullptr ) const;
86  bool HasAnimation() const;
87 
88  // RotateFlyFrame3 - Support for Transformations
89  bool isTransformableSwFrame() const { return bool(mpTransformableSwFrame); }
90  TransformableSwFrame* getTransformableSwFrame() { return mpTransformableSwFrame.get(); }
91  const TransformableSwFrame* getTransformableSwFrame() const { return mpTransformableSwFrame.get(); }
92 
93  // RotateFlyFrame3 - Support for Transformations
94  virtual basegfx::B2DHomMatrix getFrameAreaTransformation() const override;
96 
97  // RotateFlyFrame3 - Support for Transformations
98  virtual void transform_translate(const Point& rOffset) override;
99 };
100 
101 #endif
102 
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Base class of the Writer layout elements.
Definition: frame.hxx:297
virtual basegfx::B2DHomMatrix getFramePrintAreaTransformation() const override
Definition: notxtfrm.cxx:601
TransformableSwFrame * getTransformableSwFrame()
Definition: notxtfrm.hxx:90
virtual bool RightMargin(SwPaM *, bool bAPI=false) const override
Definition: trvlfrm.cxx:624
Marks a position in the document model.
Definition: pam.hxx:35
virtual ~SwNoTextFrame() override
Definition: notxtfrm.cxx:170
virtual basegfx::B2DHomMatrix getFrameAreaTransformation() const override
Definition: notxtfrm.cxx:589
SwModify * GetDep()
use these so we can grep for SwFrame's GetRegisteredIn accesses beware that SwTextFrame may return sw...
Definition: frame.hxx:459
sdr::contact::ViewContact & GetViewContact() const
Definition: notxtfrm.cxx:1157
SwNoTextFrame(SwNoTextNode *const, SwFrame *)
Definition: notxtfrm.cxx:148
RotateFlyFrame3: Helper class when you want to make your SwFrame derivate transformable.
Definition: frame.hxx:233
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
void Format(vcl::RenderContext *pRenderContext, const SwBorderAttrs *pAttrs=nullptr) override
Calculate the Bitmap's site, if needed.
Definition: notxtfrm.cxx:657
virtual void MakeAll(vcl::RenderContext *pRenderContext) override
Definition: notxtfrm.cxx:483
double getLocalFrameRotation() const
Definition: notxtfrm.cxx:634
virtual void Modify(const SfxPoolItem *, const SfxPoolItem *) override
Definition: notxtfrm.cxx:723
bool HasAnimation() const
Definition: notxtfrm.cxx:1543
virtual bool GetModelPositionForViewPoint(SwPosition *pPos, Point &aPoint, SwCursorMoveState *=nullptr, bool bTestBackground=false) const override
Definition: notxtfrm.cxx:704
virtual bool LeftMargin(SwPaM *) const override
Layout dependent cursor travelling.
Definition: trvlfrm.cxx:615
std::unique_ptr< TransformableSwFrame > mpTransformableSwFrame
Definition: notxtfrm.hxx:45
SwContentNode * GetNode()
Definition: notxtfrm.hxx:68
virtual void transform_translate(const Point &rOffset) override
Definition: notxtfrm.cxx:614
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
const TransformableSwFrame * getTransformableSwFrame() const
Definition: notxtfrm.hxx:91
void PaintPicture(vcl::RenderContext *, const SwRect &) const
Paint the graphic.
Definition: notxtfrm.cxx:1175
std::unique_ptr< sdr::contact::ViewContact > mpViewContact
Definition: notxtfrm.hxx:56
virtual void PaintSwFrame(vcl::RenderContext &rRenderContext, SwRect const &, SwPrintData const *const pPrintData=nullptr) const override
Definition: notxtfrm.cxx:219
const Size & GetSize() const
By returning the surrounding Fly's size which equals the graphic's size.
Definition: notxtfrm.cxx:474
bool IsTransparent() const
Definition: notxtfrm.cxx:1486
const SwContentNode * GetNode() const
Definition: notxtfrm.hxx:66
void StopAnimation(OutputDevice *=nullptr) const
Definition: notxtfrm.cxx:1532
void GetGrfArea(SwRect &rRect, SwRect *) const
Calculate the Bitmap's position and the size within the passed rectangle.
Definition: notxtfrm.cxx:352
void ClearCache()
Definition: notxtfrm.cxx:713
virtual bool GetCharRect(SwRect &, const SwPosition &, SwCursorMoveState *=nullptr, bool bAllowFarAway=true) const override
Definition: notxtfrm.cxx:671
virtual void DestroyImpl() override
Definition: notxtfrm.cxx:163
friend double getLocalFrameRotation_from_SwNoTextFrame(const SwNoTextFrame &rNoTextFrame)
Definition: flylay.cxx:418
friend void FrameFinit()
Definition: newfrm.cxx:305
bool isTransformableSwFrame() const
Definition: notxtfrm.hxx:89