xref: /aoo42x/main/sw/source/ui/inc/frmpage.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 
24 #ifndef _FRMPAGE_HXX
25 #define _FRMPAGE_HXX
26 
27 #include <vcl/fixed.hxx>
28 #include <vcl/button.hxx>
29 #include <vcl/lstbox.hxx>
30 #include <vcl/field.hxx>
31 #include <sfx2/tabdlg.hxx>
32 #include <svx/swframeposstrings.hxx>
33 #include <swtypes.hxx>
34 #include <bmpwin.hxx>
35 #include <svx/swframeexample.hxx>
36 #include <prcntfld.hxx>
37 #include <globals.hrc>
38 
39 
40 namespace sfx2{class FileDialogHelper;}
41 class SwWrtShell;
42 struct FrmMap;
43 // OD 12.11.2003 #i22341#
44 struct SwPosition;
45 
46 /*--------------------------------------------------------------------
47 	 Beschreibung:	Rahmendialog
48  --------------------------------------------------------------------*/
49 
50 class SwFrmPage: public SfxTabPage
51 {
52 	// Size
53 	FixedLine       aSizeFL;
54 	FixedText		aWidthFT;
55 	FixedText		aWidthAutoFT;
56 	PercentField 	aWidthED;
57 	CheckBox		aRelWidthCB;
58 	CheckBox		aAutoWidthCB;
59 	FixedText		aHeightFT;
60 	FixedText		aHeightAutoFT;
61 	PercentField 	aHeightED;
62 	CheckBox		aRelHeightCB;
63 	CheckBox		aAutoHeightCB;
64 	CheckBox		aFixedRatioCB;
65 	PushButton		aRealSizeBT;
66 
67 	// Anker
68     FixedLine       aTypeSepFL;
69 	FixedLine       aTypeFL;
70 	RadioButton		aAnchorAtPageRB;
71 	RadioButton		aAnchorAtParaRB;
72 	RadioButton		aAnchorAtCharRB;
73 	RadioButton		aAnchorAsCharRB;
74 	RadioButton		aAnchorAtFrameRB;
75 
76 	// Position
77 	FixedLine       aPositionFL;
78 	FixedText		aHorizontalFT;
79 	ListBox 		aHorizontalDLB;
80 	FixedText		aAtHorzPosFT;
81 	MetricField 	aAtHorzPosED;
82 	FixedText		aHoriRelationFT;
83 	ListBox			aHoriRelationLB;
84 	CheckBox		aMirrorPagesCB;
85 	FixedText		aVerticalFT;
86 	ListBox 		aVerticalDLB;
87 	FixedText		aAtVertPosFT;
88 	MetricField 	aAtVertPosED;
89 	FixedText		aVertRelationFT;
90 	ListBox			aVertRelationLB;
91     // OD 02.10.2003 #i18732# - check box for new option 'FollowTextFlow'
92     CheckBox        aFollowTextFlowCB;
93 
94 	// Example
95     SvxSwFrameExample   aExampleWN;
96 
97     //'string provider'
98     SvxSwFramePosString aFramePosString;
99 
100     sal_Bool            bAtHorzPosModified;
101     sal_Bool            bAtVertPosModified;
102 
103     sal_Bool            bFormat;
104 	sal_Bool			bNew;
105 	sal_Bool			bNoModifyHdl;
106     sal_Bool            bVerticalChanged;  //check done whether frame is in vertical environment
107     sal_Bool            bIsVerticalFrame;  //current frame is in vertical environment - strings are exchanged
108     // --> OD 2009-08-31 #mongolianlayou#
109     sal_Bool            bIsVerticalL2R;
110     // <--
111     sal_Bool            bIsInRightToLeft; // current frame is in right-to-left environment - strings are exchanged
112     sal_Bool            bHtmlMode;
113     sal_uInt16          nHtmlMode;
114 	sal_uInt16			nDlgType;
115 	Size			aGrfSize;
116 	Size			aWrap;
117 	SwTwips			nUpperBorder;
118 	SwTwips			nLowerBorder;
119     double          fWidthHeightRatio; //width-to-height ratio to support the KeepRatio button
120 
121     // OD 12.11.2003 #i22341# - keep content position of character for
122     // to character anchored objects.
123     const SwPosition* mpToCharCntntPos;
124 
125 	// Die alten Ausrichtungen
126     short        nOldH;
127     short    nOldHRel;
128     short        nOldV;
129     short    nOldVRel;
130 
131     FrmMap* pVMap;
132     FrmMap* pHMap;
133 
134     bool    m_bAllowVertPositioning;
135     bool    m_bIsMathOLE;
136     bool    m_bIsMathBaselineAlignment;
137 
138     virtual void    ActivatePage(const SfxItemSet& rSet);
139 	virtual int 	DeactivatePage(SfxItemSet *pSet);
140 
141 
142 	DECL_LINK( RangeModifyHdl, Edit * );
143 	DECL_LINK( AnchorTypeHdl, RadioButton * );
144 	DECL_LINK( PosHdl, ListBox * );
145 	DECL_LINK( RelHdl, ListBox * );
146     void            InitPos(RndStdIds eId, sal_uInt16 nH, sal_uInt16 nHRel,
147 							sal_uInt16 nV,	sal_uInt16 nVRel,
148 							long   nX,	long   nY);
149 
150 	DECL_LINK( RealSizeHdl, Button * );
151 	DECL_LINK( RelSizeClickHdl, CheckBox * );
152 	DECL_LINK( MirrorHdl, CheckBox * );
153 
154 	DECL_LINK( AutoWidthClickHdl, void* );
155 	DECL_LINK( AutoHeightClickHdl, void* );
156 
157 	// Beispiel aktualisieren
158 	void			UpdateExample();
159 	DECL_LINK( ModifyHdl, Edit * );
160 
161 	void			Init(const SfxItemSet& rSet, sal_Bool bReset = sal_False);
162     // OD 12.11.2003 #i22341# - adjustment to handle maps, that are ambigous
163     //                          in the alignment.
164     sal_uInt16          FillPosLB( const FrmMap* _pMap,
165                                const sal_uInt16 _nAlign,
166                                const sal_uInt16 _nRel,
167                                ListBox& _rLB );
168     // OD 14.11.2003 #i22341# - adjustment to handle maps, that are ambigous
169     //                          in their string entries.
170     sal_uLong           FillRelLB( const FrmMap* _pMap,
171                                const sal_uInt16 _nLBSelPos,
172                                const sal_uInt16 _nAlign,
173                                sal_uInt16 _nRel,
174                                ListBox& _rLB,
175                                FixedText& _rFT );
176     sal_uInt16          GetMapPos( const FrmMap *pMap, ListBox &rAlignLB );
177     short           GetAlignment(FrmMap *pMap, sal_uInt16 nMapPos, ListBox &rAlignLB, ListBox &rRelationLB);
178     short           GetRelation(FrmMap *pMap, ListBox &rRelationLB);
179     RndStdIds       GetAnchor();
180 
181 	void			EnableGraficMode( void );	// hides auto check boxes and re-org controls for "Real Size" button
182 
183 	SwFrmPage(Window *pParent, const SfxItemSet &rSet);
184 	~SwFrmPage();
185 
186     using SfxTabPage::ActivatePage;
187     using SfxTabPage::DeactivatePage;
188 
189 public:
190 
191     static SfxTabPage *Create(Window *pParent, const SfxItemSet &rSet);
192 	static sal_uInt16* GetRanges();
193 
194 	virtual sal_Bool FillItemSet(SfxItemSet &rSet);
195 	virtual void Reset(const SfxItemSet &rSet);
196 
SetNewFrame(sal_Bool bNewFrame)197 	void 			SetNewFrame(sal_Bool bNewFrame) { bNew		= bNewFrame; }
198 	void			SetFormatUsed(sal_Bool bFmt);
SetFrmType(sal_uInt16 nType)199 	void			SetFrmType(sal_uInt16 nType) 	{ nDlgType 	= nType;	 }
IsInGraficMode(void)200 	inline sal_Bool		IsInGraficMode( void )		{ return nDlgType == DLG_FRM_GRF || nDlgType == DLG_FRM_OLE; }
201     void            EnableVerticalPositioning( bool bEnable );
202 };
203 
204 class SwGrfExtPage: public SfxTabPage
205 {
206 	// Spiegeln
207     FixedLine       aMirrorFL;
208 	CheckBox		aMirrorVertBox;
209 	CheckBox		aMirrorHorzBox;
210 	RadioButton 	aAllPagesRB;
211 	RadioButton 	aLeftPagesRB;
212 	RadioButton 	aRightPagesRB;
213 	BmpWindow		aBmpWin;
214 
215     FixedLine       aConnectFL;
216 	FixedText		aConnectFT;
217 	Edit			aConnectED;
218 	PushButton		aBrowseBT;
219 
220 	String			aFilterName;
221 	String			aGrfName, aNewGrfName;
222 
223     ::sfx2::FileDialogHelper*     pGrfDlg;
224 
225 	sal_Bool 			bHtmlMode;
226 
227 	// Handler fuer Spiegeln
228 	DECL_LINK( MirrorHdl, CheckBox * );
229 	DECL_LINK( BrowseHdl, Button * );
230 
231 	virtual void 	ActivatePage(const SfxItemSet& rSet);
232 	SwGrfExtPage(Window *pParent, const SfxItemSet &rSet);
233 	~SwGrfExtPage();
234 
235     using SfxTabPage::ActivatePage;
236     using SfxTabPage::DeactivatePage;
237 
238 public:
239 
240     static SfxTabPage *Create(Window *pParent, const SfxItemSet &rSet);
241 
242 	virtual sal_Bool FillItemSet(SfxItemSet &rSet);
243 	virtual void Reset(const SfxItemSet &rSet);
244 	virtual int  DeactivatePage(SfxItemSet *pSet);
245 };
246 
247 
248 class SwFrmURLPage : public SfxTabPage
249 {
250 	//Hyperlink
251     FixedLine       aHyperLinkFL;
252 	FixedText		aURLFT;
253 	Edit			aURLED;
254 	PushButton		aSearchPB;
255 	FixedText		aNameFT;
256 	Edit			aNameED;
257 	FixedText		aFrameFT;
258 	ComboBox		aFrameCB;
259 
260 	//Image map
261     FixedLine       aImageFL;
262 	CheckBox		aServerCB;
263 	CheckBox		aClientCB;
264 
265 	DECL_LINK( InsertFileHdl, PushButton * );
266 
267 
268 	SwFrmURLPage(Window *pParent, const SfxItemSet &rSet);
269 	~SwFrmURLPage();
270 
271     using SfxTabPage::ActivatePage;
272     using SfxTabPage::DeactivatePage;
273 
274 public:
275 
276     static SfxTabPage *Create(Window *pParent, const SfxItemSet &rSet);
277 
278 	virtual sal_Bool FillItemSet(SfxItemSet &rSet);
279 	virtual void Reset(const SfxItemSet &rSet);
280 };
281 
282 /*-----------------13.11.96 12.59-------------------
283 
284 --------------------------------------------------*/
285 
286 class SwFrmAddPage : public SfxTabPage
287 {
288       FixedLine   aNamesFL;
289 	FixedText 	aNameFT;
290 	Edit		aNameED;
291 	FixedText	aAltNameFT;
292 	Edit		aAltNameED;
293 	FixedText 	aPrevFT;
294     ListBox     aPrevLB;
295 	FixedText 	aNextFT;
296     ListBox     aNextLB;
297     	FixedLine   aProtectFL;
298 
299 	CheckBox	aProtectContentCB;
300 	CheckBox	aProtectFrameCB;
301 	CheckBox	aProtectSizeCB;
302 	FixedLine   aExtFL;
303 
304 	CheckBox	aEditInReadonlyCB;
305 	CheckBox	aPrintFrameCB;
306 	FixedText   aTextFlowFT;
307 	ListBox     aTextFlowLB;
308 
309 
310 	SwWrtShell* pWrtSh;
311 
312 	sal_uInt16		nDlgType;
313 	sal_Bool 		bHtmlMode;
314 	sal_Bool 		bFormat;
315 	sal_Bool 		bNew;
316 
317 	DECL_LINK(EditModifyHdl, Edit*);
318     DECL_LINK(ChainModifyHdl, ListBox*);
319 
320 	SwFrmAddPage(Window *pParent, const SfxItemSet &rSet);
321 	~SwFrmAddPage();
322 
323 public:
324 
325 	static SfxTabPage*	Create(Window *pParent, const SfxItemSet &rSet);
326 	static sal_uInt16* 		GetRanges();
327 
328 	virtual sal_Bool FillItemSet(SfxItemSet &rSet);
329 	virtual void Reset(const SfxItemSet &rSet);
330 
331 	void			SetFormatUsed(sal_Bool bFmt);
SetFrmType(sal_uInt16 nType)332 	void			SetFrmType(sal_uInt16 nType) { nDlgType = nType; }
SetNewFrame(sal_Bool bNewFrame)333 	void 			SetNewFrame(sal_Bool bNewFrame) { bNew  = bNewFrame; }
SetShell(SwWrtShell * pSh)334 	void			SetShell(SwWrtShell* pSh) { pWrtSh  = pSh; }
335 
336 };
337 
338 #endif // _FRMPAGE_HXX
339