1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef _SVX_BACKGRND_HXX
20 #define _SVX_BACKGRND_HXX
22 #include <vcl/group.hxx>
23 #include <svtools/stdctrl.hxx>
24 #include <vcl/graph.hxx>
25 #include <svx/SvxColorValueSet.hxx>
26 #include <svx/dlgctrl.hxx>
27 #include <editeng/brushitem.hxx>
29 //------------------------------------------------------------------------
32 class BackgroundPreviewImpl
;
33 class SvxOpenGraphicDialog
;
34 struct SvxBackgroundTable_Impl
;
35 struct SvxBackgroundPara_Impl
;
36 struct SvxBackgroundPage_Impl
;
39 class XFillGradientItem
;
40 /** class SvxBackgroundTabPage --------------------------------------------
41 {k:\svx\prototyp\dialog\backgrnd.bmp}
43 With this TabPage a Brush (e. g. for a frame's background color)
46 <SvxBrushItem>: <SID_ATTR_BRUSH>;
49 class SvxBackgroundTabPage
: public SvxTabPage
51 using TabPage::DeactivatePage
;
53 static SfxTabPage
* Create( Window
* pParent
, const SfxItemSet
& rAttrSet
);
54 static sal_uInt16
* GetRanges();
56 virtual sal_Bool
FillItemSet( SfxItemSet
& rSet
);
57 virtual void Reset( const SfxItemSet
& rSet
);
58 virtual void FillUserData();
59 virtual void PointChanged( Window
* pWindow
, RECT_POINT eRP
);
61 /// Shift-ListBox activation
63 /// for the Writer (cells/rows/tables)
64 void ShowTblControl();
65 /// for the Writer (paragraph/characters)
66 void ShowParaControl(sal_Bool bCharOnly
= sal_False
);
68 void EnableTransparency(sal_Bool bColor
, sal_Bool bGraphic
);
69 virtual void PageCreated (SfxAllItemSet aSet
);
71 virtual int DeactivatePage( SfxItemSet
* pSet
= 0 );
74 SvxBackgroundTabPage( Window
* pParent
, const SfxItemSet
& rCoreSet
);
75 ~SvxBackgroundTabPage();
77 VclContainer
* m_pAsGrid
;
78 FixedText
* m_pSelectTxt
;
80 FixedText
* m_pTblDesc
;
84 VclFrame
* m_pBackGroundColorFrame
;
85 SvxColorValueSet
* m_pBackgroundColorSet
;
86 BackgroundPreviewImpl
* m_pPreviewWin1
;
88 FixedText
* m_pColTransFT
;///<color transparency
89 MetricField
* m_pColTransMF
;
90 CheckBox
* m_pBtnPreview
;
93 VclFrame
* m_pBackGroundGradientFrame
;
94 GradientLB
* m_pLbGradients
;
95 SvxXRectPreview
* m_pCtlPreview
;
98 XGradientListRef m_pGradientList
;
99 SfxItemPool
* m_pXPool
;
100 XFillAttrSetItem m_aXFillAttr
;
101 SfxItemSet
& m_rXFillSet
;
103 // Background Bitmap ----------------------------------
104 VclContainer
* m_pBitmapContainer
;
105 VclContainer
* m_pFileFrame
;
106 PushButton
* m_pBtnBrowse
;
107 CheckBox
* m_pBtnLink
;
108 FixedText
* m_pFtUnlinked
;
109 FixedText
* m_pFtFile
;
111 VclContainer
* m_pTypeFrame
;
112 RadioButton
* m_pBtnPosition
;
113 RadioButton
* m_pBtnArea
;
114 RadioButton
* m_pBtnTile
;
115 SvxRectCtl
* m_pWndPosition
;
117 VclContainer
* m_pGraphTransFrame
;///<transparency of graphics
118 MetricField
* m_pGraphTransMF
;
120 BackgroundPreviewImpl
* m_pPreviewWin2
;
122 // DDListBox for Writer -------------------------------
123 //------------------------------------------------------
125 sal_uInt16 nHtmlMode
;
126 sal_Bool bAllowShowSelector
: 1;
127 sal_Bool bIsGraphicValid
: 1;
128 sal_Bool bLinkOnly
: 1;
129 sal_Bool bColTransparency
: 1;
130 sal_Bool bGraphTransparency
: 1;
132 String aBgdGraphicPath
;
133 String aBgdGraphicFilter
;
135 SvxBackgroundPage_Impl
* pPageImpl
;
136 SvxOpenGraphicDialog
* pImportDlg
;
138 SvxBackgroundTable_Impl
* pTableBck_Impl
;///< Items for Sw-Table must be corrected
139 SvxBackgroundPara_Impl
* pParaBck_Impl
;///< also for the paragraph style
141 void FillColorValueSets_Impl();
142 void ShowColorUI_Impl();
143 void HideColorUI_Impl();
144 void ShowBitmapUI_Impl();
145 void HideBitmapUI_Impl();
146 void ShowGradientUI_Impl();
147 void HideGradientUI_Impl();
148 sal_Bool
LoadLinkedGraphic_Impl();
149 void RaiseLoadError_Impl();
150 void SetGraphicPosition_Impl( SvxGraphicPosition ePos
);
151 SvxGraphicPosition
GetGraphicPosition_Impl();
152 void FillControls_Impl(const SvxBrushItem
& rBgdAttr
,
153 const String
& rUserData
);
154 sal_Bool
FillItemSetWithWallpaperItem( SfxItemSet
& rCoreSet
, sal_uInt16 nSlot
);
155 void ResetFromWallpaperItem( const SfxItemSet
& rSet
);
157 DECL_LINK( LoadTimerHdl_Impl
, Timer
* );
158 DECL_LINK(SelectHdl_Impl
, void *);
159 DECL_LINK(BrowseHdl_Impl
, void *);
160 DECL_LINK( RadioClickHdl_Impl
, RadioButton
* );
161 DECL_LINK( FileClickHdl_Impl
, CheckBox
* );
162 DECL_LINK(BackgroundColorHdl_Impl
, void *);
163 DECL_LINK( TblDestinationHdl_Impl
, ListBox
* );
164 DECL_LINK( ParaDestinationHdl_Impl
, ListBox
* );
165 DECL_LINK(ModifyGradientHdl_Impl
, void *);
168 #endif // #ifndef _SVX_BACKGRND_HXX
171 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */