1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _SVX_PARAPREV_HXX 28 #define _SVX_PARAPREV_HXX 29 30 // include --------------------------------------------------------------- 31 32 #include <vcl/window.hxx> 33 #include <editeng/svxenum.hxx> 34 #include "svx/svxdllapi.h" 35 36 // enum ------------------------------------------------------------------ 37 38 enum SvxPrevLineSpace 39 { 40 SVX_PREV_LINESPACE_1 = 0, 41 SVX_PREV_LINESPACE_15, 42 SVX_PREV_LINESPACE_2, 43 SVX_PREV_LINESPACE_PROP, 44 SVX_PREV_LINESPACE_MIN, 45 SVX_PREV_LINESPACE_DURCH 46 }; 47 48 // class SvxParaPrevWindow ----------------------------------------------- 49 50 class SVX_DLLPUBLIC SvxParaPrevWindow : public Window 51 { 52 using Window::Draw; 53 private: 54 Size aWinSize; 55 Size aSize; 56 57 // Einzuege 58 long nLeftMargin; 59 long nRightMargin; 60 short nFirstLineOfst; 61 // Abstaende 62 sal_uInt16 nUpper; 63 sal_uInt16 nLower; 64 // Ausrichtung 65 SvxAdjust eAdjust; 66 // Letzte Zeile im Blocksatz 67 SvxAdjust eLastLine; 68 // Zeilenabstand 69 SvxPrevLineSpace eLine; 70 sal_uInt16 nLineVal; 71 72 String aText; 73 Rectangle Lines[9]; 74 75 protected: 76 virtual void Paint( const Rectangle& rRect ); 77 78 void DrawParagraph( sal_Bool bAll ); 79 80 public: 81 SvxParaPrevWindow( Window* pParent, const ResId& rId ); 82 83 void SetFirstLineOfst( short nNew ) { nFirstLineOfst = nNew; } 84 void SetLeftMargin( long nNew ) { nLeftMargin = nNew; } 85 void SetRightMargin( long nNew ) { nRightMargin = nNew; } 86 void SetUpper( sal_uInt16 nNew ) { nUpper = nNew; } 87 void SetLower( sal_uInt16 nNew ) { nLower = nNew; } 88 void SetAdjust( SvxAdjust eNew ) { eAdjust = eNew; } 89 void SetLastLine( SvxAdjust eNew ) { eLastLine = eNew; } 90 void SetLineSpace( SvxPrevLineSpace eNew, sal_uInt16 nNew = 0 ) 91 { eLine = eNew; nLineVal = nNew; } 92 void SetText( const String& rStr ) { aText = rStr; } 93 void SetSize( Size aNew ) { aSize = aNew; } 94 95 short GetFirstLineOfst() const { return nFirstLineOfst; } 96 long GetLeftMargin() const { return nLeftMargin; } 97 long GetRightMargin() const { return nRightMargin; } 98 sal_uInt16 GetUpper() const { return nUpper; } 99 sal_uInt16 GetLower() const { return nLower; } 100 SvxAdjust GetAdjust() const { return eAdjust; } 101 102 SvxPrevLineSpace GetLineEnum() const { return eLine; } 103 sal_uInt16 GetLineValue() const { return nLineVal; } 104 String GetText() const { return aText; } 105 Size GetSize() const { return aSize; } 106 107 void OutputSizeChanged(); 108 109 void Draw( sal_Bool bAll ) { DrawParagraph( bAll ); } 110 }; 111 112 #endif 113 114