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 
25 class SwNoTextNode;
26 class OutputDevice;
27 class SwBorderAttrs;
28 struct SwCursorMoveState;
29 
31 {
32 private:
33  friend void FrameFinit();
34  const Size& GetSize() const;
35 
36  void Format ( vcl::RenderContext* pRenderContext, const SwBorderAttrs *pAttrs = nullptr ) override;
37  void PaintPicture( vcl::RenderContext*, const SwRect& ) const;
38 
39  virtual void DestroyImpl() override;
40  virtual ~SwNoTextFrame() override;
41 
42  // RotateFlyFrame3 add TransformableSwFrame
43  std::unique_ptr< TransformableSwFrame > mpTransformableSwFrame;
44 
45  // RotateFlyFrame3 - Support for inner frame of a SwGrfNode.
46  // Only for local data extraction. To uniquely access information
47  // for local transformation, use getFrameArea(Print)Transformation.
48  friend double getLocalFrameRotation_from_SwNoTextFrame(const SwNoTextFrame& rNoTextFrame);
49  double getLocalFrameRotation() const;
50 
51  void ClearCache();
52 
53 protected:
54  virtual void MakeAll(vcl::RenderContext* pRenderContext) override;
55  virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ) override;
56 
57 public:
58  SwNoTextFrame( SwNoTextNode * const, SwFrame* );
59 
60  const SwContentNode *GetNode() const
61  { return static_cast<SwContentNode const*>(GetDep()); }
63  { return static_cast<SwContentNode *>(GetDep()); }
64 
65  virtual bool LeftMargin(SwPaM *) const override;
66  virtual bool RightMargin(SwPaM *, bool bAPI = false) const override;
67 
68  virtual void PaintSwFrame( vcl::RenderContext& rRenderContext, SwRect const&,
69  SwPrintData const*const pPrintData = nullptr ) const override;
70  virtual bool GetCharRect( SwRect &, const SwPosition&,
71  SwCursorMoveState* = nullptr, bool bAllowFarAway = true ) const override;
72  virtual bool GetCursorOfst(SwPosition* pPos, Point& aPoint,
73  SwCursorMoveState* = nullptr, bool bTestBackground = false) const override;
74 
75  void GetGrfArea( SwRect &rRect, SwRect * ) const;
76 
77  bool IsTransparent() const;
78 
79  void StopAnimation( OutputDevice* = nullptr ) const;
80  bool HasAnimation() const;
81 
82  // RotateFlyFrame3 - Support for Transformations
83  bool isTransformableSwFrame() const { return bool(mpTransformableSwFrame); }
84  TransformableSwFrame* getTransformableSwFrame() { return mpTransformableSwFrame.get(); }
85  const TransformableSwFrame* getTransformableSwFrame() const { return mpTransformableSwFrame.get(); }
86 
87  // RotateFlyFrame3 - Support for Transformations
88  virtual basegfx::B2DHomMatrix getFrameAreaTransformation() const override;
90 
91  // RotateFlyFrame3 - Support for Transformations
92  virtual void transform_translate(const Point& rOffset) override;
93 };
94 
95 #endif
96 
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Base class of the Writer layout elements.
Definition: frame.hxx:295
virtual basegfx::B2DHomMatrix getFramePrintAreaTransformation() const override
Definition: notxtfrm.cxx:601
TransformableSwFrame * getTransformableSwFrame()
Definition: notxtfrm.hxx:84
virtual bool RightMargin(SwPaM *, bool bAPI=false) const override
Definition: trvlfrm.cxx:621
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:457
SwNoTextFrame(SwNoTextNode *const, SwFrame *)
Definition: notxtfrm.cxx:150
RotateFlyFrame3: Helper class when you want to make your SwFrame derivate transformable.
Definition: frame.hxx:231
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
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:1370
virtual bool GetCursorOfst(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:612
std::unique_ptr< TransformableSwFrame > mpTransformableSwFrame
Definition: notxtfrm.hxx:43
SwContentNode * GetNode()
Definition: notxtfrm.hxx:62
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:85
void PaintPicture(vcl::RenderContext *, const SwRect &) const
Paint the graphic.
Definition: notxtfrm.cxx:1050
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:1313
const SwContentNode * GetNode() const
Definition: notxtfrm.hxx:60
void StopAnimation(OutputDevice *=nullptr) const
Definition: notxtfrm.cxx:1359
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:308
bool isTransformableSwFrame() const
Definition: notxtfrm.hxx:83