LibreOffice Module svx (master)  1
linectrl.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 <string>
21 
22 #include <vcl/settings.hxx>
23 #include <vcl/svapp.hxx>
24 #include <vcl/toolbox.hxx>
25 #include <sfx2/app.hxx>
26 #include <sfx2/dispatch.hxx>
27 #include <sfx2/objsh.hxx>
28 
29 #include <svtools/toolbarmenu.hxx>
31 #include <svtools/valueset.hxx>
32 
33 #include <svx/strings.hrc>
34 #include <svx/svxids.hrc>
35 #include <helpids.h>
36 
37 #include <svx/drawitem.hxx>
38 #include <svx/xlineit0.hxx>
39 #include <svx/xlnwtit.hxx>
40 #include <svx/xlndsit.hxx>
41 #include <svx/xlnstit.hxx>
42 #include <svx/xlnedit.hxx>
43 #include <svx/xtable.hxx>
44 #include <svx/linectrl.hxx>
45 #include <svx/itemwin.hxx>
46 #include <svx/dialmgr.hxx>
47 #include <svx/tbxcolorupdate.hxx>
48 #include <svx/unoapi.hxx>
49 #include <memory>
50 
51 using namespace ::com::sun::star::uno;
52 using namespace ::com::sun::star::beans;
53 using namespace ::com::sun::star::util;
54 using namespace ::com::sun::star::frame;
55 using namespace ::com::sun::star::lang;
56 using namespace ::com::sun::star;
57 
58 // For End Line Controller
59 #define MAX_LINES 12
60 
61 SvxLineStyleToolBoxControl::SvxLineStyleToolBoxControl( const css::uno::Reference<css::uno::XComponentContext>& rContext )
62  : svt::PopupWindowController( rContext, nullptr, OUString() )
63 {
64  addStatusListener(".uno:LineDash");
65 }
66 
68 {
69 }
70 
71 void SAL_CALL SvxLineStyleToolBoxControl::statusChanged( const frame::FeatureStateEvent& rEvent )
72 {
73  ToolBox* pToolBox = nullptr;
74  sal_uInt16 nId = 0;
75  if (!getToolboxId(nId, &pToolBox) && !m_pToolbar)
76  return;
77 
78  OString sId(m_aCommandURL.toUtf8());
79 
80  if ( rEvent.FeatureURL.Complete == m_aCommandURL )
81  {
82  if (m_pToolbar)
83  m_pToolbar->set_item_sensitive(sId, rEvent.IsEnabled);
84  else
85  pToolBox->EnableItem( nId, rEvent.IsEnabled );
86  }
87 
88  m_xBtnUpdater->Update(rEvent);
89 
91  if (pSh)
92  {
93  const SvxDashListItem* pItem = pSh->GetItem( SID_DASH_LIST );
94  if (pItem)
95  {
96  XDashListRef xList = pItem->GetDashList();
97  int nIndex = m_xBtnUpdater->GetStyleIndex();
98  switch (nIndex)
99  {
100  case -1:
101  case 0:
102  {
103  BitmapEx aEmpty(xList->GetBitmapForUISolidLine());
104  aEmpty.Erase(Application::GetSettings().GetStyleSettings().GetFieldColor());
105  if (m_pToolbar)
106  {
107  Graphic aGraf(aEmpty);
108  m_pToolbar->set_item_image(sId, aGraf.GetXGraphic());
109  }
110  else
111  pToolBox->SetItemImage(nId, Image(aEmpty));
112  break;
113  }
114  case 1:
115  if (m_pToolbar)
116  {
117  Graphic aGraf(xList->GetBitmapForUISolidLine());
118  m_pToolbar->set_item_image(sId, aGraf.GetXGraphic());
119  }
120  else
121  pToolBox->SetItemImage(nId, Image(xList->GetBitmapForUISolidLine()));
122  break;
123  default:
124  if (m_pToolbar)
125  {
126  Graphic aGraf(xList->GetUiBitmap(nIndex - 2));
127  m_pToolbar->set_item_image(sId, aGraf.GetXGraphic());
128  }
129  else
130  pToolBox->SetItemImage(nId, Image(xList->GetUiBitmap(nIndex - 2)));
131  break;
132  }
133  }
134  }
135 }
136 
137 void SAL_CALL SvxLineStyleToolBoxControl::execute(sal_Int16 /*KeyModifier*/)
138 {
139  if (m_pToolbar)
140  {
141  // Toggle the popup also when toolbutton is activated
142  const OString aId(m_aCommandURL.toUtf8());
143  m_pToolbar->set_menu_item_active(aId, !m_pToolbar->get_menu_item_active(aId));
144  }
145  else
146  {
147  // Open the popup also when Enter key is pressed.
149  }
150 }
151 
152 void SvxLineStyleToolBoxControl::initialize( const css::uno::Sequence<css::uno::Any>& rArguments )
153 {
154  svt::PopupWindowController::initialize( rArguments );
155 
156  if (m_pToolbar)
157  {
158  mxPopoverContainer.reset(new ToolbarPopupContainer(m_pToolbar));
159  m_pToolbar->set_item_popover(m_aCommandURL.toUtf8(), mxPopoverContainer->getTopLevel());
160  }
161 
162  ToolBox* pToolBox = nullptr;
163  sal_uInt16 nId = 0;
164  if ( getToolboxId( nId, &pToolBox ) )
165  {
166  pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) | ToolBoxItemBits::DROPDOWNONLY );
167  }
168 
170 }
171 
173 {
174  m_aLineStyleSelectFunction = rLineStyleSelectFunction;
175 }
176 
177 void SvxLineStyleToolBoxControl::dispatchLineStyleCommand(const OUString& rCommand, const Sequence<PropertyValue>& rArgs)
178 {
180  return;
181 
182  dispatchCommand(rCommand, rArgs);
183 }
184 
185 std::unique_ptr<WeldToolbarPopup> SvxLineStyleToolBoxControl::weldPopupWindow()
186 {
187  return std::make_unique<SvxLineBox>(this, m_pToolbar, m_xBtnUpdater->GetStyleIndex());
188 }
189 
191 {
192  mxInterimPopover = VclPtr<InterimToolbarPopup>::Create(getFrameInterface(), pParent,
193  std::make_unique<SvxLineBox>(this, pParent->GetFrameWeld(), m_xBtnUpdater->GetStyleIndex()));
194 
195  mxInterimPopover->Show();
196 
197  return mxInterimPopover;
198 }
199 
201 {
202  return "com.sun.star.comp.svx.LineStyleToolBoxControl";
203 }
204 
206 {
207  return { "com.sun.star.frame.ToolbarController" };
208 }
209 
210 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
212  css::uno::XComponentContext* rContext,
213  css::uno::Sequence<css::uno::Any> const & )
214 {
215  return cppu::acquire( new SvxLineStyleToolBoxControl( rContext ) );
216 }
217 
218 namespace {
219 
220 class SvxLineEndToolBoxControl final : public svt::PopupWindowController
221 {
222 public:
223  explicit SvxLineEndToolBoxControl( const css::uno::Reference<css::uno::XComponentContext>& rContext );
224 
225  // XInitialization
226  virtual void SAL_CALL initialize( const css::uno::Sequence<css::uno::Any>& rArguments ) override;
227 
228  // XServiceInfo
229  virtual OUString SAL_CALL getImplementationName() override;
230  virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
231 
232  virtual void SAL_CALL execute(sal_Int16 nKeyModifier) override;
233 
234 private:
235  virtual std::unique_ptr<WeldToolbarPopup> weldPopupWindow() override;
236  virtual VclPtr<vcl::Window> createVclPopupWindow( vcl::Window* pParent ) override;
237 };
238 
239 class SvxLineEndWindow final : public WeldToolbarPopup
240 {
241 private:
242  XLineEndListRef mpLineEndList;
244  std::unique_ptr<SvtValueSet> mxLineEndSet;
245  std::unique_ptr<weld::CustomWeld> mxLineEndSetWin;
246  sal_uInt16 mnLines;
247  Size maBmpSize;
248 
249  DECL_LINK( SelectHdl, SvtValueSet*, void );
250  void FillValueSet();
251  void SetSize();
252 
253  virtual void GrabFocus() override
254  {
255  mxLineEndSet->GrabFocus();
256  }
257 
258 public:
259  SvxLineEndWindow(SvxLineEndToolBoxControl* pControl, weld::Widget* pParent);
260  virtual void statusChanged( const css::frame::FeatureStateEvent& rEvent ) override;
261 };
262 
263 }
264 
265 static constexpr sal_uInt16 gnCols = 2;
266 
267 SvxLineEndWindow::SvxLineEndWindow(SvxLineEndToolBoxControl* pControl, weld::Widget* pParent)
268  : WeldToolbarPopup(pControl->getFrameInterface(), pParent, "svx/ui/floatinglineend.ui", "FloatingLineEnd")
269  , mxControl(pControl)
270  , mxLineEndSet(new SvtValueSet(m_xBuilder->weld_scrolled_window("valuesetwin")))
271  , mxLineEndSetWin(new weld::CustomWeld(*m_xBuilder, "valueset", *mxLineEndSet))
272  , mnLines(12)
273 {
274  mxLineEndSet->SetStyle(mxLineEndSet->GetStyle() | WB_ITEMBORDER | WB_3DLOOK | WB_NO_DIRECTSELECT);
275  mxLineEndSet->SetHelpId(HID_POPUP_LINEEND_CTRL);
276  m_xTopLevel->set_help_id(HID_POPUP_LINEEND);
277 
279  if ( pDocSh )
280  {
281  const SfxPoolItem* pItem = pDocSh->GetItem( SID_LINEEND_LIST );
282  if( pItem )
283  mpLineEndList = static_cast<const SvxLineEndListItem*>( pItem )->GetLineEndList();
284  }
285  DBG_ASSERT( mpLineEndList.is(), "LineEndList not found" );
286 
287  mxLineEndSet->SetSelectHdl( LINK( this, SvxLineEndWindow, SelectHdl ) );
288  mxLineEndSet->SetColCount( gnCols );
289 
290  // ValueSet fill with entries of LineEndList
291  FillValueSet();
292 
293  AddStatusListener( ".uno:LineEndListState");
294 }
295 
296 IMPL_LINK_NOARG(SvxLineEndWindow, SelectHdl, SvtValueSet*, void)
297 {
298  std::unique_ptr<XLineEndItem> pLineEndItem;
299  std::unique_ptr<XLineStartItem> pLineStartItem;
300  sal_uInt16 nId = mxLineEndSet->GetSelectedItemId();
301 
302  if( nId == 1 )
303  {
304  pLineStartItem.reset(new XLineStartItem());
305  }
306  else if( nId == 2 )
307  {
308  pLineEndItem.reset(new XLineEndItem());
309  }
310  else if( nId % 2 ) // beginning of line
311  {
312  const XLineEndEntry* pEntry = mpLineEndList->GetLineEnd( (nId - 1) / 2 - 1 );
313  pLineStartItem.reset(new XLineStartItem(pEntry->GetName(), pEntry->GetLineEnd()));
314  }
315  else // end of line
316  {
317  const XLineEndEntry* pEntry = mpLineEndList->GetLineEnd( nId / 2 - 2 );
318  pLineEndItem.reset(new XLineEndItem(pEntry->GetName(), pEntry->GetLineEnd()));
319  }
320 
321  Sequence< PropertyValue > aArgs( 1 );
322  Any a;
323 
324  if ( pLineStartItem )
325  {
326  aArgs[0].Name = "LineStart";
327  pLineStartItem->QueryValue( a );
328  aArgs[0].Value = a;
329  }
330  else
331  {
332  aArgs[0].Name = "LineEnd";
333  pLineEndItem->QueryValue( a );
334  aArgs[0].Value = a;
335  }
336 
337  /* #i33380# DR 2004-09-03 Moved the following line above the Dispatch() call.
338  This instance may be deleted in the meantime (i.e. when a dialog is opened
339  while in Dispatch()), accessing members will crash in this case. */
340  mxLineEndSet->SetNoSelection();
341 
342  mxControl->dispatchCommand(mxControl->getCommandURL(), aArgs);
343 
344  mxControl->EndPopupMode();
345 }
346 
347 void SvxLineEndWindow::FillValueSet()
348 {
349  if( !mpLineEndList.is() )
350  return;
351 
353 
354  long nCount = mpLineEndList->Count();
355 
356  // First entry: no line end.
357  // An entry is temporarily added to get the UI bitmap
358  basegfx::B2DPolyPolygon aNothing;
359  mpLineEndList->Insert(std::make_unique<XLineEndEntry>(aNothing, SvxResId(RID_SVXSTR_NONE)));
360  const XLineEndEntry* pEntry = mpLineEndList->GetLineEnd(nCount);
361  BitmapEx aBmp = mpLineEndList->GetUiBitmap( nCount );
362  OSL_ENSURE( !aBmp.IsEmpty(), "UI bitmap was not created" );
363 
364  maBmpSize = aBmp.GetSizePixel();
365  pVD->SetOutputSizePixel( maBmpSize, false );
366  maBmpSize.setWidth( maBmpSize.Width() / 2 );
367  Point aPt0( 0, 0 );
368  Point aPt1( maBmpSize.Width(), 0 );
369 
370  pVD->DrawBitmapEx( Point(), aBmp );
371  mxLineEndSet->InsertItem(1, Image(pVD->GetBitmapEx(aPt0, maBmpSize)), pEntry->GetName());
372  mxLineEndSet->InsertItem(2, Image(pVD->GetBitmapEx(aPt1, maBmpSize)), pEntry->GetName());
373 
374  mpLineEndList->Remove(nCount);
375 
376  for( long i = 0; i < nCount; i++ )
377  {
378  pEntry = mpLineEndList->GetLineEnd( i );
379  DBG_ASSERT( pEntry, "Could not access LineEndEntry" );
380  aBmp = mpLineEndList->GetUiBitmap( i );
381  OSL_ENSURE( !aBmp.IsEmpty(), "UI bitmap was not created" );
382 
383  pVD->DrawBitmapEx( aPt0, aBmp );
384  mxLineEndSet->InsertItem(static_cast<sal_uInt16>((i+1)*2L+1),
385  Image(pVD->GetBitmapEx(aPt0, maBmpSize)), pEntry->GetName());
386  mxLineEndSet->InsertItem(static_cast<sal_uInt16>((i+2)*2L),
387  Image(pVD->GetBitmapEx(aPt1, maBmpSize)), pEntry->GetName());
388  }
389  mnLines = std::min( static_cast<sal_uInt16>(nCount + 1), sal_uInt16(MAX_LINES) );
390  mxLineEndSet->SetLineCount( mnLines );
391 
392  SetSize();
393 }
394 
395 void SvxLineEndWindow::statusChanged( const css::frame::FeatureStateEvent& rEvent )
396 {
397  if ( rEvent.FeatureURL.Complete == ".uno:LineEndListState" )
398  {
399  // The list of line ends (LineEndList) has changed
400  css::uno::Reference< css::uno::XWeak > xWeak;
401  if ( rEvent.State >>= xWeak )
402  {
403  mpLineEndList.set( static_cast< XLineEndList* >( xWeak.get() ) );
404  DBG_ASSERT( mpLineEndList.is(), "LineEndList not found" );
405 
406  mxLineEndSet->Clear();
407  FillValueSet();
408  }
409  }
410 }
411 
412 void SvxLineEndWindow::SetSize()
413 {
414  sal_uInt16 nItemCount = mxLineEndSet->GetItemCount();
415  sal_uInt16 nMaxLines = nItemCount / gnCols;
416 
417  WinBits nBits = mxLineEndSet->GetStyle();
418  if ( mnLines == nMaxLines )
419  nBits &= ~WB_VSCROLL;
420  else
421  nBits |= WB_VSCROLL;
422  mxLineEndSet->SetStyle( nBits );
423 
424  Size aSize( maBmpSize );
425  aSize.AdjustWidth(6 );
426  aSize.AdjustHeight(6 );
427  aSize = mxLineEndSet->CalcWindowSizePixel( aSize );
428  mxLineEndSet->GetDrawingArea()->set_size_request(aSize.Width(), aSize.Height());
429  mxLineEndSet->SetOutputSizePixel(aSize);
430 }
431 
432 SvxLineEndToolBoxControl::SvxLineEndToolBoxControl( const css::uno::Reference<css::uno::XComponentContext>& rContext )
433  : svt::PopupWindowController( rContext, nullptr, OUString() )
434 {
435 }
436 
437 void SAL_CALL SvxLineEndToolBoxControl::execute(sal_Int16 /*KeyModifier*/)
438 {
439  if (m_pToolbar)
440  {
441  // Toggle the popup also when toolbutton is activated
442  const OString aId(m_aCommandURL.toUtf8());
443  m_pToolbar->set_menu_item_active(aId, !m_pToolbar->get_menu_item_active(aId));
444  }
445  else
446  {
447  // Open the popup also when Enter key is pressed.
448  createPopupWindow();
449  }
450 }
451 
452 void SvxLineEndToolBoxControl::initialize( const css::uno::Sequence<css::uno::Any>& rArguments )
453 {
454  svt::PopupWindowController::initialize( rArguments );
455 
456  if (m_pToolbar)
457  {
458  mxPopoverContainer.reset(new ToolbarPopupContainer(m_pToolbar));
459  m_pToolbar->set_item_popover(m_aCommandURL.toUtf8(), mxPopoverContainer->getTopLevel());
460  }
461 
462  ToolBox* pToolBox = nullptr;
463  sal_uInt16 nId = 0;
464  if ( getToolboxId( nId, &pToolBox ) )
465  pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) | ToolBoxItemBits::DROPDOWNONLY );
466 }
467 
468 std::unique_ptr<WeldToolbarPopup> SvxLineEndToolBoxControl::weldPopupWindow()
469 {
470  return std::make_unique<SvxLineEndWindow>(this, m_pToolbar);
471 }
472 
473 VclPtr<vcl::Window> SvxLineEndToolBoxControl::createVclPopupWindow( vcl::Window* pParent )
474 {
475  mxInterimPopover = VclPtr<InterimToolbarPopup>::Create(getFrameInterface(), pParent,
476  std::make_unique<SvxLineEndWindow>(this, pParent->GetFrameWeld()));
477 
478  mxInterimPopover->Show();
479 
480  mxInterimPopover->SetText(SvxResId(RID_SVXSTR_LINEEND));
481 
482  return mxInterimPopover;
483 }
484 
485 OUString SvxLineEndToolBoxControl::getImplementationName()
486 {
487  return "com.sun.star.comp.svx.LineEndToolBoxControl";
488 }
489 
490 css::uno::Sequence<OUString> SvxLineEndToolBoxControl::getSupportedServiceNames()
491 {
492  return { "com.sun.star.frame.ToolbarController" };
493 }
494 
495 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
497  css::uno::XComponentContext* rContext,
498  css::uno::Sequence<css::uno::Any> const & )
499 {
500  return cppu::acquire( new SvxLineEndToolBoxControl( rContext ) );
501 }
502 
503 SvxLineBox::SvxLineBox(SvxLineStyleToolBoxControl* pControl, weld::Widget* pParent, int nInitialIndex)
504  : WeldToolbarPopup(pControl->getFrameInterface(), pParent, "svx/ui/floatinglinestyle.ui", "FloatingLineStyle")
505  , mxControl(pControl)
506  , mxLineStyleSet(new SvtValueSet(m_xBuilder->weld_scrolled_window("valuesetwin")))
507  , mxLineStyleSetWin(new weld::CustomWeld(*m_xBuilder, "valueset", *mxLineStyleSet))
508 {
510 
511  FillControl();
512 
513  mxLineStyleSet->SelectItem(nInitialIndex + 1);
514 
515  mxLineStyleSet->SetSelectHdl( LINK( this, SvxLineBox, SelectHdl ) );
516 }
517 
519 {
520  mxLineStyleSet->GrabFocus();
521 }
522 
524 {
525 }
526 
527 // Fills the listbox (provisional) with strings
528 
529 void SvxLineBox::Fill( const XDashListRef &pList )
530 {
531  mxLineStyleSet->Clear();
532 
533  if( !pList.is() )
534  return;
535 
536  // entry for 'none'
537  mxLineStyleSet->InsertItem(1, Image(), pList->GetStringForUiNoLine());
538 
539  // entry for solid line
540  auto aBmp = pList->GetBitmapForUISolidLine();
541  Size aBmpSize = aBmp.GetSizePixel();
542  mxLineStyleSet->InsertItem(2, Image(aBmp), pList->GetStringForUiSolidLine());
543 
544  // entries for dashed lines
545  long nCount = pList->Count();
546  for( long i = 0; i < nCount; i++ )
547  {
548  const XDashEntry* pEntry = pList->GetDash(i);
549  const BitmapEx aBitmap = pList->GetUiBitmap(i);
550 
551  mxLineStyleSet->InsertItem(i + 3, Image(aBitmap), pEntry->GetName());
552  }
553 
554  sal_uInt16 nLines = std::min( static_cast<sal_uInt16>(nCount + 2), sal_uInt16(MAX_LINES) );
555  mxLineStyleSet->SetLineCount(nLines);
556 
557  WinBits nBits = mxLineStyleSet->GetStyle();
558  if ( nLines == mxLineStyleSet->GetItemCount() )
559  nBits &= ~WB_VSCROLL;
560  else
561  nBits |= WB_VSCROLL;
562  mxLineStyleSet->SetStyle( nBits );
563 
564  Size aSize(aBmpSize);
565  aSize.AdjustWidth(6);
566  aSize.AdjustHeight(6);
567  aSize = mxLineStyleSet->CalcWindowSizePixel(aSize);
568  mxLineStyleSet->GetDrawingArea()->set_size_request(aSize.Width(), aSize.Height());
569  mxLineStyleSet->SetOutputSizePixel(aSize);
570 }
571 
573 {
574  drawing::LineStyle eXLS;
575  sal_Int32 nPos = mxLineStyleSet->GetSelectedItemId();
576  --nPos; // ids start at 1, get the pos of the id
577 
578  switch ( nPos )
579  {
580  case 0:
581  eXLS = drawing::LineStyle_NONE;
582  break;
583 
584  case 1:
585  eXLS = drawing::LineStyle_SOLID;
586  break;
587 
588  default:
589  {
590  eXLS = drawing::LineStyle_DASH;
591 
592  if ( nPos != -1 &&
594  SfxObjectShell::Current()->GetItem( SID_DASH_LIST ) )
595  {
596  // LineDashItem will only be sent if it also has a dash.
597  // Notify cares!
598  SvxDashListItem const * pItem = SfxObjectShell::Current()->GetItem( SID_DASH_LIST );
599  const XDashEntry* pEntry = pItem->GetDashList()->GetDash(nPos - 2);
600  XLineDashItem aLineDashItem(pEntry->GetName(), pEntry->GetDash());
601 
602  Any a;
603  Sequence< PropertyValue > aArgs( 1 );
604  aArgs[0].Name = "LineDash";
605  aLineDashItem.QueryValue ( a );
606  aArgs[0].Value = a;
607  mxControl->dispatchLineStyleCommand(".uno:LineDash", aArgs);
608  }
609  }
610  break;
611  }
612 
613  XLineStyleItem aLineStyleItem( eXLS );
614  Any a;
615  Sequence< PropertyValue > aArgs( 1 );
616  aArgs[0].Name = "XLineStyle";
617  aLineStyleItem.QueryValue ( a );
618  aArgs[0].Value = a;
619  mxControl->dispatchLineStyleCommand(".uno:XLineStyle", aArgs);
620 
621  mxControl->EndPopupMode();
622 }
623 
625 {
627  if (pSh)
628  {
629  const SvxDashListItem* pItem = pSh->GetItem( SID_DASH_LIST );
630  if (pItem)
631  Fill(pItem->GetDashList());
632  }
633 }
634 
635 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual ~SvxLineBox() override
Definition: linectrl.cxx:523
long Width() const
bool Erase(const Color &rFillColor)
sal_Int32 nIndex
LineStyleSelectFunction m_aLineStyleSelectFunction
Definition: linectrl.hxx:42
long AdjustWidth(long n)
long Height() const
virtual OUString SAL_CALL getImplementationName() override=0
IMPL_LINK_NOARG(SvxLineEndWindow, SelectHdl, SvtValueSet *, void)
Definition: linectrl.cxx:296
const SfxPoolItem * GetItem(const SwTextAttr &rAttr, sal_uInt16 nWhich)
ToolBoxItemBits GetItemBits(sal_uInt16 nItemId) const
static const AllSettings & GetSettings()
std::unique_ptr< ToolbarPopupContainer > mxPopoverContainer
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override=0
sal_Int16 nId
OUString aId
virtual void statusChanged(const css::frame::FeatureStateEvent &Event)
static SfxObjectShell * Current()
WinBits const WB_VSCROLL
void Fill(const XDashListRef &pList)
Definition: linectrl.cxx:529
std::unique_ptr< SvtValueSet > mxLineStyleSet
Definition: itemwin.hxx:35
long AdjustHeight(long n)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: linectrl.cxx:205
css::uno::Reference< css::graphic::XGraphic > GetXGraphic() const
void FillControl()
Definition: linectrl.cxx:624
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_svx_LineEndToolBoxControl_get_implementation(css::uno::XComponentContext *rContext, css::uno::Sequence< css::uno::Any > const &)
Definition: linectrl.cxx:496
Value
weld::Window * GetFrameWeld() const
sal_Int64 WinBits
OUString SvxResId(const char *pId)
Definition: dialmgr.cxx:28
#define WB_ITEMBORDER
bool dispatchCommand(const OUString &rCommand, const uno::Reference< css::frame::XFrame > &rFrame, const css::uno::Sequence< css::beans::PropertyValue > &rArguments, const uno::Reference< css::frame::XDispatchResultListener > &rListener)
int nCount
const XDash & GetDash() const
Definition: xtable.hxx:80
void EnableItem(sal_uInt16 nItemId, bool bEnable=true)
std::unique_ptr< svx::ToolboxButtonLineStyleUpdater > m_xBtnUpdater
Definition: linectrl.hxx:40
const OUString & GetName() const
#define HID_POPUP_LINEEND
Definition: helpids.h:37
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
bool IsEmpty() const
void setLineStyleSelectFunction(const LineStyleSelectFunction &aLineStyleSelectFunction)
Definition: linectrl.cxx:172
SvxLineStyleToolBoxControl(const css::uno::Reference< css::uno::XComponentContext > &rContext)
Definition: linectrl.cxx:61
const XDashListRef & GetDashList() const
Definition: drawitem.hxx:171
virtual std::unique_ptr< WeldToolbarPopup > weldPopupWindow()
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &rArguments) override
Definition: linectrl.cxx:152
#define DBG_ASSERT(sCon, aError)
uno_Any a
#define MAX_LINES
Definition: linectrl.cxx:59
int i
void SetItemBits(sal_uInt16 nItemId, ToolBoxItemBits nBits)
std::function< bool(const OUString &, const css::uno::Any &)> LineStyleSelectFunction
Definition: linectrl.hxx:32
virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createPopupWindow() override
virtual VclPtr< vcl::Window > createVclPopupWindow(vcl::Window *pParent)=0
DECL_LINK(FocusHdl, weld::Widget &, void)
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: xattr.cxx:383
SvxLineBox(SvxLineStyleToolBoxControl *pControl, weld::Widget *pParent, int nInitialIndex)
Definition: linectrl.cxx:503
VclPtr< InterimToolbarPopup > mxInterimPopover
virtual VclPtr< vcl::Window > createVclPopupWindow(vcl::Window *pParent) override
Definition: linectrl.cxx:190
#define HID_POPUP_LINEEND_CTRL
Definition: helpids.h:38
virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent &rEvent) override
Definition: linectrl.cxx:71
WinBits const WB_3DLOOK
const basegfx::B2DPolyPolygon & GetLineEnd() const
Definition: xtable.hxx:65
static constexpr sal_uInt16 gnCols
Definition: linectrl.cxx:265
virtual std::unique_ptr< WeldToolbarPopup > weldPopupWindow() override
Definition: linectrl.cxx:185
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_svx_LineStyleToolBoxControl_get_implementation(css::uno::XComponentContext *rContext, css::uno::Sequence< css::uno::Any > const &)
Definition: linectrl.cxx:211
#define WB_NO_DIRECTSELECT
virtual void GrabFocus() override
Definition: linectrl.cxx:518
void SetItemImage(sal_uInt16 nItemId, const Image &rImage)
static VclPtr< reference_type > Create(Arg &&...arg)
virtual void SAL_CALL execute(sal_Int16 nKeyModifier) override
Definition: linectrl.cxx:137
void dispatchLineStyleCommand(const OUString &rCommand, const css::uno::Sequence< css::beans::PropertyValue > &rArgs)
Definition: linectrl.cxx:177
OUString sId
virtual OUString SAL_CALL getImplementationName() override
Definition: linectrl.cxx:200
#define WB_FLATVALUESET
const Size & GetSizePixel() const
virtual void GrabFocus()=0
sal_uInt16 nPos
virtual ~SvxLineStyleToolBoxControl() override
Definition: linectrl.cxx:67