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 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>
28 #include "cuitabarea.hxx"
30 class BackgroundPreviewImpl
;
31 class SvxOpenGraphicDialog
;
34 /** class SvxBackgroundTabPage --------------------------------------------
37 With this TabPage a Brush (e. g. for a frame's background color)
40 <SvxBrushItem>: <SID_ATTR_BRUSH>;
43 class SvxBackgroundTabPage
: public SvxTabPage
45 static const sal_uInt16 pPageRanges
[];
47 SvxBackgroundTabPage(weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
& rCoreSet
);
48 static std::unique_ptr
<SfxTabPage
> Create( weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
* rAttrSet
);
49 virtual ~SvxBackgroundTabPage() override
;
51 // returns the area of the which-values
52 static const sal_uInt16
* GetRanges() { return pPageRanges
; }
54 virtual bool FillItemSet( SfxItemSet
* rSet
) override
;
55 virtual void Reset( const SfxItemSet
* rSet
) override
;
56 virtual void FillUserData() override
;
57 virtual void PointChanged( weld::DrawingArea
* pWindow
, RectPoint eRP
) override
;
59 /// Shift-ListBox activation
61 /// for the Writer (cells/rows/tables)
62 void ShowTblControl();
64 virtual void PageCreated(const SfxAllItemSet
& aSet
) override
;
66 virtual DeactivateRC
DeactivatePage( SfxItemSet
* pSet
) override
;
69 // DDListBox for Writer -------------------------------
73 bool bAllowShowSelector
: 1;
74 bool bIsGraphicValid
: 1;
75 bool bHighlighting
: 1;
76 bool bCharBackColor
: 1;
77 bool m_bColorSelected
: 1;
79 OUString aBgdGraphicPath
;
80 OUString aBgdGraphicFilter
;
82 std::unique_ptr
<Idle
> m_pLoadIdle
;
83 bool m_bIsImportDlgInExecute
= false;
85 std::unique_ptr
<SvxOpenGraphicDialog
> pImportDlg
;
87 ///< Items for Sw-Table must be corrected
88 std::unique_ptr
<SvxBrushItem
> m_pCellBrush
;
89 std::unique_ptr
<SvxBrushItem
> m_pRowBrush
;
90 std::unique_ptr
<SvxBrushItem
> m_pTableBrush
;
91 sal_uInt16 m_nCellWhich
= 0;
92 sal_uInt16 m_nRowWhich
= 0;
93 sal_uInt16 m_nTableWhich
= 0;
94 sal_Int32 m_nActPos
= 0;
96 std::unique_ptr
<SvxBrushItem
> pHighlighting
;
98 std::unique_ptr
<SvxRectCtl
> m_xWndPosition
;
99 std::unique_ptr
<ColorValueSet
> m_xBackgroundColorSet
;
100 std::unique_ptr
<BackgroundPreviewImpl
> m_xPreview1
;
101 std::unique_ptr
<BackgroundPreviewImpl
> m_xPreview2
;
103 std::unique_ptr
<weld::Label
> m_xFindGraphicsFt
;
104 std::unique_ptr
<weld::Widget
> m_xAsGrid
;
105 std::unique_ptr
<weld::Label
> m_xSelectTxt
;
106 std::unique_ptr
<weld::ComboBox
> m_xLbSelect
;
107 std::unique_ptr
<weld::Label
> m_xTblDesc
;
108 std::unique_ptr
<weld::ComboBox
> m_xTblLBox
;
110 std::unique_ptr
<weld::Label
> m_xBackGroundColorLabelFT
;
111 std::unique_ptr
<weld::Widget
> m_xBackGroundColorFrame
;
113 std::unique_ptr
<weld::CheckButton
> m_xBtnPreview
;
115 // Background Bitmap ----------------------------------
116 std::unique_ptr
<weld::Widget
> m_xBitmapContainer
;
117 std::unique_ptr
<weld::Widget
> m_xFileFrame
;
118 std::unique_ptr
<weld::Button
> m_xBtnBrowse
;
119 std::unique_ptr
<weld::CheckButton
> m_xBtnLink
;
120 std::unique_ptr
<weld::Label
> m_xFtUnlinked
;
121 std::unique_ptr
<weld::Label
> m_xFtFile
;
123 std::unique_ptr
<weld::Widget
> m_xTypeFrame
;
124 std::unique_ptr
<weld::RadioButton
> m_xBtnPosition
;
125 std::unique_ptr
<weld::RadioButton
> m_xBtnArea
;
126 std::unique_ptr
<weld::RadioButton
> m_xBtnTile
;
128 std::unique_ptr
<weld::CustomWeld
> m_xWndPositionWin
;
129 std::unique_ptr
<weld::CustomWeld
> m_xBackgroundColorSetWin
;
130 std::unique_ptr
<weld::CustomWeld
> m_xPreviewWin1
;
131 std::unique_ptr
<weld::CustomWeld
> m_xPreviewWin2
;
133 void FillColorValueSets_Impl();
134 void ShowColorUI_Impl();
135 void HideColorUI_Impl();
136 void ShowBitmapUI_Impl();
137 void HideBitmapUI_Impl();
138 bool LoadLinkedGraphic_Impl();
139 void RaiseLoadError_Impl();
140 void SetGraphicPosition_Impl( SvxGraphicPosition ePos
);
141 SvxGraphicPosition
GetGraphicPosition_Impl() const;
142 void FillControls_Impl(const SvxBrushItem
& rBgdAttr
,
143 const OUString
& rUserData
);
145 DECL_LINK(LoadIdleHdl_Impl
, Timer
*, void);
146 DECL_LINK(SelectHdl_Impl
, weld::ComboBox
&, void);
147 DECL_LINK(BrowseHdl_Impl
, weld::Button
&, void);
148 DECL_LINK(RadioClickHdl_Impl
, weld::ToggleButton
&, void );
149 DECL_LINK(FileClickHdl_Impl
, weld::ToggleButton
&, void);
150 DECL_LINK(BackgroundColorHdl_Impl
, SvtValueSet
*, void);
151 DECL_LINK(TblDestinationHdl_Impl
, weld::ComboBox
&, void);
154 class SvxBkgTabPage
: public SvxAreaTabPage
156 std::unique_ptr
<weld::ComboBox
> m_xTblLBox
;
157 bool bHighlighting
: 1;
158 bool bCharBackColor
: 1;
160 std::unique_ptr
<SfxItemSet
> m_pResetSet
;
162 sal_Int32 m_nActPos
= -1;
164 DECL_LINK(TblDestinationHdl_Impl
, weld::ComboBox
&, void);
166 SvxBkgTabPage(weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
& rInAttrs
);
167 virtual ~SvxBkgTabPage() override
;
169 static std::unique_ptr
<SfxTabPage
> Create( weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
* );
170 virtual bool FillItemSet( SfxItemSet
* ) override
;
171 virtual void ActivatePage( const SfxItemSet
& ) override
;
172 virtual DeactivateRC
DeactivatePage( SfxItemSet
* pSet
) override
;
173 virtual void PageCreated( const SfxAllItemSet
& aSet
) override
;
174 virtual void Reset( const SfxItemSet
* ) override
;
177 #endif // INCLUDED_CUI_SOURCE_INC_BACKGRND_HXX
180 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */