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 {
45  static const sal_uInt16 pPageRanges[];
46 public:
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;
50 
51  // returns the area of the which-values
52  static const sal_uInt16* GetRanges() { return pPageRanges; }
53 
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;
58 
60  void ShowSelector();
62  void ShowTblControl();
63 
64  virtual void PageCreated(const SfxAllItemSet& aSet) override;
65 protected:
66  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
67 
68 private:
69  // DDListBox for Writer -------------------------------
70 
72  sal_uInt16 nHtmlMode;
74  bool bIsGraphicValid : 1;
75  bool bHighlighting : 1;
76  bool bCharBackColor : 1;
77  bool m_bColorSelected : 1;
79  OUString aBgdGraphicPath;
81 
82  std::unique_ptr<Idle> m_pLoadIdle;
84 
85  std::unique_ptr<SvxOpenGraphicDialog> pImportDlg;
86 
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;
95 
96  std::unique_ptr<SvxBrushItem> pHighlighting;
97 
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;
102 
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;
109 
110  std::unique_ptr<weld::Label> m_xBackGroundColorLabelFT;
111  std::unique_ptr<weld::Widget> m_xBackGroundColorFrame;
112 
113  std::unique_ptr<weld::CheckButton> m_xBtnPreview;
114 
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;
122 
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;
127 
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;
132 
134  void ShowColorUI_Impl();
135  void HideColorUI_Impl();
136  void ShowBitmapUI_Impl();
137  void HideBitmapUI_Impl();
138  bool LoadLinkedGraphic_Impl();
139  void RaiseLoadError_Impl();
142  void FillControls_Impl(const SvxBrushItem& rBgdAttr,
143  const OUString& rUserData);
144 
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);
152 };
153 
155 {
156  std::unique_ptr<weld::ComboBox> m_xTblLBox;
157  bool bHighlighting : 1;
158  bool bCharBackColor : 1;
160  std::unique_ptr<SfxItemSet> m_pResetSet;
161 
162  sal_Int32 m_nActPos = -1;
163 
164  DECL_LINK(TblDestinationHdl_Impl, weld::ComboBox&, void);
165 public:
166  SvxBkgTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs);
167  virtual ~SvxBkgTabPage() override;
168 
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;
175 };
176 
177 #endif // INCLUDED_CUI_SOURCE_INC_BACKGRND_HXX
178 
179 
180 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: backgrnd.cxx:1403
std::unique_ptr< weld::ComboBox > m_xTblLBox
Definition: backgrnd.hxx:156
sal_Int32 m_nActPos
Definition: backgrnd.hxx:162
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: backgrnd.cxx:333
std::unique_ptr< weld::Label > m_xBackGroundColorLabelFT
Definition: backgrnd.hxx:110
bool bCharBackColor
Definition: backgrnd.hxx:158
OUString aBgdGraphicPath
Definition: backgrnd.hxx:79
const SfxItemSet * pSet
void FillColorValueSets_Impl()
Definition: backgrnd.cxx:795
std::unique_ptr< SvxBrushItem > m_pRowBrush
Definition: backgrnd.hxx:89
std::unique_ptr< weld::Widget > m_xBackGroundColorFrame
Definition: backgrnd.hxx:111
std::unique_ptr< weld::CustomWeld > m_xBackgroundColorSetWin
Definition: backgrnd.hxx:129
std::unique_ptr< weld::Widget > m_xFileFrame
Definition: backgrnd.hxx:117
std::unique_ptr< ColorValueSet > m_xBackgroundColorSet
Definition: backgrnd.hxx:99
std::unique_ptr< weld::Label > m_xFtUnlinked
Definition: backgrnd.hxx:120
bool LoadLinkedGraphic_Impl()
Definition: backgrnd.cxx:786
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: backgrnd.cxx:493
sal_uInt16 nHtmlMode
Definition: backgrnd.hxx:72
std::unique_ptr< weld::Widget > m_xTypeFrame
Definition: backgrnd.hxx:123
bool bHighlighting
Definition: backgrnd.hxx:157
void RaiseLoadError_Impl()
Definition: backgrnd.cxx:773
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: backgrnd.cxx:1536
std::unique_ptr< Idle > m_pLoadIdle
Definition: backgrnd.hxx:82
std::unique_ptr< weld::ComboBox > m_xLbSelect
Definition: backgrnd.hxx:106
std::unique_ptr< weld::CheckButton > m_xBtnPreview
Definition: backgrnd.hxx:113
SvxGraphicPosition GetGraphicPosition_Impl() const
Definition: backgrnd.cxx:908
std::unique_ptr< weld::RadioButton > m_xBtnTile
Definition: backgrnd.hxx:126
sal_uInt16 m_nTableWhich
Definition: backgrnd.hxx:93
SvxBkgTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rInAttrs)
Definition: backgrnd.cxx:1360
std::unique_ptr< weld::Widget > m_xAsGrid
Definition: backgrnd.hxx:104
bool m_bIsImportDlgInExecute
Definition: backgrnd.hxx:83
RectPoint
void FillControls_Impl(const SvxBrushItem &rBgdAttr, const OUString &rUserData)
Definition: backgrnd.cxx:1209
std::unique_ptr< weld::Button > m_xBtnBrowse
Definition: backgrnd.hxx:118
virtual void FillUserData() override
When destroying a SfxTabPage this virtual method is called, so that the TabPage can save internal inf...
Definition: backgrnd.cxx:488
virtual bool FillItemSet(SfxItemSet *) override
Definition: backgrnd.cxx:1432
SvxBackgroundTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rCoreSet)
Definition: backgrnd.cxx:257
std::unique_ptr< weld::RadioButton > m_xBtnArea
Definition: backgrnd.hxx:125
static const sal_uInt16 * GetRanges()
Definition: backgrnd.hxx:52
SfxItemSet maSet
Definition: backgrnd.hxx:159
static const sal_uInt16 pPageRanges[]
Definition: backgrnd.hxx:45
SvxGraphicPosition
sal_Int32 m_nActPos
Definition: backgrnd.hxx:94
std::unique_ptr< weld::Widget > m_xBitmapContainer
Definition: backgrnd.hxx:116
std::unique_ptr< SvxOpenGraphicDialog > pImportDlg
Items for Sw-Table must be corrected.
Definition: backgrnd.hxx:85
class SvxBackgroundTabPage -----------------------------------------—
Definition: backgrnd.hxx:43
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
Definition: backgrnd.cxx:1529
void ShowSelector()
Shift-ListBox activation.
Definition: backgrnd.cxx:743
std::unique_ptr< SvxBrushItem > pHighlighting
Definition: backgrnd.hxx:96
std::unique_ptr< BackgroundPreviewImpl > m_xPreview1
Definition: backgrnd.hxx:100
std::unique_ptr< weld::Label > m_xSelectTxt
Definition: backgrnd.hxx:105
std::unique_ptr< weld::ComboBox > m_xTblLBox
Definition: backgrnd.hxx:108
Preview window for brush or bitmap.
Definition: backgrnd.cxx:107
std::unique_ptr< weld::Label > m_xTblDesc
Definition: backgrnd.hxx:107
std::unique_ptr< weld::Label > m_xFtFile
Definition: backgrnd.hxx:121
DECL_LINK(LoadIdleHdl_Impl, Timer *, void)
std::unique_ptr< SvxBrushItem > m_pTableBrush
Definition: backgrnd.hxx:90
OUString aBgdGraphicFilter
Definition: backgrnd.hxx:80
DECL_LINK(TblDestinationHdl_Impl, weld::ComboBox &, void)
virtual void ActivatePage(const SfxItemSet &) override
Definition: backgrnd.cxx:1398
std::unique_ptr< SvxBrushItem > m_pCellBrush
Definition: backgrnd.hxx:88
virtual ~SvxBkgTabPage() override
Definition: backgrnd.cxx:1393
virtual void Reset(const SfxItemSet *) override
Definition: backgrnd.cxx:1414
virtual void Reset(const SfxItemSet *rSet) override
Definition: backgrnd.cxx:338
std::unique_ptr< BackgroundPreviewImpl > m_xPreview2
Definition: backgrnd.hxx:101
std::unique_ptr< weld::Label > m_xFindGraphicsFt
Definition: backgrnd.hxx:103
std::unique_ptr< weld::CustomWeld > m_xPreviewWin1
Definition: backgrnd.hxx:130
void ShowBitmapUI_Impl()
Hide the controls for color settings and show controls for editing the bitmap instead.
Definition: backgrnd.cxx:839
void SetGraphicPosition_Impl(SvxGraphicPosition ePos)
Definition: backgrnd.cxx:864
DeactivateRC
std::unique_ptr< weld::RadioButton > m_xBtnPosition
Definition: backgrnd.hxx:124
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
virtual method; is called on deactivation
Definition: backgrnd.cxx:727
std::unique_ptr< weld::CustomWeld > m_xPreviewWin2
Definition: backgrnd.hxx:131
std::unique_ptr< SfxItemSet > m_pResetSet
Definition: backgrnd.hxx:160
sal_uInt16 m_nRowWhich
Definition: backgrnd.hxx:92
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: backgrnd.cxx:1317
std::unique_ptr< weld::CustomWeld > m_xWndPositionWin
Definition: backgrnd.hxx:128
virtual ~SvxBackgroundTabPage() override
Definition: backgrnd.cxx:316
std::unique_ptr< weld::CheckButton > m_xBtnLink
Definition: backgrnd.hxx:119
virtual void PointChanged(weld::DrawingArea *pWindow, RectPoint eRP) override
Definition: backgrnd.cxx:738
void ShowTblControl()
for the Writer (cells/rows/tables)
Definition: backgrnd.cxx:1109
std::unique_ptr< SvxRectCtl > m_xWndPosition
Definition: backgrnd.hxx:98
void ShowColorUI_Impl()
Hide the controls for editing the bitmap and show the controls for color settings instead...
Definition: backgrnd.cxx:822
sal_uInt16 m_nCellWhich
Definition: backgrnd.hxx:91