LibreOffice Module svx (master) 1
galbrws2.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
21#include <sot/formats.hxx>
22#include <vcl/commandevent.hxx>
23#include <vcl/event.hxx>
24#include <vcl/transfer.hxx>
25#include <vcl/virdev.hxx>
26#include <sfx2/bindings.hxx>
27#include <sfx2/viewfrm.hxx>
28#include <vcl/graphicfilter.hxx>
29#include <helpids.h>
30#include <svx/svxids.hrc>
31#include <galobj.hxx>
32#include <svx/gallery1.hxx>
33#include <svx/galtheme.hxx>
34#include <svx/galctrl.hxx>
35#include <svx/galmisc.hxx>
36#include <galbrws2.hxx>
37#include <vcl/svapp.hxx>
38#include <vcl/weld.hxx>
39#include <svx/svxdlg.hxx>
40#include <svx/galleryitem.hxx>
43#include <com/sun/star/frame/FrameSearchFlag.hpp>
44#include <com/sun/star/frame/XDispatchProvider.hpp>
45#include <com/sun/star/frame/XFrame.hpp>
46#include <com/sun/star/gallery/GalleryItemType.hpp>
47#include <com/sun/star/graphic/XGraphic.hpp>
48#include <com/sun/star/lang/XComponent.hpp>
49#include <com/sun/star/style/GraphicLocation.hpp>
50
51#include <cassert>
52#include <map>
53#include <memory>
55#include <osl/diagnose.h>
56#include <o3tl/string_view.hxx>
57
59
61{
62 css::util::URL TargetURL;
63 css::uno::Sequence< css::beans::PropertyValue > Arguments;
64 css::uno::Reference< css::frame::XDispatch > Dispatch;
65};
66
67IMPL_STATIC_LINK( GalleryBrowser2, AsyncDispatch_Impl, void*, p, void )
68{
69 DispatchInfo* pDispatchInfo = static_cast<DispatchInfo*>(p);
70 if ( pDispatchInfo && pDispatchInfo->Dispatch.is() )
71 {
72 try
73 {
74 pDispatchInfo->Dispatch->dispatch( pDispatchInfo->TargetURL,
75 pDispatchInfo->Arguments );
76 }
77 catch ( const css::uno::Exception& )
78 {
79 }
80 }
81
82 delete pDispatchInfo;
83}
84
85namespace
86{
87
88struct CommandInfo
89{
90 css::util::URL URL;
91 css::uno::Reference< css::frame::XDispatch > Dispatch;
92
93 explicit CommandInfo( const OUString &rURL )
94 {
95 URL.Complete = rURL;
96 }
97};
98
99class GalleryThemePopup : public ::cppu::WeakImplHelper< css::frame::XStatusListener >
100{
101private:
102 const GalleryTheme* mpTheme;
103 sal_uInt32 mnObjectPos;
104 bool mbPreview;
105 std::unique_ptr<weld::Builder> mxBuilder;
106 std::unique_ptr<weld::Menu> mxPopupMenu;
107 std::unique_ptr<weld::Menu> mxBackgroundPopup;
108 GalleryBrowser2* mpBrowser;
109
110 typedef std::map< int, CommandInfo > CommandInfoMap;
111 CommandInfoMap m_aCommandInfo;
112
113 static void Execute( const CommandInfo &rCmdInfo,
114 const css::uno::Sequence< css::beans::PropertyValue > &rArguments );
115
116 void MenuSelectHdl(std::u16string_view rIdent);
117 void BackgroundMenuSelectHdl(sal_uInt16 nId);
118public:
119 GalleryThemePopup(weld::Widget* pParent,
120 const GalleryTheme* pTheme,
121 sal_uInt32 nObjectPos,
122 bool bPreview,
123 GalleryBrowser2* pBrowser);
124
125 void ExecutePopup(weld::Widget* pParent, const ::Point &rPos);
126
127 virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent &rEvent) override;
128 virtual void SAL_CALL disposing( const css::lang::EventObject &rSource) override;
129};
130
131
132GalleryThemePopup::GalleryThemePopup(
133 weld::Widget* pParent,
134 const GalleryTheme* pTheme,
135 sal_uInt32 nObjectPos,
136 bool bPreview,
137 GalleryBrowser2* pBrowser )
138 : mpTheme( pTheme )
139 , mnObjectPos( nObjectPos )
140 , mbPreview( bPreview )
141 , mxBuilder(Application::CreateBuilder(pParent, "svx/ui/gallerymenu2.ui"))
142 , mxPopupMenu(mxBuilder->weld_menu("menu"))
143 , mxBackgroundPopup(mxBuilder->weld_menu("backgroundmenu"))
144 , mpBrowser( pBrowser )
145{
146 // SID_GALLERY_ENABLE_ADDCOPY
147 m_aCommandInfo.emplace(
148 SID_GALLERY_ENABLE_ADDCOPY,
149 CommandInfo( ".uno:GalleryEnableAddCopy" ));
150 // SID_GALLERY_BG_BRUSH
151 m_aCommandInfo.emplace(
152 SID_GALLERY_BG_BRUSH,
153 CommandInfo( ".uno:BackgroundImage" ));
154 // SID_GALLERY_FORMATS
155 m_aCommandInfo.emplace(
156 SID_GALLERY_FORMATS,
157 CommandInfo( ".uno:InsertGalleryPic" ));
158
159}
160
161void SAL_CALL GalleryThemePopup::statusChanged(
162 const css::frame::FeatureStateEvent &rEvent )
163{
164 const OUString &rURL = rEvent.FeatureURL.Complete;
165 if ( rURL == ".uno:GalleryEnableAddCopy" )
166 {
167 if ( !rEvent.IsEnabled )
168 {
169 mxPopupMenu->set_visible("add", false);
170 }
171 }
172 else if ( rURL == ".uno:BackgroundImage" )
173 {
174 mxBackgroundPopup->clear();
175 if ( rEvent.IsEnabled )
176 {
177 OUString sItem;
178 css::uno::Sequence< OUString > sItems;
179 if ( ( rEvent.State >>= sItem ) && sItem.getLength() )
180 {
181 mxBackgroundPopup->append(OUString::number(1), sItem);
182 }
183 else if ( ( rEvent.State >>= sItems ) && sItems.hasElements() )
184 {
185 sal_uInt16 nId = 1;
186 for ( const OUString& rStr : std::as_const(sItems) )
187 {
188 mxBackgroundPopup->append(OUString::number(nId), rStr);
189 nId++;
190 }
191 }
192 }
193 }
194}
195
196void SAL_CALL GalleryThemePopup::disposing(
197 const css::lang::EventObject &/*rSource*/)
198{
199}
200
201void GalleryThemePopup::Execute(
202 const CommandInfo &rCmdInfo,
203 const css::uno::Sequence< css::beans::PropertyValue > &rArguments )
204{
205 if ( rCmdInfo.Dispatch.is() )
206 {
207 std::unique_ptr<DispatchInfo> pInfo(new DispatchInfo);
208 pInfo->TargetURL = rCmdInfo.URL;
209 pInfo->Arguments = rArguments;
210 pInfo->Dispatch = rCmdInfo.Dispatch;
211
213 LINK( nullptr, GalleryBrowser2, AsyncDispatch_Impl), pInfo.get() ) )
214 pInfo.release();
215 }
216}
217
218void GalleryThemePopup::ExecutePopup(weld::Widget* pParent, const ::Point &rPos)
219{
220 css::uno::Reference< css::frame::XStatusListener > xThis( this );
221
222 const SgaObjKind eObjKind = mpTheme->GetObjectKind( mnObjectPos );
224
225 const_cast< GalleryTheme* >( mpTheme )->GetURL( mnObjectPos, aURL );
226 const bool bValidURL = ( aURL.GetProtocol() != INetProtocol::NotValid );
227
228 mxPopupMenu->set_visible("add", bValidURL && SgaObjKind::Sound != eObjKind);
229
230 mxPopupMenu->set_visible("preview", bValidURL);
231 mxPopupMenu->set_active("preview", mbPreview);
232
233 if( mpTheme->IsReadOnly() || !mpTheme->GetObjectCount() )
234 {
235 mxPopupMenu->set_visible("delete", false);
236 mxPopupMenu->set_visible("title", false);
237 if (mpTheme->IsReadOnly())
238 mxPopupMenu->set_visible("paste", false);
239
240 if (!mpTheme->GetObjectCount())
241 mxPopupMenu->set_visible("copy", false);
242 }
243 else
244 {
245 mxPopupMenu->set_visible("delete", !mbPreview);
246 mxPopupMenu->set_visible("title", true);
247 mxPopupMenu->set_visible("copy", true);
248 mxPopupMenu->set_visible("paste", true);
249 }
250
251 // update status
252 css::uno::Reference< css::frame::XDispatchProvider> xDispatchProvider(
253 GalleryBrowser2::GetFrame(), css::uno::UNO_QUERY );
254 css::uno::Reference< css::util::XURLTransformer > xTransformer(
255 mpBrowser->GetURLTransformer() );
256 for ( auto& rInfo : m_aCommandInfo )
257 {
258 try
259 {
260 CommandInfo &rCmdInfo = rInfo.second;
261 if ( xTransformer.is() )
262 xTransformer->parseStrict( rCmdInfo.URL );
263
264 if ( xDispatchProvider.is() )
265 {
266 rCmdInfo.Dispatch = xDispatchProvider->queryDispatch(
267 rCmdInfo.URL,
268 "_self",
269 css::frame::FrameSearchFlag::SELF );
270 }
271
272 if ( rCmdInfo.Dispatch.is() )
273 {
274 rCmdInfo.Dispatch->addStatusListener( this, rCmdInfo.URL );
275 rCmdInfo.Dispatch->removeStatusListener( this, rCmdInfo.URL );
276 }
277 }
278 catch ( ... )
279 {}
280 }
281
282 if( !mxBackgroundPopup->n_children() || ( eObjKind == SgaObjKind::SvDraw ) || ( eObjKind == SgaObjKind::Sound ) )
283 mxPopupMenu->set_visible("background", false);
284 else
285 mxPopupMenu->set_visible("background", true);
286
287 MenuSelectHdl(mxPopupMenu->popup_at_rect(pParent, tools::Rectangle(rPos, Size(1,1))));
288}
289
290void GalleryThemePopup::MenuSelectHdl(std::u16string_view rIdent)
291{
292 if (rIdent.empty())
293 return;
294
295 sal_uInt16 nSubMenuId = o3tl::toUInt32(rIdent);
296 if (nSubMenuId)
297 {
298 BackgroundMenuSelectHdl(nSubMenuId-1);
299 return;
300 }
301
302 if (rIdent == u"add")
303 {
304 const CommandInfoMap::const_iterator it = m_aCommandInfo.find( SID_GALLERY_FORMATS );
305 if (it != m_aCommandInfo.end())
306 mpBrowser->DispatchAdd(it->second.Dispatch, it->second.URL);
307 }
308 else
309 mpBrowser->Execute(rIdent);
310}
311
312void GalleryThemePopup::BackgroundMenuSelectHdl(sal_uInt16 nPos)
313{
314 OUString aURL( mpBrowser->GetURL().GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
315 OUString aFilterName( mpBrowser->GetFilterName() );
316
317 css::uno::Sequence< css::beans::PropertyValue > aArgs{
318 comphelper::makePropertyValue("Background.Transparent", sal_Int32( 0 )), // 0 - 100
319 comphelper::makePropertyValue("Background.BackColor", sal_Int32( - 1 )),
320 comphelper::makePropertyValue("Background.URL", aURL),
321 comphelper::makePropertyValue("Background.Filtername", aFilterName), // FIXME name should be FilterName
322 comphelper::makePropertyValue("Background.Position", css::style::GraphicLocation_TILED),
323 comphelper::makePropertyValue("Position", nPos)
324 };
325
326 const CommandInfoMap::const_iterator it = m_aCommandInfo.find( SID_GALLERY_BG_BRUSH );
327 if ( it != m_aCommandInfo.end() )
328 Execute( it->second, aArgs );
329}
330
331} // end anonymous namespace
332
334 : mpGallery(pGallery)
335 , mpCurTheme(nullptr)
336 , mxIconView(new GalleryIconView(this, rBuilder.weld_scrolled_window("galleryscroll", true)))
337 , mxIconViewWin(new weld::CustomWeld(rBuilder, "gallery", *mxIconView))
338 , mxListView(rBuilder.weld_tree_view("gallerylist"))
339 , mxPreview(new GalleryPreview(this, rBuilder.weld_scrolled_window("previewscroll")))
340 , mxPreviewWin(new weld::CustomWeld(rBuilder, "preview", *mxPreview))
341 , mxIconButton(rBuilder.weld_toggle_button("icon"))
342 , mxListButton(rBuilder.weld_toggle_button("list"))
343 , mxInfoBar(rBuilder.weld_label("label"))
344 , maPreviewSize(28, 28)
345 , mnCurActionPos ( 0xffffffff )
347 , meLastMode ( GALLERYBROWSERMODE_NONE )
348{
349 m_xContext.set( ::comphelper::getProcessComponentContext() );
350
351 int nHeight = mxListView->get_height_rows(10);
352 mxListView->set_size_request(-1, nHeight);
353 mxIconView->set_size_request(-1, nHeight);
354
355 m_xTransformer.set(
356 m_xContext->getServiceManager()->createInstanceWithContext(
357 "com.sun.star.util.URLTransformer", m_xContext ),
358 css::uno::UNO_QUERY );
359
362
363 mxIconButton->connect_toggled( LINK( this, GalleryBrowser2, SelectTbxHdl ) );
364 mxListButton->connect_toggled( LINK( this, GalleryBrowser2, SelectTbxHdl ) );
365
366 mxIconView->SetSelectHdl( LINK( this, GalleryBrowser2, SelectObjectValueSetHdl ) );
367 mxListView->connect_visible_range_changed(LINK(this, GalleryBrowser2, VisRowsScrolledHdl));
368 mxListView->connect_size_allocate(LINK(this, GalleryBrowser2, SizeAllocHdl));
369 mxListView->connect_changed( LINK( this, GalleryBrowser2, SelectObjectHdl ) );
370 mxListView->connect_popup_menu(LINK(this, GalleryBrowser2, PopupMenuHdl));
371 mxListView->connect_key_press(LINK(this, GalleryBrowser2, KeyInputHdl));
372 mxListView->connect_row_activated(LINK(this, GalleryBrowser2, RowActivatedHdl));
373 mxDragDropTargetHelper.reset(new GalleryDragDrop(this, mxListView->get_drop_target()));
374 mxListView->connect_drag_begin(LINK(this, GalleryBrowser2, DragBeginHdl));
375
376 mxListView->set_help_id(HID_GALLERY_WINDOW);
377
379}
380
381IMPL_LINK(GalleryBrowser2, PopupMenuHdl, const CommandEvent&, rCEvt, bool)
382{
383 if (rCEvt.GetCommand() != CommandEventId::ContextMenu)
384 return false;
385 ShowContextMenu(rCEvt);
386 return true;
387}
388
389IMPL_LINK(GalleryBrowser2, KeyInputHdl, const KeyEvent&, rKEvt, bool)
390{
391 return KeyInput(rKEvt);
392}
393
395{
396 TogglePreview();
397 return true;
398}
399
401{
402 if (mpCurTheme)
404}
405
407{
408 const GalleryHint& rGalleryHint = static_cast<const GalleryHint&>(rHint);
409
410 switch( rGalleryHint.GetType() )
411 {
413 {
416
417 ImplUpdateViews( reinterpret_cast<size_t>(rGalleryHint.GetData1()) + 1 );
418 }
419 break;
420
421 default:
422 break;
423 }
424}
425
426sal_Int8 GalleryBrowser2::AcceptDrop( const DropTargetHelper& rTarget )
427{
429
430 if( mpCurTheme && !mpCurTheme->IsReadOnly() )
431 {
432 if( !mpCurTheme->IsDragging() )
433 {
434 if( rTarget.IsDropFormatSupported( SotClipboardFormatId::DRAWING ) ||
435 rTarget.IsDropFormatSupported( SotClipboardFormatId::FILE_LIST ) ||
436 rTarget.IsDropFormatSupported( SotClipboardFormatId::SIMPLE_FILE ) ||
437 rTarget.IsDropFormatSupported( SotClipboardFormatId::SVXB ) ||
438 rTarget.IsDropFormatSupported( SotClipboardFormatId::GDIMETAFILE ) ||
439 rTarget.IsDropFormatSupported( SotClipboardFormatId::BITMAP ) )
440 {
441 nRet = DND_ACTION_COPY;
442 }
443 }
444 else
445 nRet = DND_ACTION_COPY;
446 }
447
448 return nRet;
449}
450
452{
454
455 if( mpCurTheme )
456 {
457 Point aSelPos;
458 const sal_uInt32 nItemId = ImplGetSelectedItemId( &rEvt.maPosPixel, aSelPos );
459 const sal_uInt32 nInsertPos = (nItemId ? (nItemId - 1) : mpCurTheme->GetObjectCount());
460
461 if( mpCurTheme->IsDragging() )
463 else
464 nRet = mpCurTheme->InsertTransferable( rEvt.maDropEvent.Transferable, nInsertPos ) ? 1 : 0;
465 }
466
467 return nRet;
468}
469
471{
472 if (!mpCurTheme)
473 return true;
474 return m_xHelper->StartDrag();
475}
476
477IMPL_LINK(GalleryBrowser2, DragBeginHdl, bool&, rUnsetDragIcon, bool)
478{
479 rUnsetDragIcon = false;
480 return StartDrag();
481}
482
484{
487}
488
490{
491 Point aMousePos = rCEvt.GetMousePosPixel();
492 Point aSelPos;
493 const sal_uInt32 nItemId = ImplGetSelectedItemId( rCEvt.IsMouseEvent() ? &aMousePos : nullptr, aSelPos );
494
495 if( !(mpCurTheme && nItemId && ( nItemId <= mpCurTheme->GetObjectCount() )) )
496 return false;
497
498 ImplSelectItemId( nItemId );
499
500 css::uno::Reference< css::frame::XFrame > xFrame( GetFrame() );
501 if ( !xFrame.is() )
502 return false;
503
504 weld::Widget* pParent = GetViewWindow();
505 mnCurActionPos = nItemId - 1;
507 new GalleryThemePopup(
508 pParent,
512 this ) );
513 xPopup->ExecutePopup(pParent, aSelPos);
514 return true;
515}
516
518{
519 return mxIconButton->has_focus() || mxListButton->has_focus();
520}
521
523{
524 Point aSelPos;
525 const sal_uInt32 nItemId = ImplGetSelectedItemId( nullptr, aSelPos );
526 bool bRet = false;
527
528 if (!ViewBoxHasFocus() && nItemId && mpCurTheme)
529 {
530 OUString sExecuteIdent;
532
533 mpCurTheme->GetURL( nItemId - 1, aURL );
534
535 const bool bValidURL = ( aURL.GetProtocol() != INetProtocol::NotValid );
536 bool bPreview = bValidURL;
537 bool bDelete = false;
538 bool bTitle = false;
539
541 {
542 bDelete = ( GALLERYBROWSERMODE_PREVIEW != GetMode() );
543 bTitle = true;
544 }
545
546 switch( rKEvt.GetKeyCode().GetCode() )
547 {
548 case KEY_SPACE:
549 case KEY_RETURN:
550 case KEY_P:
551 {
552 if( bPreview )
553 {
555 bRet = true;
556 }
557 }
558 break;
559
560 case KEY_INSERT:
561 case KEY_I:
562 {
563 // Inserting a gallery item in the document must be dispatched
564 if( bValidURL )
565 {
566 DispatchAdd(css::uno::Reference<css::frame::XDispatch>(), css::util::URL());
567 return true;
568 }
569 }
570 break;
571
572 case KEY_DELETE:
573 case KEY_D:
574 {
575 if( bDelete )
576 sExecuteIdent = "delete";
577 }
578 break;
579
580 case KEY_T:
581 {
582 if( bTitle )
583 sExecuteIdent = "title";
584 }
585 break;
586
587 default:
588 break;
589 }
590
591 if (!sExecuteIdent.isEmpty())
592 {
593 Execute(sExecuteIdent);
594 bRet = true;
595 }
596 }
597
598 return bRet;
599}
600
601void GalleryBrowser2::SelectTheme( std::u16string_view rThemeName )
602{
603 if( mpCurTheme )
605
606 mpCurTheme = mpGallery->AcquireTheme( rThemeName, *this );
607
608 m_xHelper.set(new GalleryTransferable(mpCurTheme, 0, true));
610 mxListView->enable_drag_source(xHelper, DND_ACTION_COPY | DND_ACTION_LINK);
611 mxIconView->SetDragDataTransferable(xHelper, DND_ACTION_COPY | DND_ACTION_LINK);
612 mxPreview->SetDragDataTransferable(xHelper, DND_ACTION_COPY | DND_ACTION_LINK);
613
614 mxIconView->SetTheme(mpCurTheme);
615 mxPreview->SetTheme(mpCurTheme);
616
619
620 ImplUpdateViews( 1 );
621
622 bool bIconMode = (GALLERYBROWSERMODE_ICON == GetMode());
623 mxIconButton->set_sensitive(true);
624 mxListButton->set_sensitive(true);
625 mxIconButton->set_active(bIconMode);
626 mxListButton->set_active(!bIconMode);
627}
628
630{
631 if( GetMode() == eMode )
632 return;
633
635
636 switch( eMode )
637 {
639 {
640 mxListView->hide();
641
642 mxPreview->Hide();
643 mxPreview->SetGraphic( Graphic() );
645
646 mxIconView->Show();
647
648 mxIconButton->set_sensitive(true);
649 mxListButton->set_sensitive(true);
650
651 mxIconButton->set_active(true);
652 mxListButton->set_active(false);
653 }
654 break;
655
657 {
658 mxIconView->Hide();
659
660 mxPreview->Hide();
661 mxPreview->SetGraphic( Graphic() );
663
664 mxListView->show();
665 UpdateRows(true);
666
667 mxIconButton->set_sensitive(true);
668 mxListButton->set_sensitive(true);
669
670 mxIconButton->set_active(false);
671 mxListButton->set_active(true);
672 }
673 break;
674
676 {
677 Graphic aGraphic;
678 Point aSelPos;
679 const sal_uInt32 nItemId = ImplGetSelectedItemId( nullptr, aSelPos );
680
681 if( nItemId )
682 {
683 const sal_uInt32 nPos = nItemId - 1;
684
685 mxIconView->Hide();
686 mxListView->hide();
687
688 if( mpCurTheme )
689 mpCurTheme->GetGraphic( nPos, aGraphic );
690
691 mxPreview->SetGraphic( aGraphic );
692 mxPreview->Show();
693
696
697 mxIconButton->set_sensitive(false);
698 mxListButton->set_sensitive(false);
699 }
700 }
701 break;
702
703 default:
704 break;
705 }
706
708}
709
711{
712 weld::Widget* pRet;
713
714 switch( GetMode() )
715 {
716 case GALLERYBROWSERMODE_LIST: pRet = mxListView.get(); break;
717 case GALLERYBROWSERMODE_PREVIEW: pRet = mxPreview->GetDrawingArea(); break;
718
719 default:
720 pRet = mxIconView->GetDrawingArea();
721 break;
722 }
723
724 return pRet;
725}
726
728{
729 if( !mpCurTheme )
730 return;
731
732 Point aSelPos;
733 const sal_uInt32 nItemId = ImplGetSelectedItemId( nullptr, aSelPos );
734
735 if( !nItemId )
736 return;
737
738 sal_uInt32 nNewItemId = nItemId;
739
740 switch( eTravel )
741 {
742 case GalleryBrowserTravel::First: nNewItemId = 1; break;
743 case GalleryBrowserTravel::Last: nNewItemId = mpCurTheme->GetObjectCount(); break;
744 case GalleryBrowserTravel::Previous: nNewItemId--; break;
745 case GalleryBrowserTravel::Next: nNewItemId++; break;
746 default:
747 break;
748 }
749
750 if( nNewItemId < 1 )
751 nNewItemId = 1;
752 else if( nNewItemId > mpCurTheme->GetObjectCount() )
753 nNewItemId = mpCurTheme->GetObjectCount();
754
755 if( nNewItemId == nItemId )
756 return;
757
758 ImplSelectItemId( nNewItemId );
760
762 return;
763
764 Graphic aGraphic;
765 const sal_uInt32 nPos = nNewItemId - 1;
766
767 mpCurTheme->GetGraphic( nPos, aGraphic );
768 mxPreview->SetGraphic( aGraphic );
769
772
773 mxPreview->Invalidate();
774}
775
776void GalleryBrowser2::ImplUpdateViews( sal_uInt16 nSelectionId )
777{
778 mxIconView->Hide();
779 mxListView->hide();
780 mxPreview->Hide();
781
782 mxIconView->Clear();
783 mxListView->clear();
784
785 if( mpCurTheme )
786 {
787 const int nAlwaysUpToDate = 15;
788
789 mxListView->freeze();
790
791 sal_uInt32 nCount = mpCurTheme->GetObjectCount();
792 for (sal_uInt32 i = 0; i < nCount; ++i)
793 {
794 mxIconView->InsertItem(i + 1); // skip reserved id 0
795 mxListView->append(OUString::number(i), ""); // create on-demand in VisRowsScrolledHdl
796
797 if (i == nAlwaysUpToDate) // fill in the first block
798 UpdateRows(false);
799 }
800
801 if (nCount < nAlwaysUpToDate) // if less than block size, fill in all of them
802 UpdateRows(false);
803
804 mxListView->thaw();
805
806 ImplSelectItemId( std::min<sal_uInt16>( nSelectionId, mpCurTheme->GetObjectCount() ) );
807 }
808
809 switch( GetMode() )
810 {
811 case GALLERYBROWSERMODE_ICON: mxIconView->Show(); break;
813 mxListView->show();
814 UpdateRows(true);
815 break;
816 case GALLERYBROWSERMODE_PREVIEW: mxPreview->Show(); break;
817
818 default:
819 break;
820 }
821
823}
824
825void GalleryBrowser2::UpdateRows(bool bVisibleOnly)
826{
827 auto lambda = [this](weld::TreeIter& rEntry){
828 // id is non-null if the preview is pending creation
829 OUString sId(mxListView->get_id(rEntry));
830 if (sId.isEmpty())
831 return false;
832
833 // get the icon for the listview
834 BitmapEx aBitmapEx;
835 Size aPreparedSize;
836
837 OUString sItemTextTitle;
838 OUString sItemTextPath;
839
840 sal_Int32 i = sId.toUInt32();
841 mpCurTheme->GetPreviewBitmapExAndStrings(i, aBitmapEx, aPreparedSize, sItemTextTitle, sItemTextPath);
842
843 bool bNeedToCreate(aBitmapEx.IsEmpty());
844 if (!bNeedToCreate && (sItemTextTitle.isEmpty() || aPreparedSize != maPreviewSize))
845 bNeedToCreate = true;
846
847 if (bNeedToCreate)
848 {
849 std::unique_ptr<SgaObject> xObj = mpCurTheme->AcquireObject(i);
850 if (xObj)
851 {
852 aBitmapEx = xObj->createPreviewBitmapEx(maPreviewSize);
855
856 mpCurTheme->SetPreviewBitmapExAndStrings(i, aBitmapEx, maPreviewSize, sItemTextTitle, sItemTextPath);
857 }
858 }
859
860 ScopedVclPtr<VirtualDevice> xDev(mxListView->create_virtual_device());
861 xDev->SetOutputSizePixel(maPreviewSize);
862
863 if (!aBitmapEx.IsEmpty())
864 {
865 const Size aBitmapExSizePixel(aBitmapEx.GetSizePixel());
866 const Point aPos(
867 ((maPreviewSize.Width() - aBitmapExSizePixel.Width()) >> 1),
868 ((maPreviewSize.Height() - aBitmapExSizePixel.Height()) >> 1));
869
870 if (aBitmapEx.IsAlpha())
871 {
872 // draw checkered background
873 GalleryIconView::drawTransparenceBackground(*xDev, aPos, aBitmapExSizePixel);
874 }
875
876 xDev->DrawBitmapEx(aPos, aBitmapEx);
877 }
878
879 mxListView->set_text(rEntry, sItemTextTitle);
880 mxListView->set_image(rEntry, *xDev);
881 mxListView->set_id(rEntry, OUString());
882
883 return false;
884 };
885
886 if (bVisibleOnly)
887 {
888 // ensure all visible entries are up to date
889 mxListView->visible_foreach(lambda);
890 // and ensure all selected entries are up to date
891 mxListView->selected_foreach(lambda);
892 return;
893 }
894
895 mxListView->all_foreach(lambda);
896}
897
899{
900 UpdateRows(true);
901}
902
903IMPL_LINK_NOARG(GalleryBrowser2, SizeAllocHdl, const Size&, void)
904{
905 UpdateRows(true);
906}
907
909{
910 if (!mpCurTheme)
911 return;
912 mxInfoBar->set_label( mpCurTheme->GetName() );
913}
914
916{
917 if (!mpCurTheme)
918 return;
919 auto nSelectedObject = (GALLERYBROWSERMODE_ICON == GetMode()) ? (mxIconView->GetSelectedItemId() - 1) : mxListView->get_selected_index();
920 m_xHelper->SelectObject(nSelectedObject);
921}
922
923sal_uInt32 GalleryBrowser2::ImplGetSelectedItemId( const Point* pSelPos, Point& rSelPos )
924{
925 sal_uInt32 nRet = 0;
926
928 {
929 nRet = ( ( GALLERYBROWSERMODE_ICON == meLastMode ) ? mxIconView->GetSelectedItemId() : ( mxListView->get_selected_index() + 1 ) );
930
931 if( pSelPos )
932 rSelPos = *pSelPos;
933 else
934 {
935 Size aOutputSizePixel(mxPreview->GetOutputSizePixel());
936 rSelPos = Point( aOutputSizePixel.Width() >> 1, aOutputSizePixel.Height() >> 1 );
937 }
938 }
939 else if (GALLERYBROWSERMODE_ICON == GetMode())
940 {
941 if (pSelPos)
942 {
943 nRet = mxIconView->GetItemId( *pSelPos );
944 rSelPos = *pSelPos;
945 }
946 else
947 {
948 nRet = mxIconView->GetSelectedItemId();
949 rSelPos = mxIconView->GetItemRect(nRet).Center();
950 }
951 }
952 else
953 {
954 std::unique_ptr<weld::TreeIter> xIter = mxListView->make_iterator();
955 if( pSelPos )
956 {
957 if (mxListView->get_dest_row_at_pos(*pSelPos, xIter.get(), false))
958 nRet = mxListView->get_iter_index_in_parent(*xIter) + 1;
959 rSelPos = *pSelPos;
960 }
961 else
962 {
963 if (mxListView->get_selected(xIter.get()))
964 {
965 nRet = mxListView->get_iter_index_in_parent(*xIter) + 1;
966 rSelPos = mxListView->get_row_area(*xIter).Center();
967 }
968 }
969 }
970
971 if( nRet && ( !mpCurTheme || ( nRet > mpCurTheme->GetObjectCount() ) ) )
972 {
973 nRet = 0;
974 }
975
976 return nRet;
977}
978
979void GalleryBrowser2::ImplSelectItemId(sal_uInt32 nItemId)
980{
981 if( nItemId )
982 {
983 mxIconView->SelectItem(nItemId);
984 mxListView->select( nItemId - 1 );
986 }
987}
988
989css::uno::Reference< css::frame::XFrame >
991{
992 css::uno::Reference< css::frame::XFrame > xFrame;
993 SfxViewFrame* pCurrentViewFrame = SfxViewFrame::Current();
994 if ( pCurrentViewFrame )
995 {
996 SfxBindings& rBindings = pCurrentViewFrame->GetBindings();
997 xFrame.set( rBindings.GetActiveFrame() );
998 }
999
1000 return xFrame;
1001}
1002
1004 const css::uno::Reference< css::frame::XDispatch > &rxDispatch,
1005 const css::util::URL &rURL)
1006{
1007 Point aSelPos;
1008 const sal_uInt32 nItemId = ImplGetSelectedItemId( nullptr, aSelPos );
1009
1010 if( !mpCurTheme || !nItemId )
1011 return;
1012
1013 mnCurActionPos = nItemId - 1;
1014
1015 css::uno::Reference< css::frame::XDispatch > xDispatch( rxDispatch );
1016 css::util::URL aURL = rURL;
1017
1018 if ( !xDispatch.is() )
1019 {
1020 css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider(
1021 GetFrame(), css::uno::UNO_QUERY );
1022 if ( !xDispatchProvider.is() || !m_xTransformer.is() )
1023 return;
1024
1025 aURL.Complete = ".uno:InsertGalleryPic";
1026 m_xTransformer->parseStrict( aURL );
1027 xDispatch = xDispatchProvider->queryDispatch(
1028 aURL,
1029 "_self",
1030 css::frame::FrameSearchFlag::SELF );
1031 }
1032
1033 if ( !xDispatch.is() )
1034 return;
1035
1036 sal_Int8 nType = 0;
1037 OUString aFilterName;
1038 css::uno::Reference< css::lang::XComponent > xDrawing;
1039 css::uno::Reference< css::graphic::XGraphic > xGraphic;
1040
1041 aFilterName = GetFilterName();
1042
1044 {
1045 case SgaObjKind::Bitmap:
1047 case SgaObjKind::Inet:
1048 // TODO drawing objects are inserted as drawings only via drag&drop
1049 case SgaObjKind::SvDraw:
1050 nType = css::gallery::GalleryItemType::GRAPHIC;
1051 break;
1052
1053 case SgaObjKind::Sound :
1054 nType = css::gallery::GalleryItemType::MEDIA;
1055 break;
1056
1057 default:
1059 break;
1060 }
1061
1062 Graphic aGraphic;
1063 bool bGraphic = mpCurTheme->GetGraphic( mnCurActionPos, aGraphic );
1064 if ( bGraphic && !aGraphic.IsNone() )
1065 xGraphic.set( aGraphic.GetXGraphic() );
1066 OSL_ENSURE( xGraphic.is(), "gallery item is graphic, but the reference is invalid!" );
1067
1068 css::uno::Sequence< css::beans::PropertyValue > aSeq{
1074 };
1075 assert(aSeq.getLength() == SVXGALLERYITEM_PARAMS);
1076
1077 css::uno::Sequence< css::beans::PropertyValue > aArgs{ comphelper::makePropertyValue(
1079
1080 std::unique_ptr<DispatchInfo> pInfo(new DispatchInfo);
1081 pInfo->TargetURL = aURL;
1082 pInfo->Arguments = aArgs;
1083 pInfo->Dispatch = xDispatch;
1084
1086 LINK( nullptr, GalleryBrowser2, AsyncDispatch_Impl), pInfo.get() ) )
1087 pInfo.release();
1088}
1089
1090void GalleryBrowser2::Execute(std::u16string_view rIdent)
1091{
1092 Point aSelPos;
1093 const sal_uInt32 nItemId = ImplGetSelectedItemId( nullptr, aSelPos );
1094
1095 if( !(mpCurTheme && nItemId) )
1096 return;
1097
1098 mnCurActionPos = nItemId - 1;
1099
1100 if (rIdent == u"preview")
1102 else if (rIdent == u"delete")
1103 {
1104 if (!mpCurTheme->IsReadOnly())
1105 {
1106 std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetViewWindow(), "svx/ui/querydeleteobjectdialog.ui"));
1107 std::unique_ptr<weld::MessageDialog> xQuery(xBuilder->weld_message_dialog("QueryDeleteObjectDialog"));
1108 if (xQuery->run() == RET_YES)
1109 {
1111 }
1112 }
1113 }
1114 else if (rIdent == u"title")
1115 {
1116 std::unique_ptr<SgaObject> pObj = mpCurTheme->AcquireObject( mnCurActionPos );
1117
1118 if( pObj )
1119 {
1120 const OUString aOldTitle( GetItemText( *pObj, GalleryItemFlags::Title ) );
1121
1124 if( aDlg->Execute() == RET_OK )
1125 {
1126 OUString aNewTitle( aDlg->GetTitle() );
1127
1128 if( ( aNewTitle.isEmpty() && !pObj->GetTitle().isEmpty() ) || ( aNewTitle != aOldTitle ) )
1129 {
1130 if( aNewTitle.isEmpty() )
1131 aNewTitle = "__<empty>__";
1132
1133 pObj->SetTitle( aNewTitle );
1134 mpCurTheme->InsertObject( *pObj );
1135 }
1136 }
1137 }
1138 }
1139 else if (rIdent == u"copy")
1140 {
1142 }
1143 else if (rIdent == u"paste")
1144 {
1145 if( !mpCurTheme->IsReadOnly() )
1146 {
1147 weld::Widget* pParent = GetViewWindow();
1150 }
1151 }
1152}
1153
1154OUString GalleryBrowser2::GetItemText( const SgaObject& rObj, GalleryItemFlags nItemTextFlags )
1155{
1156 OUString aRet;
1157
1158 const INetURLObject& aURL(rObj.GetURL());
1159
1160 if( nItemTextFlags & GalleryItemFlags::Title )
1161 {
1162 OUString aTitle( rObj.GetTitle() );
1163
1164 if( aTitle.isEmpty() )
1166
1167 if( aTitle.isEmpty() )
1168 {
1170 aTitle = aTitle.copy( aTitle.lastIndexOf('/')+1 );
1171 }
1172
1173 aRet += aTitle;
1174 }
1175
1176 if( nItemTextFlags & GalleryItemFlags::Path )
1177 {
1178 const OUString aPath( aURL.getFSysPath( FSysStyle::Detect ) );
1179
1180 if( !aPath.isEmpty() && ( nItemTextFlags & GalleryItemFlags::Title ) )
1181 aRet += " (";
1182
1183 aRet += aURL.getFSysPath( FSysStyle::Detect );
1184
1185 if( !aPath.isEmpty() && ( nItemTextFlags & GalleryItemFlags::Title ) )
1186 aRet += ")";
1187 }
1188
1189 return aRet;
1190}
1191
1193{
1195
1196 if( mpCurTheme && mnCurActionPos != 0xffffffff )
1198
1199 return aURL;
1200}
1201
1203{
1204 OUString aFilterName;
1205
1206 if( mpCurTheme && mnCurActionPos != 0xffffffff )
1207 {
1209
1210 if( ( SgaObjKind::Bitmap == eObjKind ) || ( SgaObjKind::Animation == eObjKind ) )
1211 {
1215 sal_uInt16 nFilter = rFilter.GetImportFormatNumberForShortName(aURL.GetFileExtension());
1216
1217 if( GRFILTER_FORMAT_DONTKNOW != nFilter )
1218 aFilterName = rFilter.GetImportFormatName( nFilter );
1219 }
1220 }
1221
1222 return aFilterName;
1223}
1224
1225IMPL_LINK_NOARG(GalleryBrowser2, SelectObjectValueSetHdl, ValueSet*, void)
1226{
1227 ImplUpdateSelection();
1228}
1229
1231{
1232 ImplUpdateSelection();
1233}
1234
1235IMPL_LINK(GalleryBrowser2, SelectTbxHdl, weld::Toggleable&, rBox, void)
1236{
1237 if (&rBox == mxIconButton.get())
1238 SetMode(rBox.get_active() ? GALLERYBROWSERMODE_ICON : GALLERYBROWSERMODE_LIST);
1239 else if (&rBox == mxListButton.get())
1240 SetMode(rBox.get_active() ? GALLERYBROWSERMODE_LIST : GALLERYBROWSERMODE_ICON);
1241}
1242
1243/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
static std::unique_ptr< weld::Builder > CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false, sal_uInt64 nLOKWindowId=0)
bool IsAlpha() const
bool IsEmpty() const
const Size & GetSizePixel() const
const Point & GetMousePosPixel() const
bool IsMouseEvent() const
OUString GetFilterName() const
Definition: galbrws2.cxx:1202
Size maPreviewSize
Definition: galbrws2.hxx:88
sal_Int8 AcceptDrop(const DropTargetHelper &rTarget)
Definition: galbrws2.cxx:426
css::uno::Reference< css::uno::XComponentContext > m_xContext
Definition: galbrws2.hxx:94
void Travel(GalleryBrowserTravel eTravel)
Definition: galbrws2.cxx:727
static css::uno::Reference< css::frame::XFrame > GetFrame()
Definition: galbrws2.cxx:990
static GalleryBrowserMode meInitMode
Definition: galbrws2.hxx:119
void TogglePreview()
Definition: galbrws2.cxx:483
sal_uInt32 mnCurActionPos
Definition: galbrws2.hxx:90
Gallery * mpGallery
Definition: galbrws2.hxx:77
std::unique_ptr< weld::Label > mxInfoBar
Definition: galbrws2.hxx:87
GalleryTheme * mpCurTheme
Definition: galbrws2.hxx:78
void UpdateRows(bool bVisibleOnly)
Definition: galbrws2.cxx:825
void ImplUpdateSelection()
Definition: galbrws2.cxx:915
void SelectTheme(std::u16string_view rThemeName)
Definition: galbrws2.cxx:601
sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt)
Definition: galbrws2.cxx:451
GalleryBrowser2(weld::Builder &rBuilder, Gallery *pGallery)
Definition: galbrws2.cxx:333
bool ViewBoxHasFocus() const
Definition: galbrws2.cxx:517
rtl::Reference< GalleryTransferable > m_xHelper
Definition: galbrws2.hxx:89
void ImplSelectItemId(sal_uInt32 nItemId)
Definition: galbrws2.cxx:979
void ImplUpdateViews(sal_uInt16 nSelectionId)
Definition: galbrws2.cxx:776
std::unique_ptr< weld::TreeView > mxListView
Definition: galbrws2.hxx:81
weld::Widget * GetViewWindow() const
Definition: galbrws2.cxx:710
std::unique_ptr< weld::ToggleButton > mxListButton
Definition: galbrws2.hxx:86
void DispatchAdd(const css::uno::Reference< css::frame::XDispatch > &rxDispatch, const css::util::URL &rURL)
Definition: galbrws2.cxx:1003
bool StartDrag()
Definition: galbrws2.cxx:470
void ImplUpdateInfoBar()
Definition: galbrws2.cxx:908
void Execute(std::u16string_view rIdent)
Definition: galbrws2.cxx:1090
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: galbrws2.cxx:406
void SetMode(GalleryBrowserMode eMode)
Definition: galbrws2.cxx:629
bool KeyInput(const KeyEvent &rEvt)
Definition: galbrws2.cxx:522
bool ShowContextMenu(const CommandEvent &rCEvt)
Definition: galbrws2.cxx:489
css::uno::Reference< css::util::XURLTransformer > m_xTransformer
Definition: galbrws2.hxx:95
static OUString GetItemText(const SgaObject &rObj, GalleryItemFlags nItemTextFlags)
Definition: galbrws2.cxx:1154
sal_uInt32 ImplGetSelectedItemId(const Point *pSelPosPixel, Point &rSelPos)
Definition: galbrws2.cxx:923
INetURLObject GetURL() const
Definition: galbrws2.cxx:1192
std::unique_ptr< GalleryPreview > mxPreview
Definition: galbrws2.hxx:83
std::unique_ptr< weld::ToggleButton > mxIconButton
Definition: galbrws2.hxx:85
std::unique_ptr< GalleryDragDrop > mxDragDropTargetHelper
Definition: galbrws2.hxx:82
GalleryBrowserMode GetMode() const
Definition: galbrws2.hxx:132
GalleryBrowserMode meMode
Definition: galbrws2.hxx:91
GalleryBrowserMode meLastMode
Definition: galbrws2.hxx:92
std::unique_ptr< GalleryIconView > mxIconView
Definition: galbrws2.hxx:79
void * GetData1() const
Definition: galmisc.hxx:195
GalleryHintType GetType() const
Definition: galmisc.hxx:192
static void drawTransparenceBackground(vcl::RenderContext &rOut, const Point &rPos, const Size &rSize)
Definition: galctrl.cxx:276
static void PreviewMedia(const INetURLObject &rURL)
Definition: galctrl.cxx:198
const OUString & GetName() const
Definition: galtheme.cxx:777
SAL_DLLPRIVATE void CopyToClipboard(const weld::Widget &rWidget, sal_uInt32 nPos)
Definition: galtheme.cxx:631
bool GetGraphic(sal_uInt32 nPos, Graphic &rGraphic)
Definition: galtheme.cxx:311
bool InsertObject(const SgaObject &rObj, sal_uInt32 nPos=SAL_MAX_UINT32)
Definition: galtheme.cxx:118
bool ChangeObjectPos(sal_uInt32 nOldPos, sal_uInt32 nNewPos)
Definition: galtheme.cxx:182
SAL_DLLPRIVATE bool InsertTransferable(const css::uno::Reference< css::datatransfer::XTransferable > &rxTransferable, sal_uInt32 nInsertPos)
Definition: galtheme.cxx:534
SAL_DLLPRIVATE sal_uInt32 GetDragPos() const
Definition: galtheme.hxx:110
bool IsReadOnly() const
Definition: galtheme.cxx:774
SAL_DLLPRIVATE const INetURLObject & GetObjectURL(sal_uInt32 nPos) const
Definition: galtheme.hxx:129
SAL_DLLPRIVATE sal_uInt32 GetObjectCount() const
Definition: galtheme.hxx:83
SAL_DLLPRIVATE bool IsDragging() const
Definition: galtheme.hxx:100
std::unique_ptr< SgaObject > AcquireObject(sal_uInt32 nPos)
Definition: galtheme.cxx:142
void RemoveObject(sal_uInt32 nPos)
Definition: galtheme.cxx:167
SAL_DLLPRIVATE SgaObjKind GetObjectKind(sal_uInt32 nPos) const
Definition: galtheme.hxx:122
SAL_DLLPRIVATE void SetPreviewBitmapExAndStrings(sal_uInt32 nPos, const BitmapEx &rBitmapEx, const Size &rSize, const OUString &rTitle, const OUString &rPath)
Definition: galtheme.cxx:157
SAL_DLLPRIVATE bool GetURL(sal_uInt32 nPos, INetURLObject &rURL)
Definition: galtheme.cxx:483
SAL_DLLPRIVATE void GetPreviewBitmapExAndStrings(sal_uInt32 nPos, BitmapEx &rBitmapEx, Size &rSize, OUString &rTitle, OUString &rPath)
Definition: galtheme.cxx:147
void ReleaseTheme(GalleryTheme *pTheme, SfxListener &rListener)
Definition: gallery1.cxx:711
GalleryTheme * AcquireTheme(std::u16string_view rThemeName, SfxListener &rListener)
Definition: gallery1.cxx:697
static GraphicFilter & GetGraphicFilter()
OUString GetImportFormatName(sal_uInt16 nFormat)
sal_uInt16 GetImportFormatNumberForShortName(std::u16string_view rShortName)
css::uno::Reference< css::graphic::XGraphic > GetXGraphic() const
bool IsNone() const
const vcl::KeyCode & GetKeyCode() const
css::uno::Reference< css::frame::XFrame > GetActiveFrame() const
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
SfxBindings & GetBindings()
constexpr tools::Long Height() const
constexpr tools::Long Width() const
static SvxAbstractDialogFactory * Create()
Definition: svxdlg.cxx:22
virtual VclPtr< AbstractTitleDialog > CreateTitleDialog(weld::Widget *pParent, const OUString &rOldText)=0
static TransferableDataHelper CreateFromClipboard(const css::uno::Reference< css::datatransfer::clipboard::XClipboard > &rClipboard)
const css::uno::Reference< css::datatransfer::XTransferable > & GetTransferable() const
sal_uInt16 GetCode() const
virtual void grab_focus()=0
virtual css::uno::Reference< css::datatransfer::clipboard::XClipboard > get_clipboard() const=0
ColorMode meMode
int nCount
Reference< XDispatch > xDispatch
URL aURL
virtual OUString GetURL() const override
float u
FilterGroup & rTarget
IMPL_LINK_NOARG(GalleryBrowser2, RowActivatedHdl, weld::TreeView &, bool)
Definition: galbrws2.cxx:394
IMPL_LINK(GalleryBrowser2, PopupMenuHdl, const CommandEvent &, rCEvt, bool)
Definition: galbrws2.cxx:381
IMPL_STATIC_LINK(GalleryBrowser2, AsyncDispatch_Impl, void *, p, void)
Definition: galbrws2.cxx:67
GalleryItemFlags
Definition: galbrws2.hxx:47
GalleryBrowserTravel
Definition: galbrws2.hxx:43
GalleryBrowserMode
Definition: galbrws2.hxx:34
@ GALLERYBROWSERMODE_PREVIEW
Definition: galbrws2.hxx:38
@ GALLERYBROWSERMODE_NONE
Definition: galbrws2.hxx:35
@ GALLERYBROWSERMODE_ICON
Definition: galbrws2.hxx:36
@ GALLERYBROWSERMODE_LIST
Definition: galbrws2.hxx:37
constexpr OUStringLiteral SVXGALLERYITEM_DRAWING
Definition: galleryitem.hxx:35
constexpr OUStringLiteral SVXGALLERYITEM_GRAPHIC
Definition: galleryitem.hxx:36
constexpr OUStringLiteral SVXGALLERYITEM_TYPE
Definition: galleryitem.hxx:32
constexpr OUStringLiteral SVXGALLERYITEM_FILTER
Definition: galleryitem.hxx:34
constexpr OUStringLiteral SVXGALLERYITEM_URL
Definition: galleryitem.hxx:33
#define SVXGALLERYITEM_PARAMS
Definition: galleryitem.hxx:37
constexpr OUStringLiteral SVXGALLERYITEM_ARGNAME
Definition: galleryitem.hxx:38
SgaObjKind
Definition: galmisc.hxx:57
#define GRFILTER_FORMAT_DONTKNOW
constexpr OUStringLiteral HID_GALLERY_LISTVIEW
Definition: helpids.h:31
constexpr OUStringLiteral HID_GALLERY_ICONVIEW
Definition: helpids.h:30
constexpr OUStringLiteral HID_GALLERY_WINDOW
Definition: helpids.h:34
Mode eMode
void * p
constexpr sal_uInt16 KEY_RETURN
constexpr sal_uInt16 KEY_I
constexpr sal_uInt16 KEY_T
constexpr sal_uInt16 KEY_D
constexpr sal_uInt16 KEY_DELETE
constexpr sal_uInt16 KEY_SPACE
constexpr sal_uInt16 KEY_P
constexpr sal_uInt16 KEY_INSERT
sal_uInt16 nPos
Sequence< sal_Int8 > aSeq
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
int i
sal_uInt32 toUInt32(std::u16string_view str, sal_Int16 radix=10)
const ::avmedia::MediaItem * Execute(const SdrMarkView *pSdrView, SfxRequest const &rReq)
constexpr OUStringLiteral EMPTY
sal_Int16 nId
QPRO_FUNC_TYPE nType
css::uno::Reference< css::frame::XDispatch > Dispatch
Definition: galbrws2.cxx:64
css::uno::Sequence< css::beans::PropertyValue > Arguments
Definition: galbrws2.cxx:63
css::util::URL TargetURL
Definition: galbrws2.cxx:62
const css::datatransfer::dnd::DropTargetDropEvent maDropEvent
Reference< XFrame > xFrame
#define DND_ACTION_COPY
#define DND_ACTION_LINK
#define DND_ACTION_NONE
signed char sal_Int8
OUString sId
RET_OK
RET_YES