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