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