xref: /trunk/main/sw/source/ui/inc/wrap.hxx (revision cdf0e10c)
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 _WRAP_HXX
28 #define _WRAP_HXX
29 
30 #include <sfx2/tabdlg.hxx>
31 #include <sfx2/basedlgs.hxx>
32 
33 #ifndef _IMAGEBTN_HXX //autogen
34 #include <vcl/button.hxx>
35 #endif
36 
37 #ifndef _BUTTON_HXX //autogen
38 #include <vcl/button.hxx>
39 #endif
40 
41 #ifndef _FIXED_HXX //autogen
42 #include <vcl/fixed.hxx>
43 #endif
44 
45 #ifndef _FIELD_HXX //autogen
46 #include <vcl/field.hxx>
47 #endif
48 
49 class Window;
50 class SfxItemSet;
51 class SwWrtShell;
52 
53 class SwWrapDlg : public SfxSingleTabDialog
54 {
55 	SwWrtShell* 		pWrtShell;
56 
57 public:
58 	 SwWrapDlg(Window* pParent, SfxItemSet& rSet, SwWrtShell* pSh, sal_Bool bDrawMode);
59 	~SwWrapDlg();
60 
61 	inline SwWrtShell* 	GetWrtShell()	{ return pWrtShell; }
62 };
63 
64 
65 /*--------------------------------------------------------------------
66 	Beschreibung:	Umlauf-TabPage
67  --------------------------------------------------------------------*/
68 
69 class SwWrapTabPage: public SfxTabPage
70 {
71 	// WRAPPING
72     FixedLine           aWrapFLC;
73 	ImageRadioButton	aNoWrapRB;
74 	ImageRadioButton	aWrapLeftRB;
75 	ImageRadioButton	aWrapRightRB;
76 	ImageRadioButton	aWrapParallelRB;
77 	ImageRadioButton	aWrapThroughRB;
78 	ImageRadioButton	aIdealWrapRB;
79 
80 	// MARGIN
81     FixedLine           aMarginFL;
82 	FixedText			aLeftMarginFT;
83 	MetricField 		aLeftMarginED;
84 	FixedText			aRightMarginFT;
85 	MetricField 		aRightMarginED;
86 	FixedText			aTopMarginFT;
87 	MetricField 		aTopMarginED;
88 	FixedText			aBottomMarginFT;
89 	MetricField 		aBottomMarginED;
90 
91     // OPTIONS
92     FixedLine           aOptionsSepFL;
93     FixedLine           aOptionsFL;
94     CheckBox            aWrapAnchorOnlyCB;
95 	CheckBox			aWrapTransparentCB;
96 	CheckBox			aWrapOutlineCB;
97 	CheckBox			aWrapOutsideCB;
98 
99 	ImageList			aWrapIL;
100     ImageList           aWrapILH;
101 
102 	sal_uInt16				nOldLeftMargin;
103 	sal_uInt16				nOldRightMargin;
104 	sal_uInt16				nOldUpperMargin;
105 	sal_uInt16				nOldLowerMargin;
106 
107     RndStdIds           nAnchorId;
108 	sal_uInt16 				nHtmlMode;
109 
110 	Size aFrmSize;
111 	SwWrtShell*			pWrtSh;
112 
113 	sal_Bool bFormat;
114 	sal_Bool bNew;
115 	sal_Bool bHtmlMode;
116 	sal_Bool bDrawMode;
117 	sal_Bool bContourImage;
118 
119 	SwWrapTabPage(Window *pParent, const SfxItemSet &rSet);
120 	~SwWrapTabPage();
121 
122     void            ApplyImageList();
123     void            EnableModes(const SfxItemSet& rSet);
124 	virtual void 	ActivatePage(const SfxItemSet& rSet);
125 	virtual int 	DeactivatePage(SfxItemSet *pSet);
126     virtual void    DataChanged( const DataChangedEvent& rDCEvt );
127 
128 	DECL_LINK( RangeModifyHdl, MetricField * );
129 	DECL_LINK( WrapTypeHdl, ImageRadioButton * );
130 	DECL_LINK( ContourHdl, CheckBox * );
131 
132     using SfxTabPage::ActivatePage;
133     using SfxTabPage::DeactivatePage;
134 
135 public:
136 
137     static SfxTabPage *Create(Window *pParent, const SfxItemSet &rSet);
138 
139 	virtual sal_Bool 	FillItemSet(SfxItemSet &rSet);
140 	virtual void 	Reset(const SfxItemSet &rSet);
141 
142 	static sal_uInt16*	GetRanges();
143 	inline void		SetNewFrame(sal_Bool bNewFrame) { bNew = bNewFrame; }
144 	inline void		SetFormatUsed(sal_Bool bFmt, sal_Bool bDrw) { bFormat = bFmt;
145 															bDrawMode = bDrw; }
146 	inline void		SetShell(SwWrtShell* pSh) { pWrtSh = pSh; }
147 };
148 
149 #endif
150 
151 
152