bump product version to 6.3.0.0.beta1
[LibreOffice.git] / cui / source / inc / backgrnd.hxx
blob78c82a6448ac0e7e574c9bb6e9db18a60887cdc0
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/graph.hxx>
23 #include <svx/SvxColorValueSet.hxx>
24 #include <svx/dlgctrl.hxx>
25 #include <editeng/brushitem.hxx>
26 #include <memory>
28 #include "cuitabarea.hxx"
30 class BackgroundPreviewImpl;
31 class SvxOpenGraphicDialog;
32 class SvxBrushItem;
34 /** class SvxBackgroundTabPage --------------------------------------------
36 [Description]
37 With this TabPage a Brush (e. g. for a frame's background color)
38 can be set.
39 [Items]
40 <SvxBrushItem>: <SID_ATTR_BRUSH>;
43 class SvxBackgroundTabPage : public SvxTabPage
45 using TabPage::DeactivatePage;
46 friend class VclPtr<SvxBackgroundTabPage>;
47 static const sal_uInt16 pPageRanges[];
48 public:
49 static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet );
50 // returns the area of the which-values
51 static const sal_uInt16* GetRanges() { return pPageRanges; }
53 virtual bool FillItemSet( SfxItemSet* rSet ) override;
54 virtual void Reset( const SfxItemSet* rSet ) override;
55 virtual void FillUserData() override;
56 virtual void PointChanged( weld::DrawingArea* pWindow, RectPoint eRP ) override;
58 /// Shift-ListBox activation
59 void ShowSelector();
60 /// for the Writer (cells/rows/tables)
61 void ShowTblControl();
63 virtual void PageCreated(const SfxAllItemSet& aSet) override;
64 protected:
65 virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
67 private:
68 SvxBackgroundTabPage(TabPageParent pParent, const SfxItemSet& rCoreSet);
69 virtual ~SvxBackgroundTabPage() override;
70 virtual void dispose() override;
72 // DDListBox for Writer -------------------------------
74 Color aBgdColor;
75 sal_uInt16 nHtmlMode;
76 bool bAllowShowSelector : 1;
77 bool bIsGraphicValid : 1;
78 bool bHighlighting : 1;
79 bool bCharBackColor : 1;
80 bool m_bColorSelected : 1;
81 Graphic aBgdGraphic;
82 OUString aBgdGraphicPath;
83 OUString aBgdGraphicFilter;
85 std::unique_ptr<Idle> m_pLoadIdle;
86 bool m_bIsImportDlgInExecute = false;
88 std::unique_ptr<SvxOpenGraphicDialog> pImportDlg;
90 ///< Items for Sw-Table must be corrected
91 std::unique_ptr<SvxBrushItem> m_pCellBrush;
92 std::unique_ptr<SvxBrushItem> m_pRowBrush;
93 std::unique_ptr<SvxBrushItem> m_pTableBrush;
94 sal_uInt16 m_nCellWhich = 0;
95 sal_uInt16 m_nRowWhich = 0;
96 sal_uInt16 m_nTableWhich = 0;
97 sal_Int32 m_nActPos = 0;
99 std::unique_ptr<SvxBrushItem> pHighlighting;
101 std::unique_ptr<SvxRectCtl> m_xWndPosition;
102 std::unique_ptr<ColorValueSet> m_xBackgroundColorSet;
103 std::unique_ptr<BackgroundPreviewImpl> m_xPreview1;
104 std::unique_ptr<BackgroundPreviewImpl> m_xPreview2;
106 std::unique_ptr<weld::Label> m_xFindGraphicsFt;
107 std::unique_ptr<weld::Widget> m_xAsGrid;
108 std::unique_ptr<weld::Label> m_xSelectTxt;
109 std::unique_ptr<weld::ComboBox> m_xLbSelect;
110 std::unique_ptr<weld::Label> m_xTblDesc;
111 std::unique_ptr<weld::ComboBox> m_xTblLBox;
113 std::unique_ptr<weld::Label> m_xBackGroundColorLabelFT;
114 std::unique_ptr<weld::Widget> m_xBackGroundColorFrame;
116 std::unique_ptr<weld::CheckButton> m_xBtnPreview;
118 // Background Bitmap ----------------------------------
119 std::unique_ptr<weld::Widget> m_xBitmapContainer;
120 std::unique_ptr<weld::Widget> m_xFileFrame;
121 std::unique_ptr<weld::Button> m_xBtnBrowse;
122 std::unique_ptr<weld::CheckButton> m_xBtnLink;
123 std::unique_ptr<weld::Label> m_xFtUnlinked;
124 std::unique_ptr<weld::Label> m_xFtFile;
126 std::unique_ptr<weld::Widget> m_xTypeFrame;
127 std::unique_ptr<weld::RadioButton> m_xBtnPosition;
128 std::unique_ptr<weld::RadioButton> m_xBtnArea;
129 std::unique_ptr<weld::RadioButton> m_xBtnTile;
131 std::unique_ptr<weld::CustomWeld> m_xWndPositionWin;
132 std::unique_ptr<weld::CustomWeld> m_xBackgroundColorSetWin;
133 std::unique_ptr<weld::CustomWeld> m_xPreviewWin1;
134 std::unique_ptr<weld::CustomWeld> m_xPreviewWin2;
136 void FillColorValueSets_Impl();
137 void ShowColorUI_Impl();
138 void HideColorUI_Impl();
139 void ShowBitmapUI_Impl();
140 void HideBitmapUI_Impl();
141 bool LoadLinkedGraphic_Impl();
142 void RaiseLoadError_Impl();
143 void SetGraphicPosition_Impl( SvxGraphicPosition ePos );
144 SvxGraphicPosition GetGraphicPosition_Impl();
145 void FillControls_Impl(const SvxBrushItem& rBgdAttr,
146 const OUString& rUserData);
148 DECL_LINK(LoadIdleHdl_Impl, Timer*, void);
149 DECL_LINK(SelectHdl_Impl, weld::ComboBox&, void);
150 DECL_LINK(BrowseHdl_Impl, weld::Button&, void);
151 DECL_LINK(RadioClickHdl_Impl, weld::ToggleButton&, void );
152 DECL_LINK(FileClickHdl_Impl, weld::ToggleButton&, void);
153 DECL_LINK(BackgroundColorHdl_Impl, SvtValueSet*, void);
154 DECL_LINK(TblDestinationHdl_Impl, weld::ComboBox&, void);
157 class SvxBkgTabPage : public SvxAreaTabPage
159 std::unique_ptr<weld::ComboBox> m_xTblLBox;
160 bool bHighlighting : 1;
161 bool bCharBackColor : 1;
162 SfxItemSet maSet;
163 std::unique_ptr<SfxItemSet> m_pResetSet;
165 sal_Int32 m_nActPos = -1;
167 DECL_LINK(TblDestinationHdl_Impl, weld::ComboBox&, void);
168 public:
169 using SvxAreaTabPage::ActivatePage;
170 using SvxAreaTabPage::DeactivatePage;
172 SvxBkgTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs);
173 virtual ~SvxBkgTabPage() override;
174 virtual void dispose() override;
176 static VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet* );
177 virtual bool FillItemSet( SfxItemSet* ) override;
178 virtual void ActivatePage( const SfxItemSet& ) override;
179 virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
180 virtual void PageCreated( const SfxAllItemSet& aSet ) override;
181 virtual void Reset( const SfxItemSet * ) override;
184 #endif // INCLUDED_CUI_SOURCE_INC_BACKGRND_HXX
187 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */