LibreOffice Module sw (master) 1
porfly.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
20#pragma once
21
23
24#include "porglue.hxx"
25#include <flyfrms.hxx>
26
27class SwDrawContact;
28class SwTextFrame;
30
32{
33 sal_uInt16 m_nBlankWidth;
34public:
35 explicit SwFlyPortion( const SwRect &rFlyRect )
37 sal_uInt16 GetBlankWidth( ) const { return m_nBlankWidth; }
38 void SetBlankWidth( const sal_uInt16 nNew ) { m_nBlankWidth = nNew; }
39 virtual void Paint( const SwTextPaintInfo &rInf ) const override;
40 virtual bool Format( SwTextFormatInfo &rInf ) override;
41};
42
45{
46 Point m_aRef; // Relatively to this point we calculate the AbsPos
47 bool m_bMax; // Line adjustment and height == line height
48 bool m_bDeleted; // Part of tracked deletion: it needs strikethrough
49 size_t m_nAuthor; // Redline author for color of the strikethrough
51
52 virtual SdrObject* GetSdrObj(const SwTextFrame&) =0;
53
54public:
56 const Point& GetRefPoint() const { return m_aRef; }
57 bool IsMax() const { return m_bMax; }
58 bool IsDeleted() const { return m_bDeleted; }
59 void SetAuthor(size_t nAuthor) { m_nAuthor = nAuthor; }
60 size_t GetAuthor() const { return m_nAuthor; }
61 sw::LineAlign GetAlign() const { return m_eAlign; }
62 void SetAlign(sw::LineAlign eAlign) { m_eAlign = eAlign; }
63 void SetMax(bool bMax) { m_bMax = bMax; }
64 void SetDeleted(bool bDeleted) { m_bDeleted = bDeleted; }
65 void SetBase(const SwTextFrame& rFrame, const Point& rBase, tools::Long nLnAscent, tools::Long nLnDescent, tools::Long nFlyAscent, tools::Long nFlyDescent, AsCharFlags nFlags);
66 virtual bool Format(SwTextFormatInfo& rInf) override;
67};
68
69namespace sw
70{
72 {
74 virtual SdrObject* GetSdrObj(const SwTextFrame&) override;
75 public:
77 static FlyContentPortion* Create(const SwTextFrame& rFrame, SwFlyInContentFrame* pFly, const Point& rBase, tools::Long nAscent, tools::Long nDescent, tools::Long nFlyAsc, tools::Long nFlyDesc, AsCharFlags nFlags);
79 void GetFlyCursorOfst(Point& rPoint, SwPosition& rPos, SwCursorMoveState* pCMS) const { m_pFly->GetModelPositionForViewPoint(&rPos, rPoint, pCMS); };
80 virtual void Paint(const SwTextPaintInfo& rInf) const override;
81 virtual ~FlyContentPortion() override;
82 };
84 {
86 virtual SdrObject* GetSdrObj(const SwTextFrame&) override;
87 public:
88 DrawFlyCntPortion(SwFrameFormat const & rFormat);
89 static DrawFlyCntPortion* Create(const SwTextFrame& rFrame, SwFrameFormat const & rFormat, const Point& rBase, tools::Long nAsc, tools::Long nDescent, tools::Long nFlyAsc, tools::Long nFlyDesc, AsCharFlags nFlags);
90 virtual void Paint(const SwTextPaintInfo& rInf) const override;
91 virtual ~DrawFlyCntPortion() override;
92 };
93}
94
95/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ContactObject for connection of formats as representatives of draw objects in SwClient and the object...
Definition: dcontact.hxx:305
This portion represents an as-character anchored fly (shape, frame, etc.)
Definition: porfly.hxx:45
void SetBase(const SwTextFrame &rFrame, const Point &rBase, tools::Long nLnAscent, tools::Long nLnDescent, tools::Long nFlyAscent, tools::Long nFlyDescent, AsCharFlags nFlags)
After setting the RefPoints, the ascent needs to be recalculated because it is dependent on RelPos.
Definition: porfly.cxx:342
void SetAlign(sw::LineAlign eAlign)
Definition: porfly.hxx:62
Point m_aRef
Definition: porfly.hxx:46
virtual SdrObject * GetSdrObj(const SwTextFrame &)=0
void SetDeleted(bool bDeleted)
Definition: porfly.hxx:64
bool IsMax() const
Definition: porfly.hxx:57
size_t m_nAuthor
Definition: porfly.hxx:49
void SetMax(bool bMax)
Definition: porfly.hxx:63
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: porfly.cxx:99
sw::LineAlign GetAlign() const
Definition: porfly.hxx:61
bool m_bDeleted
Definition: porfly.hxx:48
void SetAuthor(size_t nAuthor)
Definition: porfly.hxx:59
bool IsDeleted() const
Definition: porfly.hxx:58
SwFlyCntPortion()
Use the dimensions of pFly->OutRect()
Definition: porfly.cxx:272
sw::LineAlign m_eAlign
Definition: porfly.hxx:50
size_t GetAuthor() const
Definition: porfly.hxx:60
const Point & GetRefPoint() const
Definition: porfly.hxx:56
virtual bool GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const override
Searches the ContentFrame owning the PrtArea containing the point.
Definition: trvlfrm.cxx:540
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: porfly.cxx:52
virtual void Paint(const SwTextPaintInfo &rInf) const override
class SwFlyPortion => we expect a frame-locale SwRect!
Definition: porfly.cxx:48
sal_uInt16 GetBlankWidth() const
Definition: porfly.hxx:37
void SetBlankWidth(const sal_uInt16 nNew)
Definition: porfly.hxx:38
sal_uInt16 m_nBlankWidth
Definition: porfly.hxx:33
SwFlyPortion(const SwRect &rFlyRect)
Definition: porfly.hxx:35
Style of a layout element.
Definition: frmfmt.hxx:62
Base class for anything that can be part of a line in the Writer layout.
Definition: porlin.hxx:52
void SetWhichPor(const PortionType nNew)
Definition: porlin.hxx:101
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:165
static DrawFlyCntPortion * Create(const SwTextFrame &rFrame, SwFrameFormat const &rFormat, const Point &rBase, tools::Long nAsc, tools::Long nDescent, tools::Long nFlyAsc, tools::Long nFlyDesc, AsCharFlags nFlags)
Definition: porfly.cxx:302
virtual SdrObject * GetSdrObj(const SwTextFrame &) override
Definition: porfly.cxx:317
DrawFlyCntPortion(SwFrameFormat const &rFormat)
Definition: porfly.cxx:288
virtual ~DrawFlyCntPortion() override
Definition: porfly.cxx:309
SwDrawContact * m_pContact
Definition: porfly.hxx:85
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porfly.cxx:260
FlyContentPortion(SwFlyInContentFrame *pFly)
Definition: porfly.cxx:282
virtual SdrObject * GetSdrObj(const SwTextFrame &) override
Definition: porfly.cxx:312
SwFlyInContentFrame * m_pFly
Definition: porfly.hxx:73
virtual ~FlyContentPortion() override
Definition: porfly.cxx:310
static FlyContentPortion * Create(const SwTextFrame &rFrame, SwFlyInContentFrame *pFly, const Point &rBase, tools::Long nAscent, tools::Long nDescent, tools::Long nFlyAsc, tools::Long nFlyDesc, AsCharFlags nFlags)
Definition: porfly.cxx:295
void GetFlyCursorOfst(Point &rPoint, SwPosition &rPos, SwCursorMoveState *pCMS) const
Definition: porfly.hxx:79
SwFlyInContentFrame * GetFlyFrame()
Definition: porfly.hxx:78
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porfly.cxx:202
Dialog to specify the properties of date form field.
long Long
Marks a position in the document model.
Definition: pam.hxx:37