LibreOffice Module cui (master)  1
tppattern.cxx
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 
20 #include <memory>
21 #include <tools/urlobj.hxx>
22 #include <sfx2/dialoghelper.hxx>
23 #include <svx/colorbox.hxx>
24 #include <svx/dialmgr.hxx>
25 #include <vcl/BitmapTools.hxx>
26 #include <vcl/svapp.hxx>
27 #include <vcl/weld.hxx>
28 #include <svx/strings.hrc>
29 
30 #include <strings.hrc>
31 #include <svx/xfillit0.hxx>
32 #include <svx/xbtmpit.hxx>
33 #include <svx/xtable.hxx>
34 #include <svx/xflbmtit.hxx>
35 #include <cuitabarea.hxx>
36 #include <svx/svxdlg.hxx>
37 #include <dialmgr.hxx>
38 #include <sal/log.hxx>
39 
40 using namespace com::sun::star;
41 
42 /*************************************************************************
43 |* Preview control for the display of bitmaps
44 \************************************************************************/
45 
47 {
48 private:
49  Color aPixelColor, aBackgroundColor;
50  std::array<sal_uInt8,64> const * pBmpArray;
51 
52 public:
53  // Constructor: BitmapCtl for SvxPixelCtl
55  : pBmpArray(nullptr)
56  {
57  }
58 
59  // BitmapCtl: Returns the Bitmap
61  {
62  if (!pBmpArray)
63  return BitmapEx();
64  return vcl::bitmap::createHistorical8x8FromArray(*pBmpArray, aPixelColor, aBackgroundColor);
65  }
66 
67  void SetBmpArray( std::array<sal_uInt8,64> const & pPixel ) { pBmpArray = &pPixel; }
68  void SetPixelColor( Color aColor ) { aPixelColor = aColor; }
69  void SetBackgroundColor( Color aColor ) { aBackgroundColor = aColor; }
70 };
71 
73  : SvxTabPage(pPage, pController, "cui/ui/patterntabpage.ui", "PatternTabPage", rInAttrs)
74  , m_rOutAttrs(rInAttrs)
75  , m_pnPatternListState(nullptr)
76  , m_pnColorListState(nullptr)
77  , m_aXFillAttr(rInAttrs.GetPool())
78  , m_rXFSet(m_aXFillAttr.GetItemSet())
79  , m_xCtlPixel(new SvxPixelCtl(this))
80  , m_xLbColor(new ColorListBox(m_xBuilder->weld_menu_button("LB_COLOR"),
81  [this]{ return GetDialogController()->getDialog(); }))
82  , m_xLbBackgroundColor(new ColorListBox(m_xBuilder->weld_menu_button("LB_BACKGROUND_COLOR"),
83  [this]{ return GetDialogController()->getDialog(); }))
84  , m_xPatternLB(new SvxPresetListBox(m_xBuilder->weld_scrolled_window("patternpresetlistwin", true)))
85  , m_xBtnAdd(m_xBuilder->weld_button("BTN_ADD"))
86  , m_xBtnModify(m_xBuilder->weld_button("BTN_MODIFY"))
87  , m_xCtlPixelWin(new weld::CustomWeld(*m_xBuilder, "CTL_PIXEL", *m_xCtlPixel))
88  , m_xCtlPreview(new weld::CustomWeld(*m_xBuilder, "CTL_PREVIEW", m_aCtlPreview))
89  , m_xPatternLBWin(new weld::CustomWeld(*m_xBuilder, "patternpresetlist", *m_xPatternLB))
90 {
91  // size of the bitmap display
92  Size aSize = getDrawPreviewOptimalSize(m_aCtlPreview.GetDrawingArea()->get_ref_device());
93  m_xPatternLB->set_size_request(aSize.Width(), aSize.Height());
94  m_xCtlPreview->set_size_request(aSize.Width(), aSize.Height());
95 
96  m_xBitmapCtl.reset(new SvxBitmapCtl);
97 
98  // this page needs ExchangeSupport
99  SetExchangeSupport();
100 
101  // setting the output device
102  m_rXFSet.Put( XFillStyleItem(drawing::FillStyle_BITMAP) );
103  m_rXFSet.Put( XFillBitmapItem(OUString(), Graphic()) );
104 
105  m_xBtnAdd->connect_clicked( LINK( this, SvxPatternTabPage, ClickAddHdl_Impl ) );
106  m_xBtnModify->connect_clicked( LINK( this, SvxPatternTabPage, ClickModifyHdl_Impl ) );
107 
108  m_xPatternLB->SetSelectHdl( LINK( this, SvxPatternTabPage, ChangePatternHdl_Impl ) );
109  m_xPatternLB->SetRenameHdl( LINK( this, SvxPatternTabPage, ClickRenameHdl_Impl ) );
110  m_xPatternLB->SetDeleteHdl( LINK( this, SvxPatternTabPage, ClickDeleteHdl_Impl ) );
111  m_xLbColor->SetSelectHdl( LINK( this, SvxPatternTabPage, ChangeColorHdl_Impl ) );
112  m_xLbBackgroundColor->SetSelectHdl( LINK( this, SvxPatternTabPage, ChangeColorHdl_Impl ) );
113 
114  m_xPatternLB->SetStyle(WB_FLATVALUESET | WB_NO_DIRECTSELECT | WB_TABSTOP);
115 }
116 
118 {
119  m_xPatternLBWin.reset();
120  m_xCtlPreview.reset();
121  m_xCtlPixelWin.reset();
122  m_xPatternLB.reset();
123  m_xLbBackgroundColor.reset();
124  m_xLbColor.reset();
125  m_xCtlPixel.reset();
126 }
127 
129 {
130  m_xPatternLB->FillPresetListBox( *m_pPatternList );
131 }
132 
134 {
135  if( !m_pColorList.is() )
136  return;
137 
138  // ColorList
139  if( *m_pnColorListState & ChangeType::CHANGED ||
140  *m_pnColorListState & ChangeType::MODIFIED )
141  {
142  SvxAreaTabDialog* pArea = (*m_pnColorListState & ChangeType::CHANGED) ?
143  dynamic_cast<SvxAreaTabDialog*>(GetDialogController()) : nullptr;
144  if (pArea)
145  m_pColorList = pArea->GetNewColorList();
146  }
147 
148  // determining (possibly cutting) the name and
149  // displaying it in the GroupBox
150  OUString aString = CuiResId( RID_SVXSTR_TABLE ) + ": ";
151  INetURLObject aURL( m_pPatternList->GetPath() );
152 
153  aURL.Append( m_pPatternList->GetName() );
154  SAL_WARN_IF( aURL.GetProtocol() == INetProtocol::NotValid, "cui.tabpages", "invalid URL" );
155 
156  if( aURL.getBase().getLength() > 18 )
157  {
158  aString += OUString::Concat(aURL.getBase().subView( 0, 15 )) + "...";
159  }
160  else
161  aString += aURL.getBase();
162 
163  XFillBitmapItem aItem( rSet.Get( XATTR_FILLBITMAP ) );
164 
165  if ( aItem.isPattern() )
166  {
167  sal_Int32 nPos = SearchPatternList( aItem.GetName() );
168  if ( nPos != -1)
169  {
170  sal_uInt16 nId = m_xPatternLB->GetItemId( static_cast<size_t>( nPos ) );
171  m_xPatternLB->SelectItem( nId );
172  }
173  }
174  else
175  m_xPatternLB->SelectItem( m_xPatternLB->GetItemId( static_cast<size_t>( 0 ) ) );
176 }
177 
178 
180 {
181  if( _pSet )
182  FillItemSet( _pSet );
183 
184  return DeactivateRC::LeavePage;
185 }
186 
187 
189 {
190  _rOutAttrs->Put(XFillStyleItem(drawing::FillStyle_BITMAP));
191  size_t nPos = m_xPatternLB->IsNoSelection() ? VALUESET_ITEM_NOTFOUND : m_xPatternLB->GetSelectItemPos();
192  if(VALUESET_ITEM_NOTFOUND != nPos)
193  {
194  const XBitmapEntry* pXBitmapEntry = m_pPatternList->GetBitmap( static_cast<sal_uInt16>(nPos) );
195  const OUString aString( m_xPatternLB->GetItemText( m_xPatternLB->GetSelectedItemId() ) );
196 
197  _rOutAttrs->Put(XFillBitmapItem(aString, pXBitmapEntry->GetGraphicObject()));
198  }
199  else
200  {
201  const BitmapEx aBitmapEx(m_xBitmapCtl->GetBitmapEx());
202 
203  _rOutAttrs->Put(XFillBitmapItem(OUString(), Graphic(aBitmapEx)));
204  }
205  _rOutAttrs->Put(XFillBmpTileItem(true));
206  return true;
207 }
208 
209 
211 {
212  m_xBitmapCtl->SetPixelColor( m_xLbColor->GetSelectEntryColor() );
213  m_xBitmapCtl->SetBackgroundColor( m_xLbBackgroundColor->GetSelectEntryColor() );
214  m_xBitmapCtl->SetBmpArray( m_xCtlPixel->GetBitmapPixelPtr() );
215 
216  // get bitmap and display it
217  const XFillBitmapItem aBmpItem(OUString(), Graphic(m_xBitmapCtl->GetBitmapEx()));
218  if(aBmpItem.isPattern())
219  {
220  m_rXFSet.Put( aBmpItem );
221  m_aCtlPreview.SetAttributes( m_aXFillAttr.GetItemSet() );
222  m_aCtlPreview.Invalidate();
223  }
224 
225  ChangePatternHdl_Impl(m_xPatternLB.get());
226 
227  // determine button state
228  if( m_pPatternList.is() && m_pPatternList->Count() )
229  {
230  m_xBtnAdd->set_sensitive(true);
231  m_xBtnModify->set_sensitive(true);
232  }
233  else
234  {
235  m_xBtnModify->set_sensitive(false);
236  }
237 }
238 
239 std::unique_ptr<SfxTabPage> SvxPatternTabPage::Create( weld::Container* pPage, weld::DialogController* pController,
240  const SfxItemSet* rSet )
241 {
242  return std::make_unique<SvxPatternTabPage>(pPage, pController, *rSet);
243 }
244 
245 IMPL_LINK_NOARG(SvxPatternTabPage, ChangePatternHdl_Impl, ValueSet*, void)
246 {
247  std::unique_ptr<GraphicObject> pGraphicObject;
248  size_t nPos = m_xPatternLB->GetSelectItemPos();
249 
250  if(VALUESET_ITEM_NOTFOUND != nPos)
251  {
252  pGraphicObject.reset(new GraphicObject(m_pPatternList->GetBitmap( static_cast<sal_uInt16>(nPos) )->GetGraphicObject()));
253  }
254  else
255  {
256  const SfxPoolItem* pPoolItem = nullptr;
257 
258  if(SfxItemState::SET == m_rOutAttrs.GetItemState(GetWhich(XATTR_FILLSTYLE), true, &pPoolItem))
259  {
260  const drawing::FillStyle eXFS(static_cast<const XFillStyleItem*>(pPoolItem)->GetValue());
261 
262  if((drawing::FillStyle_BITMAP == eXFS) && (SfxItemState::SET == m_rOutAttrs.GetItemState(GetWhich(XATTR_FILLBITMAP), true, &pPoolItem)))
263  {
264  pGraphicObject.reset(new GraphicObject(static_cast<const XFillBitmapItem*>(pPoolItem)->GetGraphicObject()));
265  }
266  }
267 
268  if(!pGraphicObject)
269  {
270  sal_uInt16 nPosition = m_xPatternLB->GetItemId( 0 );
271  m_xPatternLB->SelectItem( nPosition );
272  if( nPosition != 0 )
273  {
274  pGraphicObject.reset(new GraphicObject(m_pPatternList->GetBitmap(0)->GetGraphicObject()));
275  }
276  }
277  }
278 
279  if(!pGraphicObject)
280  return;
281 
282  Color aBackColor;
283  Color aPixelColor;
284  bool bIs8x8(vcl::bitmap::isHistorical8x8(pGraphicObject->GetGraphic().GetBitmapEx(), aBackColor, aPixelColor));
285 
286  m_xLbColor->SetNoSelection();
287  m_xLbBackgroundColor->SetNoSelection();
288 
289  if(bIs8x8)
290  {
291  m_xCtlPixel->SetPaintable( true );
292  m_xBtnModify->set_sensitive(true);
293  m_xBtnAdd->set_sensitive(true);
294 
295  // setting the pixel control
296 
297  m_xCtlPixel->SetXBitmap(pGraphicObject->GetGraphic().GetBitmapEx());
298 
299  m_xLbColor->SelectEntry( aPixelColor );
300  m_xLbBackgroundColor->SelectEntry( aBackColor );
301 
302  // update m_xBitmapCtl, rXFSet and m_aCtlPreview
303  m_xBitmapCtl->SetPixelColor( aPixelColor );
304  m_xBitmapCtl->SetBackgroundColor( aBackColor );
305  m_rXFSet.ClearItem();
306  m_rXFSet.Put(XFillStyleItem(drawing::FillStyle_BITMAP));
307  m_rXFSet.Put(XFillBitmapItem(OUString(), Graphic(m_xBitmapCtl->GetBitmapEx())));
308  m_aCtlPreview.SetAttributes( m_aXFillAttr.GetItemSet() );
309  m_aCtlPreview.Invalidate();
310  }
311  else
312  {
313  m_xCtlPixel->Reset();
314  m_xCtlPixel->SetPaintable( false );
315  m_xBtnModify->set_sensitive(false);
316  m_xBtnAdd->set_sensitive(false);
317  }
318 
319  m_xCtlPixel->Invalidate();
320 }
321 
323 {
324 
325  OUString aNewName( SvxResId( RID_SVXSTR_PATTERN_UNTITLED ) );
326  OUString aDesc( CuiResId( RID_SVXSTR_DESC_NEW_PATTERN ) );
327  OUString aName;
328 
329  tools::Long nCount = m_pPatternList->Count();
330  tools::Long j = 1;
331  bool bValidPatternName = false;
332 
333  while( !bValidPatternName )
334  {
335  aName = aNewName + " " + OUString::number( j++ );
336  bValidPatternName = (SearchPatternList(aName) == -1);
337  }
338 
341  sal_uInt16 nError(1);
342 
343  while( pDlg->Execute() == RET_OK )
344  {
345  pDlg->GetName( aName );
346 
347  bValidPatternName = (SearchPatternList(aName) == -1);
348 
349  if( bValidPatternName ) {
350  nError = 0;
351  break;
352  }
353 
354  std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
355  std::unique_ptr<weld::MessageDialog> xWarnBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
356  if (xWarnBox->run() != RET_OK)
357  break;
358  }
359 
360  pDlg.disposeAndClear();
361 
362  if( !nError )
363  {
364  std::unique_ptr<XBitmapEntry> pEntry;
365  if( m_xCtlPixel->IsEnabled() )
366  {
367  const BitmapEx aBitmapEx(m_xBitmapCtl->GetBitmapEx());
368 
369  pEntry.reset(new XBitmapEntry(Graphic(aBitmapEx), aName));
370  }
371  else // it must be a not existing imported bitmap
372  {
373  const SfxPoolItem* pPoolItem = nullptr;
374 
375  if(SfxItemState::SET == m_rOutAttrs.GetItemState(XATTR_FILLBITMAP, true, &pPoolItem))
376  {
377  auto pFillBmpItem = dynamic_cast<const XFillBitmapItem*>(pPoolItem);
378  assert(pFillBmpItem);
379  pEntry.reset(new XBitmapEntry(pFillBmpItem->GetGraphicObject(), aName));
380  }
381  else
382  assert(!"SvxPatternTabPage::ClickAddHdl_Impl(), XBitmapEntry* pEntry == nullptr ?");
383  }
384 
385  if( pEntry )
386  {
387  m_pPatternList->Insert(std::move(pEntry), nCount);
388  sal_Int32 nId = m_xPatternLB->GetItemId( nCount - 1 );
389  BitmapEx aBitmap = m_pPatternList->GetBitmapForPreview( nCount, m_xPatternLB->GetIconSize() );
390  m_xPatternLB->InsertItem( nId + 1, Image(aBitmap), aName );
391  m_xPatternLB->SelectItem( nId + 1 );
392  m_xPatternLB->Resize();
393 
394  *m_pnPatternListState |= ChangeType::MODIFIED;
395 
396  ChangePatternHdl_Impl(m_xPatternLB.get());
397  }
398  }
399 
400  // determine button state
401  if( m_pPatternList->Count() )
402  {
403  m_xBtnModify->set_sensitive(true);
404  }
405 }
406 
407 IMPL_LINK_NOARG(SvxPatternTabPage, ClickModifyHdl_Impl, weld::Button&, void)
408 {
409  sal_uInt16 nId = m_xPatternLB->GetSelectedItemId();
410  size_t nPos = m_xPatternLB->GetSelectItemPos();
411 
412  if ( nPos == VALUESET_ITEM_NOTFOUND )
413  return;
414 
415  OUString aName( m_pPatternList->GetBitmap( static_cast<sal_uInt16>(nPos) )->GetName() );
416 
417  const BitmapEx aBitmapEx(m_xBitmapCtl->GetBitmapEx());
418 
419  // #i123497# Need to replace the existing entry with a new one (old returned needs to be deleted)
420  m_pPatternList->Replace(std::make_unique<XBitmapEntry>(Graphic(aBitmapEx), aName), nPos);
421 
422  BitmapEx aBitmap = m_pPatternList->GetBitmapForPreview( static_cast<sal_uInt16>( nPos ), m_xPatternLB->GetIconSize() );
423  m_xPatternLB->RemoveItem(nId);
424  m_xPatternLB->InsertItem( nId, Image(aBitmap), aName, static_cast<sal_uInt16>(nPos) );
425  m_xPatternLB->SelectItem( nId );
426 
427  *m_pnPatternListState |= ChangeType::MODIFIED;
428 }
429 
430 
432 {
433  size_t nPos = m_xPatternLB->GetSelectItemPos();
434  sal_Int32 nId = m_xPatternLB->GetSelectedItemId();
435 
436  if ( nPos == VALUESET_ITEM_NOTFOUND )
437  return;
438 
439  OUString aDesc(CuiResId(RID_SVXSTR_DESC_NEW_PATTERN));
440  OUString aName(m_pPatternList->GetBitmap(nPos)->GetName());
441 
443  ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetFrameWeld(), aName, aDesc));
444 
445  bool bLoop = true;
446 
447  while( bLoop && pDlg->Execute() == RET_OK )
448  {
449  pDlg->GetName( aName );
450  sal_Int32 nPatternPos = SearchPatternList(aName);
451  bool bValidPatternName = (nPatternPos == static_cast<sal_Int32>(nPos) ) || (nPatternPos == -1);
452 
453  if( bValidPatternName )
454  {
455  bLoop = false;
456 
457  m_pPatternList->GetBitmap(nPos)->SetName(aName);
458 
459  m_xPatternLB->SetItemText( nId, aName );
460  m_xPatternLB->SelectItem( nId );
461 
462  *m_pnPatternListState |= ChangeType::MODIFIED;
463  }
464  else
465  {
466  std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
467  std::unique_ptr<weld::MessageDialog> xWarnBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
468  xWarnBox->run();
469  }
470  }
471 }
472 
474 {
475  sal_uInt16 nId = m_xPatternLB->GetSelectedItemId();
476  size_t nPos = m_xPatternLB->GetSelectItemPos();
477 
478  if( nPos != VALUESET_ITEM_NOTFOUND )
479  {
480  std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querydeletebitmapdialog.ui"));
481  std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("AskDelBitmapDialog"));
482  if (xQueryBox->run() == RET_YES)
483  {
484  m_pPatternList->Remove(nPos);
485  m_xPatternLB->RemoveItem( nId );
486  nId = m_xPatternLB->GetItemId(0);
487  m_xPatternLB->SelectItem( nId );
488  m_xPatternLB->Resize();
489 
490  m_aCtlPreview.Invalidate();
491  m_xCtlPixel->Invalidate();
492 
493  ChangePatternHdl_Impl(m_xPatternLB.get());
494 
495  *m_pnPatternListState |= ChangeType::MODIFIED;
496  }
497  }
498  // determine button state
499  if( !m_pPatternList->Count() )
500  {
501  m_xBtnModify->set_sensitive(false);
502  }
503 }
504 
505 IMPL_LINK_NOARG(SvxPatternTabPage, ChangeColorHdl_Impl, ColorListBox&, void)
506 {
507  ChangeColor_Impl();
508  m_xPatternLB->SetNoSelection();
509 }
510 
512 {
513  m_xCtlPixel->SetPixelColor( m_xLbColor->GetSelectEntryColor() );
514  m_xCtlPixel->SetBackgroundColor( m_xLbBackgroundColor->GetSelectEntryColor() );
515  m_xCtlPixel->Invalidate();
516 
517  m_xBitmapCtl->SetPixelColor( m_xLbColor->GetSelectEntryColor() );
518  m_xBitmapCtl->SetBackgroundColor( m_xLbBackgroundColor->GetSelectEntryColor() );
519 
520  // get bitmap and display it
521  m_rXFSet.Put(XFillBitmapItem(OUString(), Graphic(m_xBitmapCtl->GetBitmapEx())));
522  m_aCtlPreview.SetAttributes( m_aXFillAttr.GetItemSet() );
523  m_aCtlPreview.Invalidate();
524 }
525 
527 {
528  if (pDrawingArea == m_xCtlPixel->GetDrawingArea())
529  {
530  m_xBitmapCtl->SetBmpArray(m_xCtlPixel->GetBitmapPixelPtr());
531 
532  // get bitmap and display it
533  m_rXFSet.Put(XFillBitmapItem(OUString(), Graphic(m_xBitmapCtl->GetBitmapEx())));
534  m_aCtlPreview.SetAttributes( m_aXFillAttr.GetItemSet() );
535  m_aCtlPreview.Invalidate();
536  }
537 
538  m_xPatternLB->SetNoSelection();
539 }
540 
541 sal_Int32 SvxPatternTabPage::SearchPatternList(std::u16string_view rPatternName)
542 {
543  tools::Long nCount = m_pPatternList->Count();
544  bool bValidPatternName = true;
545  sal_Int32 nPos = -1;
546 
547  for(tools::Long i = 0;i < nCount && bValidPatternName;i++)
548  {
549  if(rPatternName == m_pPatternList->GetBitmap( i )->GetName())
550  {
551  nPos = i;
552  bValidPatternName = false;
553  }
554  }
555  return nPos;
556 }
557 
558 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SfxItemSet & m_rXFSet
Definition: cuitabarea.hxx:575
URL aURL
Size getDrawPreviewOptimalSize(const OutputDevice &rReference)
const XColorListRef & GetNewColorList() const
Definition: cuitabarea.hxx:122
void Replace(const Color &rSearchColor, const Color &rReplaceColor)
std::string GetValue
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: tppattern.cxx:179
#define VALUESET_ITEM_NOTFOUND
std::unique_ptr< SvxPresetListBox > m_xPatternLB
Definition: cuitabarea.hxx:581
void SetPixelColor(Color aColor)
Definition: tppattern.cxx:68
static SvxAbstractDialogFactory * Create()
long Long
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)
void ChangeColor_Impl()
Definition: tppattern.cxx:511
static weld::Builder * CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false)
sal_Int16 nId
OUString CuiResId(std::string_view aKey)
Definition: cuiresmgr.cxx:23
constexpr tools::Long Width() const
virtual VclPtr< AbstractSvxNameDialog > CreateSvxNameDialog(weld::Window *pParent, const OUString &rName, const OUString &rDesc)=0
virtual bool FillItemSet(SfxItemSet *) override
Definition: tppattern.cxx:188
RET_YES
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: tppattern.cxx:133
int nCount
std::array< sal_uInt8, 64 > const * pBmpArray
Definition: tppattern.cxx:50
std::unique_ptr< weld::Button > m_xBtnModify
Definition: cuitabarea.hxx:583
const GraphicObject & GetGraphicObject() const
virtual void PointChanged(weld::DrawingArea *, RectPoint eRP) override
Definition: tppattern.cxx:526
RectPoint
OUString SvxResId(std::string_view aId)
std::unique_ptr< weld::Button > m_xBtnAdd
Definition: cuitabarea.hxx:582
int i
std::unique_ptr< SvxPixelCtl > m_xCtlPixel
Definition: cuitabarea.hxx:578
constexpr TypedWhichId< XFillBitmapItem > XATTR_FILLBITMAP(XATTR_FILL_FIRST+4)
void SetBmpArray(std::array< sal_uInt8, 64 > const &pPixel)
Definition: tppattern.cxx:67
SvxXRectPreview m_aCtlPreview
Definition: cuitabarea.hxx:577
const SfxItemSet * GetItemSet(const SfxPoolItem &rAttr)
IMPL_LINK_NOARG(SvxPatternTabPage, ChangePatternHdl_Impl, ValueSet *, void)
Definition: tppattern.cxx:245
bool isHistorical8x8(const BitmapEx &rBitmapEx, Color &o_rBack, Color &o_rFront)
void SetAttributes(const SfxItemSet &rItemSet)
ChangeType * m_pnColorListState
Definition: cuitabarea.hxx:572
std::unique_ptr< ColorListBox > m_xLbBackgroundColor
Definition: cuitabarea.hxx:580
BitmapEx GetBitmapEx() const
Definition: tppattern.cxx:60
bool isPattern() const
BitmapEx createHistorical8x8FromArray(std::array< sal_uInt8, 64 > const &pArray, Color aColorPix, Color aColorBack)
Color aPixelColor
Definition: tppattern.cxx:49
std::unique_ptr< ColorListBox > m_xLbColor
Definition: cuitabarea.hxx:579
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
virtual void Reset(const SfxItemSet *) override
Definition: tppattern.cxx:210
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
virtual ~SvxPatternTabPage() override
Definition: tppattern.cxx:117
#define SAL_WARN_IF(condition, area, stream)
constexpr tools::Long Height() const
#define GetWhich(nSlot)
std::unique_ptr< weld::CustomWeld > m_xPatternLBWin
Definition: cuitabarea.hxx:586
OUString aName
SvxPatternTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rInAttrs)
Definition: tppattern.cxx:72
RET_OK
std::unique_ptr< SvxBitmapCtl > m_xBitmapCtl
Definition: cuitabarea.hxx:587
std::unique_ptr< weld::CustomWeld > m_xCtlPreview
Definition: cuitabarea.hxx:585
sal_Int32 SearchPatternList(std::u16string_view rPatternName)
Definition: tppattern.cxx:541
DeactivateRC
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
Definition: tppattern.cxx:239
XColorListRef m_pColorList
Definition: cuitabarea.hxx:568
XPatternListRef m_pPatternList
Definition: cuitabarea.hxx:569
std::unique_ptr< weld::CustomWeld > m_xCtlPixelWin
Definition: cuitabarea.hxx:584
XFillAttrSetItem m_aXFillAttr
Definition: cuitabarea.hxx:574
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
void SetBackgroundColor(Color aColor)
Definition: tppattern.cxx:69
sal_uInt16 nPos