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