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