bump product version to 5.0.4.1
[LibreOffice.git] / cui / source / inc / backgrnd.hxx
blob6845c41730a63620f27d175985c7d45dae34751f
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 INCLUDED_CUI_SOURCE_INC_BACKGRND_HXX
20 #define INCLUDED_CUI_SOURCE_INC_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>
28 #include <memory>
30 class BackgroundPreviewImpl;
31 class SvxOpenGraphicDialog;
32 struct SvxBackgroundTable_Impl;
33 struct SvxBackgroundPara_Impl;
34 struct SvxBackgroundPage_Impl;
35 class SvxBrushItem;
37 /** class SvxBackgroundTabPage --------------------------------------------
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 friend class VclPtr<SvxBackgroundTabPage>;
50 static const sal_uInt16 pPageRanges[];
51 public:
52 static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
53 // returns the area of the which-values
54 static const sal_uInt16* GetRanges() { return pPageRanges; }
56 virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
57 virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
58 virtual void FillUserData() SAL_OVERRIDE;
59 virtual void PointChanged( vcl::Window* pWindow, RECT_POINT eRP ) SAL_OVERRIDE;
61 /// Shift-ListBox activation
62 void ShowSelector();
63 /// for the Writer (cells/rows/tables)
64 void ShowTblControl();
65 /// for the Writer (paragraph/characters)
66 void ShowParaControl(bool bCharOnly = false);
68 void EnableTransparency(bool bColor, bool bGraphic);
69 virtual void PageCreated(const SfxAllItemSet& aSet) SAL_OVERRIDE;
70 protected:
71 virtual sfxpg DeactivatePage( SfxItemSet* pSet = 0 ) SAL_OVERRIDE;
73 private:
74 SvxBackgroundTabPage( vcl::Window* pParent, const SfxItemSet& rCoreSet );
75 virtual ~SvxBackgroundTabPage();
76 virtual void dispose() SAL_OVERRIDE;
78 VclPtr<VclContainer> m_pAsGrid;
79 VclPtr<FixedText> m_pSelectTxt;
80 VclPtr<ListBox> m_pLbSelect;
81 VclPtr<FixedText> m_pTblDesc;
82 VclPtr<ListBox> m_pTblLBox;
83 VclPtr<ListBox> m_pParaLBox;
85 VclPtr<FixedText> m_pBackGroundColorLabelFT;
86 VclPtr<VclFrame> m_pBackGroundColorFrame;
87 VclPtr<SvxColorValueSet> m_pBackgroundColorSet;
88 VclPtr<BackgroundPreviewImpl> m_pPreviewWin1;
90 VclPtr<FixedText> m_pColTransFT;///<color transparency
91 VclPtr<MetricField> m_pColTransMF;
92 VclPtr<CheckBox> m_pBtnPreview;
94 // Background Bitmap ----------------------------------
95 VclPtr<VclContainer> m_pBitmapContainer;
96 VclPtr<VclContainer> m_pFileFrame;
97 VclPtr<PushButton> m_pBtnBrowse;
98 VclPtr<CheckBox> m_pBtnLink;
99 VclPtr<FixedText> m_pFtUnlinked;
100 VclPtr<FixedText> m_pFtFile;
102 VclPtr<VclContainer> m_pTypeFrame;
103 VclPtr<RadioButton> m_pBtnPosition;
104 VclPtr<RadioButton> m_pBtnArea;
105 VclPtr<RadioButton> m_pBtnTile;
106 VclPtr<SvxRectCtl> m_pWndPosition;
108 VclPtr<VclContainer> m_pGraphTransFrame;///<transparency of graphics
109 VclPtr<MetricField> m_pGraphTransMF;
111 VclPtr<BackgroundPreviewImpl> m_pPreviewWin2;
113 // DDListBox for Writer -------------------------------
115 Color aBgdColor;
116 sal_uInt16 nHtmlMode;
117 bool bAllowShowSelector : 1;
118 bool bIsGraphicValid : 1;
119 bool bLinkOnly : 1;
120 bool bColTransparency : 1;
121 bool bGraphTransparency : 1;
122 bool bHighlighting : 1;
124 Graphic aBgdGraphic;
125 OUString aBgdGraphicPath;
126 OUString aBgdGraphicFilter;
128 SvxBackgroundPage_Impl* pPageImpl;
129 SvxOpenGraphicDialog* pImportDlg;
131 SvxBackgroundTable_Impl* pTableBck_Impl;///< Items for Sw-Table must be corrected
132 SvxBackgroundPara_Impl* pParaBck_Impl;///< also for the paragraph style
133 std::unique_ptr<SvxBrushItem> pHighlighting;
135 void FillColorValueSets_Impl();
136 void ShowColorUI_Impl();
137 void HideColorUI_Impl();
138 void ShowBitmapUI_Impl();
139 void HideBitmapUI_Impl();
140 bool LoadLinkedGraphic_Impl();
141 void RaiseLoadError_Impl();
142 void SetGraphicPosition_Impl( SvxGraphicPosition ePos );
143 SvxGraphicPosition GetGraphicPosition_Impl();
144 void FillControls_Impl(const SvxBrushItem& rBgdAttr,
145 const OUString& rUserData);
146 bool FillItemSetWithWallpaperItem( SfxItemSet& rCoreSet, sal_uInt16 nSlot);
147 void ResetFromWallpaperItem( const SfxItemSet& rSet );
149 DECL_LINK_TYPED( LoadIdleHdl_Impl, Idle*, void );
150 DECL_LINK(SelectHdl_Impl, void *);
151 DECL_LINK(BrowseHdl_Impl, void *);
152 DECL_LINK( RadioClickHdl_Impl, RadioButton* );
153 DECL_LINK( FileClickHdl_Impl, CheckBox* );
154 DECL_LINK(BackgroundColorHdl_Impl, void *);
155 DECL_LINK( TblDestinationHdl_Impl, ListBox* );
156 DECL_LINK( ParaDestinationHdl_Impl, ListBox* );
159 #endif // INCLUDED_CUI_SOURCE_INC_BACKGRND_HXX
162 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */