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