xref: /aoo41x/main/svx/inc/svx/paraprev.hxx (revision 3334a7e6)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _SVX_PARAPREV_HXX
24 #define _SVX_PARAPREV_HXX
25 
26 // include ---------------------------------------------------------------
27 
28 #include <vcl/window.hxx>
29 #include <editeng/svxenum.hxx>
30 #include "svx/svxdllapi.h"
31 
32 // enum ------------------------------------------------------------------
33 
34 enum SvxPrevLineSpace
35 {
36 	SVX_PREV_LINESPACE_1 = 0,
37 	SVX_PREV_LINESPACE_15,
38 	SVX_PREV_LINESPACE_2,
39 	SVX_PREV_LINESPACE_PROP,
40 	SVX_PREV_LINESPACE_MIN,
41 	SVX_PREV_LINESPACE_DURCH
42 };
43 
44 // class SvxParaPrevWindow -----------------------------------------------
45 
46 class SVX_DLLPUBLIC SvxParaPrevWindow : public Window
47 {
48 	using Window::Draw;
49 private:
50 	Size				aWinSize;
51 	Size				aSize;
52 
53 	// Einzuege
54 	long				nLeftMargin;
55 	long				nRightMargin;
56 	short	   			nFirstLineOfst;
57 	// Abstaende
58 	sal_uInt16				nUpper;
59 	sal_uInt16				nLower;
60 	// Ausrichtung
61 	SvxAdjust			eAdjust;
62 	// Letzte Zeile im Blocksatz
63 	SvxAdjust			eLastLine;
64 	// Zeilenabstand
65 	SvxPrevLineSpace	eLine;
66 	sal_uInt16				nLineVal;
67 
68 	String				aText;
69 	Rectangle			Lines[9];
70 
71 protected:
72 	virtual void Paint( const Rectangle& rRect );
73 
74 	void DrawParagraph( sal_Bool bAll );
75 
76 public:
77 	SvxParaPrevWindow( Window* pParent, const ResId& rId );
78 
SetFirstLineOfst(short nNew)79 	void		SetFirstLineOfst( short nNew ) { nFirstLineOfst = nNew; }
SetLeftMargin(long nNew)80 	void		SetLeftMargin( long nNew ) 	{ nLeftMargin = nNew; }
SetRightMargin(long nNew)81 	void		SetRightMargin( long nNew )	{ nRightMargin = nNew; }
SetUpper(sal_uInt16 nNew)82 	void		SetUpper( sal_uInt16 nNew )			{ nUpper = nNew; }
SetLower(sal_uInt16 nNew)83 	void		SetLower( sal_uInt16 nNew )			{ nLower = nNew; }
SetAdjust(SvxAdjust eNew)84 	void		SetAdjust( SvxAdjust eNew )		{ eAdjust = eNew; }
SetLastLine(SvxAdjust eNew)85 	void		SetLastLine( SvxAdjust eNew )	{ eLastLine = eNew; }
SetLineSpace(SvxPrevLineSpace eNew,sal_uInt16 nNew=0)86 	void		SetLineSpace( SvxPrevLineSpace eNew, sal_uInt16 nNew = 0 )
87 					{   eLine = eNew; nLineVal = nNew; }
SetText(const String & rStr)88 	void        SetText( const String& rStr )	{ aText = rStr; }
SetSize(Size aNew)89 	void		SetSize( Size aNew )			{ aSize = aNew; }
90 
GetFirstLineOfst() const91 	short		GetFirstLineOfst() const 		{ return nFirstLineOfst; }
GetLeftMargin() const92 	long		GetLeftMargin() const			{ return nLeftMargin; }
GetRightMargin() const93 	long		GetRightMargin() const			{ return nRightMargin; }
GetUpper() const94 	sal_uInt16		GetUpper() const				{ return nUpper; }
GetLower() const95 	sal_uInt16		GetLower() const				{ return nLower; }
GetAdjust() const96 	SvxAdjust	GetAdjust() const				{ return eAdjust; }
97 
GetLineEnum() const98 	SvxPrevLineSpace	GetLineEnum() const 	{ return eLine; }
GetLineValue() const99 	sal_uInt16				GetLineValue() const	{ return nLineVal; }
GetText() const100 	String				GetText() const			{ return aText; }
GetSize() const101 	Size				GetSize() const			{ return aSize; }
102 
103 	void		OutputSizeChanged();
104 
Draw(sal_Bool bAll)105 	void 		Draw( sal_Bool bAll ) 				{ DrawParagraph( bAll ); }
106 };
107 
108 #endif
109 
110