xref: /aoo41x/main/cui/source/inc/backgrnd.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _SVX_BACKGRND_HXX
28 #define _SVX_BACKGRND_HXX
29 
30 // include ---------------------------------------------------------------
31 
32 #ifndef _GROUP_HXX //autogen
33 #include <vcl/group.hxx>
34 #endif
35 #include <svtools/stdctrl.hxx>
36 #ifndef _GRAPH_HXX //autogen
37 #include <vcl/graph.hxx>
38 #endif
39 #include <svtools/valueset.hxx>
40 #include <svx/dlgctrl.hxx>
41 
42 // class SvxBackgroundTabPage --------------------------------------------
43 /*
44 {k:\svx\prototyp\dialog\backgrnd.bmp}
45 	[Beschreibung]
46 	Mit dieser TabPage kann eine Brush (z.B. fuer die Hintergrundfarbe eines
47 	Rahmens) eingestellt werden.
48 	[Items]
49 	<SvxBrushItem>:     <SID_ATTR_BRUSH>;
50 */
51 
52 //------------------------------------------------------------------------
53 // forwards:
54 
55 class BackgroundPreviewImpl;
56 class SvxOpenGraphicDialog;
57 struct SvxBackgroundTable_Impl;
58 struct SvxBackgroundPara_Impl;
59 struct SvxBackgroundPage_Impl;
60 class SvxBrushItem;
61 //------------------------------------------------------------------------
62 
63 class SvxBackgroundTabPage : public SvxTabPage
64 {
65 	using TabPage::DeactivatePage;
66 public:
67 	static SfxTabPage*  Create( Window* pParent, const SfxItemSet& rAttrSet );
68 	static sal_uInt16*      GetRanges();
69 
70 	virtual sal_Bool        FillItemSet( SfxItemSet& rSet );
71 	virtual void        Reset( const SfxItemSet& rSet );
72 	virtual void        FillUserData();
73 	virtual void        PointChanged( Window* pWindow, RECT_POINT eRP );
74 
75 	void                ShowSelector(); // Umschalt-ListBox aktivieren
76 	void                ShowTblControl(); // fuer den Writer (Zellen/Zeilen/Tabelle)
77 	void                ShowParaControl(sal_Bool bCharOnly = sal_False); // fuer den Writer (Absatz/Zeichen)
78     void                EnableTransparency(sal_Bool bColor, sal_Bool bGraphic);
79 	virtual void		PageCreated (SfxAllItemSet aSet); //add CHINA001
80 protected:
81 	virtual int         DeactivatePage( SfxItemSet* pSet = 0 );
82 
83 private:
84 	SvxBackgroundTabPage( Window* pParent, const SfxItemSet& rCoreSet );
85 	~SvxBackgroundTabPage();
86 
87 	FixedText               aSelectTxt;
88 	ListBox                 aLbSelect;
89 	const String            aStrBrowse;
90 	const String            aStrUnlinked;
91      FixedText               aTblDesc;
92 	 ListBox                 aTblLBox;
93      ListBox		         aParaLBox;
94 	// Hintergrundfarbe ------------------------------------
95 	Control					aBorderWin;
96 	ValueSet                aBackgroundColorSet;
97     FixedLine               aBackgroundColorBox;
98 	BackgroundPreviewImpl*  pPreviewWin1;
99     //color transparency
100     FixedText               aColTransFT;
101     MetricField             aColTransMF;
102 	CheckBox                aBtnPreview;
103     // Hintergrund-Bitmap ----------------------------------
104  	FixedLine               aGbFile;
105 	PushButton              aBtnBrowse;
106 	CheckBox                aBtnLink;
107   	FixedLine               aGbPosition;
108 	RadioButton             aBtnPosition;
109 	RadioButton             aBtnArea;
110 	RadioButton             aBtnTile;
111 	SvxRectCtl              aWndPosition;
112 	FixedInfo               aFtFile;
113     //transparency of graphics
114     FixedLine               aGraphTransFL;
115     MetricField             aGraphTransMF;
116 
117     BackgroundPreviewImpl*  pPreviewWin2;
118 
119 	// DDListBox fuer Writer -------------------------------
120 	//------------------------------------------------------
121 	Color		aBgdColor;
122 	sal_uInt16		nHtmlMode;
123 	sal_Bool        bAllowShowSelector	: 1;
124 	sal_Bool        bIsGraphicValid		: 1;
125 	sal_Bool		bLinkOnly			: 1;
126     sal_Bool        bResized            : 1;
127     sal_Bool        bColTransparency    : 1;
128     sal_Bool        bGraphTransparency  : 1;
129     Graphic     aBgdGraphic;
130 	String      aBgdGraphicPath;
131 	String      aBgdGraphicFilter;
132 
133 	SvxBackgroundPage_Impl* pPageImpl;
134 	SvxOpenGraphicDialog* pImportDlg;
135 
136 	// Items fuer Sw-Tabelle muessen gesammelt werden
137 	SvxBackgroundTable_Impl*	pTableBck_Impl;
138 	// auch fuer die Absatzvorlage
139 	SvxBackgroundPara_Impl*	pParaBck_Impl;
140 
141 #ifdef _SVX_BACKGRND_CXX
142 	void                FillColorValueSets_Impl();
143 	void                ShowColorUI_Impl();
144 	void                ShowBitmapUI_Impl();
145 	sal_Bool                LoadLinkedGraphic_Impl();
146 	void                RaiseLoadError_Impl();
147 	void                SetGraphicPosition_Impl( SvxGraphicPosition ePos );
148 	SvxGraphicPosition  GetGraphicPosition_Impl();
149 	void				FillControls_Impl(const SvxBrushItem& rBgdAttr,
150 											const String& rUserData);
151 	sal_Bool 				FillItemSetWithWallpaperItem( SfxItemSet& rCoreSet, sal_uInt16 nSlot);
152 	void				ResetFromWallpaperItem( const SfxItemSet& rSet );
153 
154 	DECL_LINK( LoadTimerHdl_Impl, Timer* );
155 	DECL_LINK( SelectHdl_Impl, ListBox* );
156 	DECL_LINK( BrowseHdl_Impl, PushButton* );
157 	DECL_LINK( RadioClickHdl_Impl, RadioButton* );
158 	DECL_LINK( FileClickHdl_Impl, CheckBox* );
159 	DECL_LINK( BackgroundColorHdl_Impl, ValueSet* );
160 	DECL_LINK( TblDestinationHdl_Impl, ListBox* );
161 	DECL_LINK( ParaDestinationHdl_Impl, ListBox* );
162 #endif
163 };
164 
165 #endif // #ifndef _SVX_BACKGRND_HXX
166 
167 
168