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 #ifndef INCLUDED_SW_SOURCE_CORE_TEXT_PORTXT_HXX
20 #define INCLUDED_SW_SOURCE_CORE_TEXT_PORTXT_HXX
21 
22 #include "porlin.hxx"
23 
24 class SwTextGuess;
25 
28 {
29  void BreakCut( SwTextFormatInfo &rInf, const SwTextGuess &rGuess );
30  void BreakUnderflow( SwTextFormatInfo &rInf );
31  bool Format_( SwTextFormatInfo &rInf );
32 
33 public:
35  static SwTextPortion * CopyLinePortion(const SwLinePortion &rPortion);
36  virtual void Paint( const SwTextPaintInfo &rInf ) const override;
37  virtual bool Format( SwTextFormatInfo &rInf ) override;
38  virtual void FormatEOL( SwTextFormatInfo &rInf ) override;
39  virtual TextFrameIndex GetCursorOfst(sal_uInt16 nOfst) const override;
40  virtual SwPosSize GetTextSize( const SwTextSizeInfo &rInfo ) const override;
41  virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override;
42  virtual long CalcSpacing( long nSpaceAdd, const SwTextSizeInfo &rInf ) const override;
43 
44  // Counts the spaces for justified paragraph
45  TextFrameIndex GetSpaceCnt(const SwTextSizeInfo &rInf, TextFrameIndex& rCnt) const;
46 
47  bool CreateHyphen( SwTextFormatInfo &rInf, SwTextGuess const &rGuess );
48 
49  // Accessibility: pass information about this portion to the PortionHandler
50  virtual void HandlePortion( SwPortionHandler& rPH ) const override;
51 };
52 
54 {
55 public:
57 
58  virtual bool Format( SwTextFormatInfo &rInf ) override;
59  virtual void Paint( const SwTextPaintInfo &rInf ) const override;
60  virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override;
61  virtual SwPosSize GetTextSize( const SwTextSizeInfo &rInfo ) const override;
62 };
63 
65 {
66  sal_uInt16 nBlankWidth;
67 public:
68  explicit SwHolePortion( const SwTextPortion &rPor );
69  sal_uInt16 GetBlankWidth( ) const { return nBlankWidth; }
70  void SetBlankWidth( const sal_uInt16 nNew ) { nBlankWidth = nNew; }
71  virtual SwLinePortion *Compress() override;
72  virtual bool Format( SwTextFormatInfo &rInf ) override;
73  virtual void Paint( const SwTextPaintInfo &rInf ) const override;
74 
75  // Accessibility: pass information about this portion to the PortionHandler
76  virtual void HandlePortion( SwPortionHandler& rPH ) const override;
77 };
78 
80 {
81  public:
83  { }
84  virtual void Paint( const SwTextPaintInfo &rInf ) const override;
85  virtual bool Format( SwTextFormatInfo &rInf ) override;
86 };
87 
89 {
90 public:
92  {
93  }
94  virtual void Paint( const SwTextPaintInfo &rInf ) const override;
95  virtual bool Format( SwTextFormatInfo &rInf ) override;
96 };
97 
98 #endif
99 
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void FormatEOL(SwTextFormatInfo &rInf) override
Definition: portxt.cxx:471
SwHolePortion(const SwTextPortion &rPor)
Definition: portxt.cxx:728
void BreakCut(SwTextFormatInfo &rInf, const SwTextGuess &rGuess)
Definition: portxt.cxx:224
The SwPortionHandler interface implements a visitor for the layout engine's text portions.
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: portxt.cxx:689
bool Format_(SwTextFormatInfo &rInf)
Definition: portxt.cxx:285
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: portxt.cxx:528
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: portxt.cxx:780
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: portxt.cxx:443
This portion represents a part of the paragraph string.
Definition: portxt.hxx:27
static SwTextPortion * CopyLinePortion(const SwLinePortion &rPortion)
Definition: portxt.cxx:216
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: portxt.cxx:770
sal_uInt16 nBlankWidth
Definition: portxt.hxx:66
virtual SwLinePortion * Compress() override
Definition: portxt.cxx:737
void SetWhichPor(const PortionType nNew)
Definition: porlin.hxx:93
void SetBlankWidth(const sal_uInt16 nNew)
Definition: portxt.hxx:70
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
Definition: portxt.cxx:699
sal_uInt16 GetBlankWidth() const
Definition: portxt.hxx:69
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: portxt.cxx:786
Base class for anything that can be part of a line in the Writer layout.
Definition: porlin.hxx:49
virtual long CalcSpacing(long nSpaceAdd, const SwTextSizeInfo &rInf) const override
Definition: portxt.cxx:616
bool CreateHyphen(SwTextFormatInfo &rInf, SwTextGuess const &rGuess)
Definition: txthyph.cxx:254
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: portxt.cxx:684
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
Definition: portxt.cxx:570
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: portxt.cxx:739
virtual TextFrameIndex GetCursorOfst(sal_uInt16 nOfst) const override
the parameter is actually SwTwips apparently?
Definition: portxt.cxx:506
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: portxt.cxx:809
TextFrameIndex GetSpaceCnt(const SwTextSizeInfo &rInf, TextFrameIndex &rCnt) const
Definition: portxt.cxx:577
void BreakUnderflow(SwTextFormatInfo &rInf)
Definition: portxt.cxx:269
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: portxt.cxx:775
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: portxt.cxx:792
virtual SwPosSize GetTextSize(const SwTextSizeInfo &rInfo) const override
Definition: portxt.cxx:513
virtual SwPosSize GetTextSize(const SwTextSizeInfo &rInfo) const override
Definition: portxt.cxx:717
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: portxt.cxx:673