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