LibreOffice Module sw (master)  1
portxt.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 #pragma once
20 
21 #include "porlin.hxx"
22 
23 class SwTextGuess;
24 
27 {
28  void BreakCut( SwTextFormatInfo &rInf, const SwTextGuess &rGuess );
29  void BreakUnderflow( SwTextFormatInfo &rInf );
30  bool Format_( SwTextFormatInfo &rInf );
31 
32 public:
34  static SwTextPortion * CopyLinePortion(const SwLinePortion &rPortion);
35  virtual void Paint( const SwTextPaintInfo &rInf ) const override;
36  virtual bool Format( SwTextFormatInfo &rInf ) override;
37  virtual void FormatEOL( SwTextFormatInfo &rInf ) override;
38  virtual TextFrameIndex GetModelPositionForViewPoint(sal_uInt16 nOfst) const override;
39  virtual SwPosSize GetTextSize( const SwTextSizeInfo &rInfo ) const override;
40  virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override;
41  virtual tools::Long CalcSpacing( tools::Long nSpaceAdd, const SwTextSizeInfo &rInf ) const override;
42 
43  // Counts the spaces for justified paragraph
44  TextFrameIndex GetSpaceCnt(const SwTextSizeInfo &rInf, TextFrameIndex& rCnt) const;
45 
46  bool CreateHyphen( SwTextFormatInfo &rInf, SwTextGuess const &rGuess );
47 
48  // Accessibility: pass information about this portion to the PortionHandler
49  virtual void HandlePortion( SwPortionHandler& rPH ) const override;
50 };
51 
53 {
54 public:
56 
57  virtual bool Format( SwTextFormatInfo &rInf ) override;
58  virtual void Paint( const SwTextPaintInfo &rInf ) const override;
59  virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override;
60  virtual SwPosSize GetTextSize( const SwTextSizeInfo &rInfo ) const override;
61 };
62 
64 {
65  sal_uInt16 m_nBlankWidth;
66 public:
67  explicit SwHolePortion( const SwTextPortion &rPor );
68  sal_uInt16 GetBlankWidth( ) const { return m_nBlankWidth; }
69  void SetBlankWidth( const sal_uInt16 nNew ) { m_nBlankWidth = nNew; }
70  virtual SwLinePortion *Compress() override;
71  virtual bool Format( SwTextFormatInfo &rInf ) override;
72  virtual void Paint( const SwTextPaintInfo &rInf ) const override;
73 
74  // Accessibility: pass information about this portion to the PortionHandler
75  virtual void HandlePortion( SwPortionHandler& rPH ) const override;
76 };
77 
79 {
80  public:
82  {
84  }
85  virtual void Paint( const SwTextPaintInfo &rInf ) const override;
86  virtual bool Format( SwTextFormatInfo &rInf ) override;
87 };
88 
90 {
91 public:
93  {
95  }
96  virtual void Paint( const SwTextPaintInfo &rInf ) const override;
97  virtual bool Format( SwTextFormatInfo &rInf ) override;
98 };
99 
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void FormatEOL(SwTextFormatInfo &rInf) override
Definition: portxt.cxx:467
SwHolePortion(const SwTextPortion &rPor)
Definition: portxt.cxx:745
void BreakCut(SwTextFormatInfo &rInf, const SwTextGuess &rGuess)
Definition: portxt.cxx:219
long Long
The SwPortionHandler interface implements a visitor for the layout engine's text portions.
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: portxt.cxx:684
virtual tools::Long CalcSpacing(tools::Long nSpaceAdd, const SwTextSizeInfo &rInf) const override
Definition: portxt.cxx:611
bool Format_(SwTextFormatInfo &rInf)
Definition: portxt.cxx:280
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: portxt.cxx:523
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: portxt.cxx:796
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: portxt.cxx:439
sal_uInt16 m_nBlankWidth
Definition: portxt.hxx:65
This portion represents a part of the paragraph string.
Definition: portxt.hxx:26
static SwTextPortion * CopyLinePortion(const SwLinePortion &rPortion)
Definition: portxt.cxx:211
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: portxt.cxx:786
virtual SwLinePortion * Compress() override
Definition: portxt.cxx:754
void SetWhichPor(const PortionType nNew)
Definition: porlin.hxx:93
void SetBlankWidth(const sal_uInt16 nNew)
Definition: portxt.hxx:69
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
Definition: portxt.cxx:716
virtual TextFrameIndex GetModelPositionForViewPoint(sal_uInt16 nOfst) const override
the parameter is actually SwTwips apparently?
Definition: portxt.cxx:501
sal_uInt16 GetBlankWidth() const
Definition: portxt.hxx:68
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: portxt.cxx:802
Base class for anything that can be part of a line in the Writer layout.
Definition: porlin.hxx:49
bool CreateHyphen(SwTextFormatInfo &rInf, SwTextGuess const &rGuess)
Definition: txthyph.cxx:252
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: portxt.cxx:679
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
Definition: portxt.cxx:565
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: portxt.cxx:756
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: portxt.cxx:825
TextFrameIndex GetSpaceCnt(const SwTextSizeInfo &rInf, TextFrameIndex &rCnt) const
Definition: portxt.cxx:572
void BreakUnderflow(SwTextFormatInfo &rInf)
Definition: portxt.cxx:264
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: portxt.cxx:791
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: portxt.cxx:808
virtual SwPosSize GetTextSize(const SwTextSizeInfo &rInfo) const override
Definition: portxt.cxx:508
virtual SwPosSize GetTextSize(const SwTextSizeInfo &rInfo) const override
Definition: portxt.cxx:734
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: portxt.cxx:668