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{
29public:
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 void dumpAsXml(xmlTextWriterPtr pWriter, const OUString& rText,
41 TextFrameIndex& nOffset) const override;
42};
43
45{
46 OUString m_aExpand;
47public:
48 explicit SwHyphStrPortion(std::u16string_view rStr)
49 : m_aExpand(OUString::Concat(rStr) + "-")
50 {
52 }
53
54 virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override;
55
56 // Accessibility: pass information about this portion to the PortionHandler
57 virtual void HandlePortion( SwPortionHandler& rPH ) const override;
58};
59
61{
63 sal_uInt16 m_nViewWidth;
64
65public:
67 virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override;
68 virtual SwLinePortion *Compress() override;
69 virtual void Paint( const SwTextPaintInfo &rInf ) const override;
70 virtual bool Format( SwTextFormatInfo &rInf ) override;
71 virtual void FormatEOL( SwTextFormatInfo &rInf ) override;
72 void SetExpand( const bool bNew ) { m_bExpand = bNew; }
73 bool IsExpand() const { return m_bExpand; }
74
75 virtual sal_uInt16 GetViewWidth( const SwTextSizeInfo &rInf ) const override;
76
77 // Accessibility: pass information about this portion to the PortionHandler
78 virtual void HandlePortion( SwPortionHandler& rPH ) const override;
79};
80
82{
83public:
84 explicit SwSoftHyphStrPortion( std::u16string_view rStr );
85 virtual void Paint( const SwTextPaintInfo &rInf ) const override;
86};
87
88/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _xmlTextWriter * xmlTextWriterPtr
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: txthyph.cxx:353
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
Definition: txthyph.cxx:347
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: txthyph.cxx:368
void dumpAsXml(xmlTextWriterPtr pWriter, const OUString &rText, TextFrameIndex &nOffset) const override
Definition: txthyph.cxx:358
SwHyphStrPortion(std::u16string_view rStr)
Definition: porhyph.hxx:48
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
Definition: txthyph.cxx:388
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: txthyph.cxx:394
OUString m_aExpand
Definition: porhyph.hxx:46
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
The SwPortionHandler interface implements a visitor for the layout engine's text portions.
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
We're expanding:
Definition: txthyph.cxx:547
virtual sal_uInt16 GetViewWidth(const SwTextSizeInfo &rInf) const override
Definition: txthyph.cxx:408
virtual void Paint(const SwTextPaintInfo &rInf) const override
Cases:
Definition: txthyph.cxx:433
virtual void FormatEOL(SwTextFormatInfo &rInf) override
Format End of Line.
Definition: txthyph.cxx:516
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: txthyph.cxx:559
virtual bool Format(SwTextFormatInfo &rInf) override
We get the final width from the FormatEOL()
Definition: txthyph.cxx:459
void SetExpand(const bool bNew)
Definition: porhyph.hxx:72
sal_uInt16 m_nViewWidth
Definition: porhyph.hxx:63
virtual SwLinePortion * Compress() override
Definition: txthyph.cxx:399
bool IsExpand() const
Definition: porhyph.hxx:73
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: txthyph.cxx:567
SwSoftHyphStrPortion(std::u16string_view rStr)
Definition: txthyph.cxx:575