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  {
85  }
86  virtual void Paint( const SwTextPaintInfo &rInf ) const override;
87  virtual bool Format( SwTextFormatInfo &rInf ) override;
88 };
89 
91 {
92 public:
94  {
96  }
97  virtual void Paint( const SwTextPaintInfo &rInf ) const override;
98  virtual bool Format( SwTextFormatInfo &rInf ) override;
99 };
100 
101 #endif
102 
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void FormatEOL(SwTextFormatInfo &rInf) override
Definition: portxt.cxx:466
SwHolePortion(const SwTextPortion &rPor)
Definition: portxt.cxx:723
void BreakCut(SwTextFormatInfo &rInf, const SwTextGuess &rGuess)
Definition: portxt.cxx:218
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
bool Format_(SwTextFormatInfo &rInf)
Definition: portxt.cxx:279
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: portxt.cxx:523
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: portxt.cxx:775
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: portxt.cxx:438
This portion represents a part of the paragraph string.
Definition: portxt.hxx:27
static SwTextPortion * CopyLinePortion(const SwLinePortion &rPortion)
Definition: portxt.cxx:210
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: portxt.cxx:765
sal_uInt16 nBlankWidth
Definition: portxt.hxx:66
virtual SwLinePortion * Compress() override
Definition: portxt.cxx:732
void SetWhichPor(const PortionType nNew)
Definition: porlin.hxx:94
void SetBlankWidth(const sal_uInt16 nNew)
Definition: portxt.hxx:70
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
Definition: portxt.cxx:694
sal_uInt16 GetBlankWidth() const
Definition: portxt.hxx:69
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: portxt.cxx:781
Base class for anything that can be part of a line in the Writer layout.
Definition: porlin.hxx:50
virtual long CalcSpacing(long nSpaceAdd, const SwTextSizeInfo &rInf) const override
Definition: portxt.cxx:611
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:734
virtual TextFrameIndex GetCursorOfst(sal_uInt16 nOfst) const override
the parameter is actually SwTwips apparently?
Definition: portxt.cxx:501
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: portxt.cxx:804
TextFrameIndex GetSpaceCnt(const SwTextSizeInfo &rInf, TextFrameIndex &rCnt) const
Definition: portxt.cxx:572
void BreakUnderflow(SwTextFormatInfo &rInf)
Definition: portxt.cxx:263
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: portxt.cxx:770
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: portxt.cxx:787
virtual SwPosSize GetTextSize(const SwTextSizeInfo &rInfo) const override
Definition: portxt.cxx:508
virtual SwPosSize GetTextSize(const SwTextSizeInfo &rInfo) const override
Definition: portxt.cxx:712
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: portxt.cxx:668