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