Line data Source code
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_PORHYPH_HXX
20 : #define INCLUDED_SW_SOURCE_CORE_TEXT_PORHYPH_HXX
21 :
22 : #include "porexp.hxx"
23 :
24 : /*************************************************************************
25 : * class SwHyphPortion
26 : *************************************************************************/
27 :
28 0 : class SwHyphPortion : public SwExpandPortion
29 : {
30 : public:
31 0 : SwHyphPortion()
32 0 : {
33 0 : SetWhichPor( POR_HYPH );
34 0 : }
35 : virtual bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const SAL_OVERRIDE;
36 : virtual bool Format( SwTxtFormatInfo &rInf ) SAL_OVERRIDE;
37 :
38 : // Accessibility: pass information about this portion to the PortionHandler
39 : virtual void HandlePortion( SwPortionHandler& rPH ) const SAL_OVERRIDE;
40 :
41 : OUTPUT_OPERATOR_OVERRIDE
42 : };
43 :
44 : /*************************************************************************
45 : * class SwHyphStrPortion
46 : *************************************************************************/
47 :
48 0 : class SwHyphStrPortion : public SwHyphPortion
49 : {
50 : OUString aExpand;
51 : public:
52 0 : SwHyphStrPortion(const OUString &rStr)
53 0 : : aExpand(rStr + "-")
54 : {
55 0 : SetWhichPor( POR_HYPHSTR );
56 0 : }
57 :
58 : virtual bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const SAL_OVERRIDE;
59 :
60 : // Accessibility: pass information about this portion to the PortionHandler
61 : virtual void HandlePortion( SwPortionHandler& rPH ) const SAL_OVERRIDE;
62 :
63 : OUTPUT_OPERATOR_OVERRIDE
64 : };
65 :
66 : /*************************************************************************
67 : * class SwSoftHyphPortion
68 : *************************************************************************/
69 :
70 0 : class SwSoftHyphPortion : public SwHyphPortion
71 : {
72 : bool bExpand;
73 : KSHORT nViewWidth;
74 : KSHORT nHyphWidth;
75 :
76 : public:
77 : SwSoftHyphPortion();
78 : virtual bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const SAL_OVERRIDE;
79 : virtual SwLinePortion *Compress() SAL_OVERRIDE;
80 : virtual void Paint( const SwTxtPaintInfo &rInf ) const SAL_OVERRIDE;
81 : virtual bool Format( SwTxtFormatInfo &rInf ) SAL_OVERRIDE;
82 : virtual void FormatEOL( SwTxtFormatInfo &rInf ) SAL_OVERRIDE;
83 0 : inline void SetExpand( const bool bNew ) { bExpand = bNew; }
84 0 : bool IsExpand() const { return bExpand; }
85 :
86 : virtual KSHORT GetViewWidth( const SwTxtSizeInfo &rInf ) const SAL_OVERRIDE;
87 :
88 : // Accessibility: pass information about this portion to the PortionHandler
89 : virtual void HandlePortion( SwPortionHandler& rPH ) const SAL_OVERRIDE;
90 :
91 : OUTPUT_OPERATOR_OVERRIDE
92 : };
93 :
94 : /*************************************************************************
95 : * class SwSoftHyphStrPortion
96 : *************************************************************************/
97 :
98 0 : class SwSoftHyphStrPortion : public SwHyphStrPortion
99 : {
100 : public:
101 : SwSoftHyphStrPortion( const OUString &rStr );
102 : virtual void Paint( const SwTxtPaintInfo &rInf ) const SAL_OVERRIDE;
103 : OUTPUT_OPERATOR_OVERRIDE
104 : };
105 :
106 : #endif
107 :
108 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|