LibreOffice Module sw (master)  1
porhyph.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 <sal/config.h>
22 
23 #include <string_view>
24 
25 #include "porexp.hxx"
26 
28 {
29 public:
31  {
33  }
34  virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override;
35  virtual bool Format( SwTextFormatInfo &rInf ) override;
36 
37  // Accessibility: pass information about this portion to the PortionHandler
38  virtual void HandlePortion( SwPortionHandler& rPH ) const override;
39 };
40 
42 {
43  OUString m_aExpand;
44 public:
45  explicit SwHyphStrPortion(std::u16string_view rStr)
46  : m_aExpand(OUString::Concat(rStr) + "-")
47  {
49  }
50 
51  virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override;
52 
53  // Accessibility: pass information about this portion to the PortionHandler
54  virtual void HandlePortion( SwPortionHandler& rPH ) const override;
55 };
56 
58 {
59  bool m_bExpand;
60  sal_uInt16 m_nViewWidth;
61 
62 public:
64  virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override;
65  virtual SwLinePortion *Compress() override;
66  virtual void Paint( const SwTextPaintInfo &rInf ) const override;
67  virtual bool Format( SwTextFormatInfo &rInf ) override;
68  virtual void FormatEOL( SwTextFormatInfo &rInf ) override;
69  void SetExpand( const bool bNew ) { m_bExpand = bNew; }
70  bool IsExpand() const { return m_bExpand; }
71 
72  virtual sal_uInt16 GetViewWidth( const SwTextSizeInfo &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:
81  explicit SwSoftHyphStrPortion( std::u16string_view rStr );
82  virtual void Paint( const SwTextPaintInfo &rInf ) const override;
83 };
84 
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: txthyph.cxx:353
virtual void FormatEOL(SwTextFormatInfo &rInf) override
Format End of Line.
Definition: txthyph.cxx:506
SwSoftHyphStrPortion(std::u16string_view rStr)
Definition: txthyph.cxx:565
bool IsExpand() const
Definition: porhyph.hxx:70
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: txthyph.cxx:557
The SwPortionHandler interface implements a visitor for the layout engine's text portions.
SwHyphStrPortion(std::u16string_view rStr)
Definition: porhyph.hxx:45
virtual bool Format(SwTextFormatInfo &rInf) override
We get the final width from the FormatEOL()
Definition: txthyph.cxx:449
virtual sal_uInt16 GetViewWidth(const SwTextSizeInfo &rInf) const override
Definition: txthyph.cxx:398
sal_uInt16 m_nViewWidth
Definition: porhyph.hxx:60
virtual SwLinePortion * Compress() override
Definition: txthyph.cxx:389
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
Definition: txthyph.cxx:347
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: txthyph.cxx:358
void SetWhichPor(const PortionType nNew)
Definition: porlin.hxx:95
void SetExpand(const bool bNew)
Definition: porhyph.hxx:69
OUString m_aExpand
Definition: porhyph.hxx:43
Base class for anything that can be part of a line in the Writer layout.
Definition: porlin.hxx:51
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
We're expanding:
Definition: txthyph.cxx:537
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
Definition: txthyph.cxx:378
virtual void Paint(const SwTextPaintInfo &rInf) const override
Cases:
Definition: txthyph.cxx:423
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: txthyph.cxx:384
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: txthyph.cxx:549