xref: /aoo42x/main/cui/source/inc/backgrnd.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 #ifndef _SVX_BACKGRND_HXX
28*cdf0e10cSrcweir #define _SVX_BACKGRND_HXX
29*cdf0e10cSrcweir 
30*cdf0e10cSrcweir // include ---------------------------------------------------------------
31*cdf0e10cSrcweir 
32*cdf0e10cSrcweir #ifndef _GROUP_HXX //autogen
33*cdf0e10cSrcweir #include <vcl/group.hxx>
34*cdf0e10cSrcweir #endif
35*cdf0e10cSrcweir #include <svtools/stdctrl.hxx>
36*cdf0e10cSrcweir #ifndef _GRAPH_HXX //autogen
37*cdf0e10cSrcweir #include <vcl/graph.hxx>
38*cdf0e10cSrcweir #endif
39*cdf0e10cSrcweir #include <svtools/valueset.hxx>
40*cdf0e10cSrcweir #include <svx/dlgctrl.hxx>
41*cdf0e10cSrcweir 
42*cdf0e10cSrcweir // class SvxBackgroundTabPage --------------------------------------------
43*cdf0e10cSrcweir /*
44*cdf0e10cSrcweir {k:\svx\prototyp\dialog\backgrnd.bmp}
45*cdf0e10cSrcweir 	[Beschreibung]
46*cdf0e10cSrcweir 	Mit dieser TabPage kann eine Brush (z.B. fuer die Hintergrundfarbe eines
47*cdf0e10cSrcweir 	Rahmens) eingestellt werden.
48*cdf0e10cSrcweir 	[Items]
49*cdf0e10cSrcweir 	<SvxBrushItem>:     <SID_ATTR_BRUSH>;
50*cdf0e10cSrcweir */
51*cdf0e10cSrcweir 
52*cdf0e10cSrcweir //------------------------------------------------------------------------
53*cdf0e10cSrcweir // forwards:
54*cdf0e10cSrcweir 
55*cdf0e10cSrcweir class BackgroundPreviewImpl;
56*cdf0e10cSrcweir class SvxOpenGraphicDialog;
57*cdf0e10cSrcweir struct SvxBackgroundTable_Impl;
58*cdf0e10cSrcweir struct SvxBackgroundPara_Impl;
59*cdf0e10cSrcweir struct SvxBackgroundPage_Impl;
60*cdf0e10cSrcweir class SvxBrushItem;
61*cdf0e10cSrcweir //------------------------------------------------------------------------
62*cdf0e10cSrcweir 
63*cdf0e10cSrcweir class SvxBackgroundTabPage : public SvxTabPage
64*cdf0e10cSrcweir {
65*cdf0e10cSrcweir 	using TabPage::DeactivatePage;
66*cdf0e10cSrcweir public:
67*cdf0e10cSrcweir 	static SfxTabPage*  Create( Window* pParent, const SfxItemSet& rAttrSet );
68*cdf0e10cSrcweir 	static sal_uInt16*      GetRanges();
69*cdf0e10cSrcweir 
70*cdf0e10cSrcweir 	virtual sal_Bool        FillItemSet( SfxItemSet& rSet );
71*cdf0e10cSrcweir 	virtual void        Reset( const SfxItemSet& rSet );
72*cdf0e10cSrcweir 	virtual void        FillUserData();
73*cdf0e10cSrcweir 	virtual void        PointChanged( Window* pWindow, RECT_POINT eRP );
74*cdf0e10cSrcweir 
75*cdf0e10cSrcweir 	void                ShowSelector(); // Umschalt-ListBox aktivieren
76*cdf0e10cSrcweir 	void                ShowTblControl(); // fuer den Writer (Zellen/Zeilen/Tabelle)
77*cdf0e10cSrcweir 	void                ShowParaControl(sal_Bool bCharOnly = sal_False); // fuer den Writer (Absatz/Zeichen)
78*cdf0e10cSrcweir     void                EnableTransparency(sal_Bool bColor, sal_Bool bGraphic);
79*cdf0e10cSrcweir 	virtual void		PageCreated (SfxAllItemSet aSet); //add CHINA001
80*cdf0e10cSrcweir protected:
81*cdf0e10cSrcweir 	virtual int         DeactivatePage( SfxItemSet* pSet = 0 );
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir private:
84*cdf0e10cSrcweir 	SvxBackgroundTabPage( Window* pParent, const SfxItemSet& rCoreSet );
85*cdf0e10cSrcweir 	~SvxBackgroundTabPage();
86*cdf0e10cSrcweir 
87*cdf0e10cSrcweir 	FixedText               aSelectTxt;
88*cdf0e10cSrcweir 	ListBox                 aLbSelect;
89*cdf0e10cSrcweir 	const String            aStrBrowse;
90*cdf0e10cSrcweir 	const String            aStrUnlinked;
91*cdf0e10cSrcweir      FixedText               aTblDesc;
92*cdf0e10cSrcweir 	 ListBox                 aTblLBox;
93*cdf0e10cSrcweir      ListBox		         aParaLBox;
94*cdf0e10cSrcweir 	// Hintergrundfarbe ------------------------------------
95*cdf0e10cSrcweir 	Control					aBorderWin;
96*cdf0e10cSrcweir 	ValueSet                aBackgroundColorSet;
97*cdf0e10cSrcweir     FixedLine               aBackgroundColorBox;
98*cdf0e10cSrcweir 	BackgroundPreviewImpl*  pPreviewWin1;
99*cdf0e10cSrcweir     //color transparency
100*cdf0e10cSrcweir     FixedText               aColTransFT;
101*cdf0e10cSrcweir     MetricField             aColTransMF;
102*cdf0e10cSrcweir 	CheckBox                aBtnPreview;
103*cdf0e10cSrcweir     // Hintergrund-Bitmap ----------------------------------
104*cdf0e10cSrcweir  	FixedLine               aGbFile;
105*cdf0e10cSrcweir 	PushButton              aBtnBrowse;
106*cdf0e10cSrcweir 	CheckBox                aBtnLink;
107*cdf0e10cSrcweir   	FixedLine               aGbPosition;
108*cdf0e10cSrcweir 	RadioButton             aBtnPosition;
109*cdf0e10cSrcweir 	RadioButton             aBtnArea;
110*cdf0e10cSrcweir 	RadioButton             aBtnTile;
111*cdf0e10cSrcweir 	SvxRectCtl              aWndPosition;
112*cdf0e10cSrcweir 	FixedInfo               aFtFile;
113*cdf0e10cSrcweir     //transparency of graphics
114*cdf0e10cSrcweir     FixedLine               aGraphTransFL;
115*cdf0e10cSrcweir     MetricField             aGraphTransMF;
116*cdf0e10cSrcweir 
117*cdf0e10cSrcweir     BackgroundPreviewImpl*  pPreviewWin2;
118*cdf0e10cSrcweir 
119*cdf0e10cSrcweir 	// DDListBox fuer Writer -------------------------------
120*cdf0e10cSrcweir 	//------------------------------------------------------
121*cdf0e10cSrcweir 	Color		aBgdColor;
122*cdf0e10cSrcweir 	sal_uInt16		nHtmlMode;
123*cdf0e10cSrcweir 	sal_Bool        bAllowShowSelector	: 1;
124*cdf0e10cSrcweir 	sal_Bool        bIsGraphicValid		: 1;
125*cdf0e10cSrcweir 	sal_Bool		bLinkOnly			: 1;
126*cdf0e10cSrcweir     sal_Bool        bResized            : 1;
127*cdf0e10cSrcweir     sal_Bool        bColTransparency    : 1;
128*cdf0e10cSrcweir     sal_Bool        bGraphTransparency  : 1;
129*cdf0e10cSrcweir     Graphic     aBgdGraphic;
130*cdf0e10cSrcweir 	String      aBgdGraphicPath;
131*cdf0e10cSrcweir 	String      aBgdGraphicFilter;
132*cdf0e10cSrcweir 
133*cdf0e10cSrcweir 	SvxBackgroundPage_Impl* pPageImpl;
134*cdf0e10cSrcweir 	SvxOpenGraphicDialog* pImportDlg;
135*cdf0e10cSrcweir 
136*cdf0e10cSrcweir 	// Items fuer Sw-Tabelle muessen gesammelt werden
137*cdf0e10cSrcweir 	SvxBackgroundTable_Impl*	pTableBck_Impl;
138*cdf0e10cSrcweir 	// auch fuer die Absatzvorlage
139*cdf0e10cSrcweir 	SvxBackgroundPara_Impl*	pParaBck_Impl;
140*cdf0e10cSrcweir 
141*cdf0e10cSrcweir #ifdef _SVX_BACKGRND_CXX
142*cdf0e10cSrcweir 	void                FillColorValueSets_Impl();
143*cdf0e10cSrcweir 	void                ShowColorUI_Impl();
144*cdf0e10cSrcweir 	void                ShowBitmapUI_Impl();
145*cdf0e10cSrcweir 	sal_Bool                LoadLinkedGraphic_Impl();
146*cdf0e10cSrcweir 	void                RaiseLoadError_Impl();
147*cdf0e10cSrcweir 	void                SetGraphicPosition_Impl( SvxGraphicPosition ePos );
148*cdf0e10cSrcweir 	SvxGraphicPosition  GetGraphicPosition_Impl();
149*cdf0e10cSrcweir 	void				FillControls_Impl(const SvxBrushItem& rBgdAttr,
150*cdf0e10cSrcweir 											const String& rUserData);
151*cdf0e10cSrcweir 	sal_Bool 				FillItemSetWithWallpaperItem( SfxItemSet& rCoreSet, sal_uInt16 nSlot);
152*cdf0e10cSrcweir 	void				ResetFromWallpaperItem( const SfxItemSet& rSet );
153*cdf0e10cSrcweir 
154*cdf0e10cSrcweir 	DECL_LINK( LoadTimerHdl_Impl, Timer* );
155*cdf0e10cSrcweir 	DECL_LINK( SelectHdl_Impl, ListBox* );
156*cdf0e10cSrcweir 	DECL_LINK( BrowseHdl_Impl, PushButton* );
157*cdf0e10cSrcweir 	DECL_LINK( RadioClickHdl_Impl, RadioButton* );
158*cdf0e10cSrcweir 	DECL_LINK( FileClickHdl_Impl, CheckBox* );
159*cdf0e10cSrcweir 	DECL_LINK( BackgroundColorHdl_Impl, ValueSet* );
160*cdf0e10cSrcweir 	DECL_LINK( TblDestinationHdl_Impl, ListBox* );
161*cdf0e10cSrcweir 	DECL_LINK( ParaDestinationHdl_Impl, ListBox* );
162*cdf0e10cSrcweir #endif
163*cdf0e10cSrcweir };
164*cdf0e10cSrcweir 
165*cdf0e10cSrcweir #endif // #ifndef _SVX_BACKGRND_HXX
166*cdf0e10cSrcweir 
167*cdf0e10cSrcweir 
168