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 :
20 : #ifndef INCLUDED_SW_SOURCE_CORE_TEXT_POREXP_HXX
21 : #define INCLUDED_SW_SOURCE_CORE_TEXT_POREXP_HXX
22 :
23 : #include "portxt.hxx"
24 :
25 : /*************************************************************************
26 : * class SwExpandPortion
27 : *************************************************************************/
28 :
29 0 : class SwExpandPortion : public SwTxtPortion
30 : {
31 : public:
32 0 : inline SwExpandPortion() { SetWhichPor( POR_EXP ); }
33 : virtual bool Format( SwTxtFormatInfo &rInf ) SAL_OVERRIDE;
34 : virtual sal_Int32 GetCrsrOfst( const MSHORT nOfst ) const SAL_OVERRIDE;
35 : virtual bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const SAL_OVERRIDE;
36 : virtual SwPosSize GetTxtSize( const SwTxtSizeInfo &rInfo ) const SAL_OVERRIDE;
37 : virtual void Paint( const SwTxtPaintInfo &rInf ) const SAL_OVERRIDE;
38 :
39 : // Accessibility: pass information about this portion to the PortionHandler
40 : virtual void HandlePortion( SwPortionHandler& rPH ) const SAL_OVERRIDE;
41 :
42 : OUTPUT_OPERATOR_OVERRIDE
43 : };
44 :
45 : /*************************************************************************
46 : * class SwBlankPortion
47 : *************************************************************************/
48 :
49 0 : class SwBlankPortion : public SwExpandPortion
50 : {
51 : sal_Unicode cChar;
52 : bool bMulti; // For multiportion brackets
53 : public:
54 0 : inline SwBlankPortion( sal_Unicode cCh, bool bMult = false )
55 0 : : cChar( cCh ), bMulti( bMult )
56 0 : { cChar = cCh; SetLen(1); SetWhichPor( POR_BLANK ); }
57 :
58 : bool IsMulti() const { return bMulti; }
59 : void SetMulti( bool bNew ) { bMulti = bNew; }
60 :
61 : virtual SwLinePortion *Compress() SAL_OVERRIDE;
62 : virtual bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const SAL_OVERRIDE;
63 : virtual void FormatEOL( SwTxtFormatInfo &rInf ) SAL_OVERRIDE;
64 : virtual bool Format( SwTxtFormatInfo &rInf ) SAL_OVERRIDE;
65 : virtual void Paint( const SwTxtPaintInfo &rInf ) const SAL_OVERRIDE;
66 : MSHORT MayUnderflow( const SwTxtFormatInfo &rInf, sal_Int32 nIdx,
67 : bool bUnderflow ) const;
68 :
69 : // Accessibility: pass information about this portion to the PortionHandler
70 : virtual void HandlePortion( SwPortionHandler& rPH ) const SAL_OVERRIDE;
71 :
72 : OUTPUT_OPERATOR_OVERRIDE
73 : };
74 :
75 : /*************************************************************************
76 : * class SwPostItsPortion
77 : *************************************************************************/
78 :
79 0 : class SwPostItsPortion : public SwExpandPortion
80 : {
81 : bool bScript;
82 : public:
83 : SwPostItsPortion( bool bScrpt );
84 : virtual void Paint( const SwTxtPaintInfo &rInf ) const SAL_OVERRIDE;
85 : virtual bool Format( SwTxtFormatInfo &rInf ) SAL_OVERRIDE;
86 : virtual KSHORT GetViewWidth( const SwTxtSizeInfo &rInf ) const SAL_OVERRIDE;
87 : virtual bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const SAL_OVERRIDE;
88 0 : bool IsScript() const { return bScript; }
89 : OUTPUT_OPERATOR_OVERRIDE
90 : };
91 :
92 : #endif
93 :
94 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|