Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / cui / source / inc / backgrnd.hxx
blob4a2e2184b211699d7d0a11d7a2b5c1085623049c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 <svtools/valueset.hxx>
26 #include <svx/dlgctrl.hxx>
28 //------------------------------------------------------------------------
29 // forwards:
31 class BackgroundPreviewImpl;
32 class SvxOpenGraphicDialog;
33 struct SvxBackgroundTable_Impl;
34 struct SvxBackgroundPara_Impl;
35 struct SvxBackgroundPage_Impl;
36 class SvxBrushItem;
37 /** class SvxBackgroundTabPage --------------------------------------------
38 {k:\svx\prototyp\dialog\backgrnd.bmp}
39 [Description]
40 With this TabPage a Brush (e. g. for a frame's background color)
41 can be set.
42 [Items]
43 <SvxBrushItem>: <SID_ATTR_BRUSH>;
46 class SvxBackgroundTabPage : public SvxTabPage
48 using TabPage::DeactivatePage;
49 public:
50 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
51 static sal_uInt16* GetRanges();
53 virtual sal_Bool FillItemSet( SfxItemSet& rSet );
54 virtual void Reset( const SfxItemSet& rSet );
55 virtual void FillUserData();
56 virtual void PointChanged( Window* pWindow, RECT_POINT eRP );
58 /// Shift-ListBox activation
59 void ShowSelector();
60 /// for the Writer (cells/rows/tables)
61 void ShowTblControl();
62 /// for the Writer (paragraph/characters)
63 void ShowParaControl(sal_Bool bCharOnly = sal_False);
65 void EnableTransparency(sal_Bool bColor, sal_Bool bGraphic);
66 virtual void PageCreated (SfxAllItemSet aSet);
67 protected:
68 virtual int DeactivatePage( SfxItemSet* pSet = 0 );
70 private:
71 SvxBackgroundTabPage( Window* pParent, const SfxItemSet& rCoreSet );
72 ~SvxBackgroundTabPage();
74 FixedText aSelectTxt;
75 ListBox aLbSelect;
76 const String aStrBrowse;
77 const String aStrUnlinked;
78 FixedText aTblDesc;
79 ListBox aTblLBox;
80 ListBox aParaLBox;
81 Control aBorderWin;
82 ValueSet aBackgroundColorSet;
83 FixedLine aBackgroundColorBox;
84 BackgroundPreviewImpl* pPreviewWin1;
86 FixedText aColTransFT;///<color transparency
87 MetricField aColTransMF;
88 CheckBox aBtnPreview;
89 // Background Bitmap ----------------------------------
90 FixedLine aGbFile;
91 PushButton aBtnBrowse;
92 CheckBox aBtnLink;
93 FixedLine aGbPosition;
94 RadioButton aBtnPosition;
95 RadioButton aBtnArea;
96 RadioButton aBtnTile;
97 SvxRectCtl aWndPosition;
98 FixedInfo aFtFile;
100 FixedLine aGraphTransFL;///<transparency of graphics
101 MetricField aGraphTransMF;
103 BackgroundPreviewImpl* pPreviewWin2;
105 // DDListBox for Writer -------------------------------
106 //------------------------------------------------------
107 Color aBgdColor;
108 sal_uInt16 nHtmlMode;
109 sal_Bool bAllowShowSelector : 1;
110 sal_Bool bIsGraphicValid : 1;
111 sal_Bool bLinkOnly : 1;
112 sal_Bool bResized : 1;
113 sal_Bool bColTransparency : 1;
114 sal_Bool bGraphTransparency : 1;
115 Graphic aBgdGraphic;
116 String aBgdGraphicPath;
117 String aBgdGraphicFilter;
119 SvxBackgroundPage_Impl* pPageImpl;
120 SvxOpenGraphicDialog* pImportDlg;
122 SvxBackgroundTable_Impl* pTableBck_Impl;///< Items for Sw-Table must be corrected
123 SvxBackgroundPara_Impl* pParaBck_Impl;///< also for the paragraph style
125 #ifdef _SVX_BACKGRND_CXX
126 void FillColorValueSets_Impl();
127 void ShowColorUI_Impl();
128 void ShowBitmapUI_Impl();
129 sal_Bool LoadLinkedGraphic_Impl();
130 void RaiseLoadError_Impl();
131 void SetGraphicPosition_Impl( SvxGraphicPosition ePos );
132 SvxGraphicPosition GetGraphicPosition_Impl();
133 void FillControls_Impl(const SvxBrushItem& rBgdAttr,
134 const String& rUserData);
135 sal_Bool FillItemSetWithWallpaperItem( SfxItemSet& rCoreSet, sal_uInt16 nSlot);
136 void ResetFromWallpaperItem( const SfxItemSet& rSet );
138 DECL_LINK( LoadTimerHdl_Impl, Timer* );
139 DECL_LINK(SelectHdl_Impl, void *);
140 DECL_LINK(BrowseHdl_Impl, void *);
141 DECL_LINK( RadioClickHdl_Impl, RadioButton* );
142 DECL_LINK( FileClickHdl_Impl, CheckBox* );
143 DECL_LINK(BackgroundColorHdl_Impl, void *);
144 DECL_LINK( TblDestinationHdl_Impl, ListBox* );
145 DECL_LINK( ParaDestinationHdl_Impl, ListBox* );
146 #endif
149 #endif // #ifndef _SVX_BACKGRND_HXX
152 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */