LibreOffice Module cui (master)  1
backgrnd.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 #ifndef INCLUDED_CUI_SOURCE_INC_BACKGRND_HXX
20 #define INCLUDED_CUI_SOURCE_INC_BACKGRND_HXX
21 
22 #include <vcl/graph.hxx>
23 #include <svx/SvxColorValueSet.hxx>
24 #include <svx/dlgctrl.hxx>
25 #include <editeng/brushitem.hxx>
26 #include <memory>
27 
28 #include "cuitabarea.hxx"
29 
32 class SvxBrushItem;
33 
44 {
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; }
52 
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;
57 
59  void ShowSelector();
61  void ShowTblControl();
62 
63  virtual void PageCreated(const SfxAllItemSet& aSet) override;
64 protected:
65  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
66 
67 private:
68  SvxBackgroundTabPage(TabPageParent pParent, const SfxItemSet& rCoreSet);
69  virtual ~SvxBackgroundTabPage() override;
70  virtual void dispose() override;
71 
72  // DDListBox for Writer -------------------------------
73 
75  sal_uInt16 nHtmlMode;
77  bool bIsGraphicValid : 1;
78  bool bHighlighting : 1;
79  bool bCharBackColor : 1;
80  bool m_bColorSelected : 1;
82  OUString aBgdGraphicPath;
84 
85  std::unique_ptr<Idle> m_pLoadIdle;
87 
88  std::unique_ptr<SvxOpenGraphicDialog> pImportDlg;
89 
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;
98 
99  std::unique_ptr<SvxBrushItem> pHighlighting;
100 
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;
105 
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;
112 
113  std::unique_ptr<weld::Label> m_xBackGroundColorLabelFT;
114  std::unique_ptr<weld::Widget> m_xBackGroundColorFrame;
115 
116  std::unique_ptr<weld::CheckButton> m_xBtnPreview;
117 
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;
125 
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;
130 
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;
135 
137  void ShowColorUI_Impl();
138  void HideColorUI_Impl();
139  void ShowBitmapUI_Impl();
140  void HideBitmapUI_Impl();
141  bool LoadLinkedGraphic_Impl();
142  void RaiseLoadError_Impl();
145  void FillControls_Impl(const SvxBrushItem& rBgdAttr,
146  const OUString& rUserData);
147 
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);
155 };
156 
158 {
159  std::unique_ptr<weld::ComboBox> m_xTblLBox;
160  bool bHighlighting : 1;
161  bool bCharBackColor : 1;
163  std::unique_ptr<SfxItemSet> m_pResetSet;
164 
165  sal_Int32 m_nActPos = -1;
166 
167  DECL_LINK(TblDestinationHdl_Impl, weld::ComboBox&, void);
168 public:
171 
172  SvxBkgTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs);
173  virtual ~SvxBkgTabPage() override;
174  virtual void dispose() override;
175 
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;
182 };
183 
184 #endif // INCLUDED_CUI_SOURCE_INC_BACKGRND_HXX
185 
186 
187 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: backgrnd.cxx:1423
std::unique_ptr< weld::ComboBox > m_xTblLBox
Definition: backgrnd.hxx:159
sal_Int32 m_nActPos
Definition: backgrnd.hxx:165
std::unique_ptr< weld::Label > m_xBackGroundColorLabelFT
Definition: backgrnd.hxx:113
SvxGraphicPosition GetGraphicPosition_Impl()
Definition: backgrnd.cxx:922
bool bCharBackColor
Definition: backgrnd.hxx:161
OUString aBgdGraphicPath
Definition: backgrnd.hxx:82
const SfxItemSet * pSet
void FillColorValueSets_Impl()
Definition: backgrnd.cxx:809
std::unique_ptr< SvxBrushItem > m_pRowBrush
Definition: backgrnd.hxx:92
std::unique_ptr< weld::Widget > m_xBackGroundColorFrame
Definition: backgrnd.hxx:114
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: tparea.cxx:180
std::unique_ptr< weld::CustomWeld > m_xBackgroundColorSetWin
Definition: backgrnd.hxx:132
std::unique_ptr< weld::Widget > m_xFileFrame
Definition: backgrnd.hxx:120
std::unique_ptr< ColorValueSet > m_xBackgroundColorSet
Definition: backgrnd.hxx:102
std::unique_ptr< weld::Label > m_xFtUnlinked
Definition: backgrnd.hxx:123
bool LoadLinkedGraphic_Impl()
Definition: backgrnd.cxx:800
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: backgrnd.cxx:507
sal_uInt16 nHtmlMode
Definition: backgrnd.hxx:75
std::unique_ptr< weld::Widget > m_xTypeFrame
Definition: backgrnd.hxx:126
bool bHighlighting
Definition: backgrnd.hxx:160
void RaiseLoadError_Impl()
Definition: backgrnd.cxx:787
static VclPtr< SfxTabPage > Create(TabPageParent, const SfxItemSet *)
Definition: backgrnd.cxx:1549
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: backgrnd.cxx:1556
std::unique_ptr< Idle > m_pLoadIdle
Definition: backgrnd.hxx:85
SvxBkgTabPage(TabPageParent pParent, const SfxItemSet &rInAttrs)
Definition: backgrnd.cxx:1374
virtual void dispose() override
Definition: backgrnd.cxx:328
std::unique_ptr< weld::ComboBox > m_xLbSelect
Definition: backgrnd.hxx:109
std::unique_ptr< weld::CheckButton > m_xBtnPreview
Definition: backgrnd.hxx:116
std::unique_ptr< weld::RadioButton > m_xBtnTile
Definition: backgrnd.hxx:129
sal_uInt16 m_nTableWhich
Definition: backgrnd.hxx:96
std::unique_ptr< weld::Widget > m_xAsGrid
Definition: backgrnd.hxx:107
bool m_bIsImportDlgInExecute
Definition: backgrnd.hxx:86
RectPoint
void FillControls_Impl(const SvxBrushItem &rBgdAttr, const OUString &rUserData)
Definition: backgrnd.cxx:1223
std::unique_ptr< weld::Button > m_xBtnBrowse
Definition: backgrnd.hxx:121
static VclPtr< SfxTabPage > Create(TabPageParent pParent, const SfxItemSet *rAttrSet)
Definition: backgrnd.cxx:347
virtual void FillUserData() override
When destroying a SfxTabPage this virtual method is called, so that the TabPage can save internal inf...
Definition: backgrnd.cxx:502
virtual bool FillItemSet(SfxItemSet *) override
Definition: backgrnd.cxx:1452
std::unique_ptr< weld::RadioButton > m_xBtnArea
Definition: backgrnd.hxx:128
static const sal_uInt16 * GetRanges()
Definition: backgrnd.hxx:51
SfxItemSet maSet
Definition: backgrnd.hxx:162
virtual void dispose() override
Definition: backgrnd.cxx:1412
static const sal_uInt16 pPageRanges[]
Definition: backgrnd.hxx:47
SvxGraphicPosition
sal_Int32 m_nActPos
Definition: backgrnd.hxx:97
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: tparea.cxx:239
std::unique_ptr< weld::Widget > m_xBitmapContainer
Definition: backgrnd.hxx:119
std::unique_ptr< SvxOpenGraphicDialog > pImportDlg
Items for Sw-Table must be corrected.
Definition: backgrnd.hxx:88
class SvxBackgroundTabPage -----------------------------------------—
Definition: backgrnd.hxx:43
void ShowSelector()
Shift-ListBox activation.
Definition: backgrnd.cxx:757
std::unique_ptr< SvxBrushItem > pHighlighting
Definition: backgrnd.hxx:99
std::unique_ptr< BackgroundPreviewImpl > m_xPreview1
Definition: backgrnd.hxx:103
std::unique_ptr< weld::Label > m_xSelectTxt
Definition: backgrnd.hxx:108
std::unique_ptr< weld::ComboBox > m_xTblLBox
Definition: backgrnd.hxx:111
Preview window for brush or bitmap.
Definition: backgrnd.cxx:114
std::unique_ptr< weld::Label > m_xTblDesc
Definition: backgrnd.hxx:110
std::unique_ptr< weld::Label > m_xFtFile
Definition: backgrnd.hxx:124
DECL_LINK(LoadIdleHdl_Impl, Timer *, void)
std::unique_ptr< SvxBrushItem > m_pTableBrush
Definition: backgrnd.hxx:93
OUString aBgdGraphicFilter
Definition: backgrnd.hxx:83
DECL_LINK(TblDestinationHdl_Impl, weld::ComboBox &, void)
virtual void ActivatePage(const SfxItemSet &) override
Definition: backgrnd.cxx:1418
std::unique_ptr< SvxBrushItem > m_pCellBrush
Definition: backgrnd.hxx:91
virtual ~SvxBkgTabPage() override
Definition: backgrnd.cxx:1407
virtual void Reset(const SfxItemSet *) override
Definition: backgrnd.cxx:1434
virtual void Reset(const SfxItemSet *rSet) override
Definition: backgrnd.cxx:352
std::unique_ptr< BackgroundPreviewImpl > m_xPreview2
Definition: backgrnd.hxx:104
std::unique_ptr< weld::Label > m_xFindGraphicsFt
Definition: backgrnd.hxx:106
SvxBackgroundTabPage(TabPageParent pParent, const SfxItemSet &rCoreSet)
Definition: backgrnd.cxx:264
std::unique_ptr< weld::CustomWeld > m_xPreviewWin1
Definition: backgrnd.hxx:133
void ShowBitmapUI_Impl()
Hide the controls for color settings and show controls for editing the bitmap instead.
Definition: backgrnd.cxx:853
void SetGraphicPosition_Impl(SvxGraphicPosition ePos)
Definition: backgrnd.cxx:878
DeactivateRC
std::unique_ptr< weld::RadioButton > m_xBtnPosition
Definition: backgrnd.hxx:127
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
virtual method; is called on deactivation
Definition: backgrnd.cxx:741
std::unique_ptr< weld::CustomWeld > m_xPreviewWin2
Definition: backgrnd.hxx:134
std::unique_ptr< SfxItemSet > m_pResetSet
Definition: backgrnd.hxx:163
virtual void DeactivatePage()
sal_uInt16 m_nRowWhich
Definition: backgrnd.hxx:95
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: backgrnd.cxx:1331
std::unique_ptr< weld::CustomWeld > m_xWndPositionWin
Definition: backgrnd.hxx:131
virtual ~SvxBackgroundTabPage() override
Definition: backgrnd.cxx:323
std::unique_ptr< weld::CheckButton > m_xBtnLink
Definition: backgrnd.hxx:122
virtual void PointChanged(weld::DrawingArea *pWindow, RectPoint eRP) override
Definition: backgrnd.cxx:752
void ShowTblControl()
for the Writer (cells/rows/tables)
Definition: backgrnd.cxx:1123
std::unique_ptr< SvxRectCtl > m_xWndPosition
Definition: backgrnd.hxx:101
void ShowColorUI_Impl()
Hide the controls for editing the bitmap and show the controls for color settings instead...
Definition: backgrnd.cxx:836
sal_uInt16 m_nCellWhich
Definition: backgrnd.hxx:94