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::string_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::string_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 == "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
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;
497
498 ImplSelectItemId( nItemId );
499
500 css::uno::Reference< css::frame::XFrame > xFrame( GetFrame() );
501 if ( !xFrame.is() )
502 return;
503
504 weld::Widget* pParent = GetViewWindow();
505 mnCurActionPos = nItemId - 1;
507 new GalleryThemePopup(
508 pParent,
512 this ) );
513 xPopup->ExecutePopup(pParent, aSelPos);
514}
515
517{
518 return mxIconButton->has_focus() || mxListButton->has_focus();
519}
520
522{
523 Point aSelPos;
524 const sal_uInt32 nItemId = ImplGetSelectedItemId( nullptr, aSelPos );
525 bool bRet = false;
526
527 if (!ViewBoxHasFocus() && nItemId && mpCurTheme)
528 {
529 OString sExecuteIdent;
531
532 mpCurTheme->GetURL( nItemId - 1, aURL );
533
534 const bool bValidURL = ( aURL.GetProtocol() != INetProtocol::NotValid );
535 bool bPreview = bValidURL;
536 bool bDelete = false;
537 bool bTitle = false;
538
540 {
541 bDelete = ( GALLERYBROWSERMODE_PREVIEW != GetMode() );
542 bTitle = true;
543 }
544
545 switch( rKEvt.GetKeyCode().GetCode() )
546 {
547 case KEY_SPACE:
548 case KEY_RETURN:
549 case KEY_P:
550 {
551 if( bPreview )
552 {
554 bRet = true;
555 }
556 }
557 break;
558
559 case KEY_INSERT:
560 case KEY_I:
561 {
562 // Inserting a gallery item in the document must be dispatched
563 if( bValidURL )
564 {
565 DispatchAdd(css::uno::Reference<css::frame::XDispatch>(), css::util::URL());
566 return true;
567 }
568 }
569 break;
570
571 case KEY_DELETE:
572 case KEY_D:
573 {
574 if( bDelete )
575 sExecuteIdent = "delete";
576 }
577 break;
578
579 case KEY_T:
580 {
581 if( bTitle )
582 sExecuteIdent = "title";
583 }
584 break;
585
586 default:
587 break;
588 }
589
590 if (!sExecuteIdent.isEmpty())
591 {
592 Execute(sExecuteIdent);
593 bRet = true;
594 }
595 }
596
597 return bRet;
598}
599
600void GalleryBrowser2::SelectTheme( std::u16string_view rThemeName )
601{
602 if( mpCurTheme )
604
605 mpCurTheme = mpGallery->AcquireTheme( rThemeName, *this );
606
607 m_xHelper.set(new GalleryTransferable(mpCurTheme, 0, true));
609 mxListView->enable_drag_source(xHelper, DND_ACTION_COPY | DND_ACTION_LINK);
610 mxIconView->SetDragDataTransferrable(xHelper, DND_ACTION_COPY | DND_ACTION_LINK);
611 mxPreview->SetDragDataTransferrable(xHelper, DND_ACTION_COPY | DND_ACTION_LINK);
612
613 mxIconView->SetTheme(mpCurTheme);
614 mxPreview->SetTheme(mpCurTheme);
615
618
619 ImplUpdateViews( 1 );
620
621 bool bIconMode = (GALLERYBROWSERMODE_ICON == GetMode());
622 mxIconButton->set_sensitive(true);
623 mxListButton->set_sensitive(true);
624 mxIconButton->set_active(bIconMode);
625 mxListButton->set_active(!bIconMode);
626}
627
629{
630 if( GetMode() == eMode )
631 return;
632
634
635 switch( eMode )
636 {
638 {
639 mxListView->hide();
640
641 mxPreview->Hide();
642 mxPreview->SetGraphic( Graphic() );
644
645 mxIconView->Show();
646
647 mxIconButton->set_sensitive(true);
648 mxListButton->set_sensitive(true);
649
650 mxIconButton->set_active(true);
651 mxListButton->set_active(false);
652 }
653 break;
654
656 {
657 mxIconView->Hide();
658
659 mxPreview->Hide();
660 mxPreview->SetGraphic( Graphic() );
662
663 mxListView->show();
664 UpdateRows(true);
665
666 mxIconButton->set_sensitive(true);
667 mxListButton->set_sensitive(true);
668
669 mxIconButton->set_active(false);
670 mxListButton->set_active(true);
671 }
672 break;
673
675 {
676 Graphic aGraphic;
677 Point aSelPos;
678 const sal_uInt32 nItemId = ImplGetSelectedItemId( nullptr, aSelPos );
679
680 if( nItemId )
681 {
682 const sal_uInt32 nPos = nItemId - 1;
683
684 mxIconView->Hide();
685 mxListView->hide();
686
687 if( mpCurTheme )
688 mpCurTheme->GetGraphic( nPos, aGraphic );
689
690 mxPreview->SetGraphic( aGraphic );
691 mxPreview->Show();
692
695
696 mxIconButton->set_sensitive(false);
697 mxListButton->set_sensitive(false);
698 }
699 }
700 break;
701
702 default:
703 break;
704 }
705
707}
708
710{
711 weld::Widget* pRet;
712
713 switch( GetMode() )
714 {
715 case GALLERYBROWSERMODE_LIST: pRet = mxListView.get(); break;
716 case GALLERYBROWSERMODE_PREVIEW: pRet = mxPreview->GetDrawingArea(); break;
717
718 default:
719 pRet = mxIconView->GetDrawingArea();
720 break;
721 }
722
723 return pRet;
724}
725
727{
728 if( !mpCurTheme )
729 return;
730
731 Point aSelPos;
732 const sal_uInt32 nItemId = ImplGetSelectedItemId( nullptr, aSelPos );
733
734 if( !nItemId )
735 return;
736
737 sal_uInt32 nNewItemId = nItemId;
738
739 switch( eTravel )
740 {
741 case GalleryBrowserTravel::First: nNewItemId = 1; break;
742 case GalleryBrowserTravel::Last: nNewItemId = mpCurTheme->GetObjectCount(); break;
743 case GalleryBrowserTravel::Previous: nNewItemId--; break;
744 case GalleryBrowserTravel::Next: nNewItemId++; break;
745 default:
746 break;
747 }
748
749 if( nNewItemId < 1 )
750 nNewItemId = 1;
751 else if( nNewItemId > mpCurTheme->GetObjectCount() )
752 nNewItemId = mpCurTheme->GetObjectCount();
753
754 if( nNewItemId == nItemId )
755 return;
756
757 ImplSelectItemId( nNewItemId );
759
761 return;
762
763 Graphic aGraphic;
764 const sal_uInt32 nPos = nNewItemId - 1;
765
766 mpCurTheme->GetGraphic( nPos, aGraphic );
767 mxPreview->SetGraphic( aGraphic );
768
771
772 mxPreview->Invalidate();
773}
774
775void GalleryBrowser2::ImplUpdateViews( sal_uInt16 nSelectionId )
776{
777 mxIconView->Hide();
778 mxListView->hide();
779 mxPreview->Hide();
780
781 mxIconView->Clear();
782 mxListView->clear();
783
784 if( mpCurTheme )
785 {
786 const int nAlwaysUpToDate = 15;
787
788 mxListView->freeze();
789
790 sal_uInt32 nCount = mpCurTheme->GetObjectCount();
791 for (sal_uInt32 i = 0; i < nCount; ++i)
792 {
793 mxIconView->InsertItem(i + 1); // skip reserved id 0
794 mxListView->append(OUString::number(i), ""); // create on-demand in VisRowsScrolledHdl
795
796 if (i == nAlwaysUpToDate) // fill in the first block
797 UpdateRows(false);
798 }
799
800 if (nCount < nAlwaysUpToDate) // if less than block size, fill in all of them
801 UpdateRows(false);
802
803 mxListView->thaw();
804
805 ImplSelectItemId( std::min<sal_uInt16>( nSelectionId, mpCurTheme->GetObjectCount() ) );
806 }
807
808 switch( GetMode() )
809 {
810 case GALLERYBROWSERMODE_ICON: mxIconView->Show(); break;
812 mxListView->show();
813 UpdateRows(true);
814 break;
815 case GALLERYBROWSERMODE_PREVIEW: mxPreview->Show(); break;
816
817 default:
818 break;
819 }
820
822}
823
824void GalleryBrowser2::UpdateRows(bool bVisibleOnly)
825{
826 auto lambda = [this](weld::TreeIter& rEntry){
827 // id is non-null if the preview is pending creation
828 OUString sId(mxListView->get_id(rEntry));
829 if (sId.isEmpty())
830 return false;
831
832 // get the icon for the listview
833 BitmapEx aBitmapEx;
834 Size aPreparedSize;
835
836 OUString sItemTextTitle;
837 OUString sItemTextPath;
838
839 sal_Int32 i = sId.toUInt32();
840 mpCurTheme->GetPreviewBitmapExAndStrings(i, aBitmapEx, aPreparedSize, sItemTextTitle, sItemTextPath);
841
842 bool bNeedToCreate(aBitmapEx.IsEmpty());
843 if (!bNeedToCreate && (sItemTextTitle.isEmpty() || aPreparedSize != maPreviewSize))
844 bNeedToCreate = true;
845
846 if (bNeedToCreate)
847 {
848 std::unique_ptr<SgaObject> xObj = mpCurTheme->AcquireObject(i);
849 if (xObj)
850 {
851 aBitmapEx = xObj->createPreviewBitmapEx(maPreviewSize);
854
855 mpCurTheme->SetPreviewBitmapExAndStrings(i, aBitmapEx, maPreviewSize, sItemTextTitle, sItemTextPath);
856 }
857 }
858
859 ScopedVclPtr<VirtualDevice> xDev(mxListView->create_virtual_device());
860 xDev->SetOutputSizePixel(maPreviewSize);
861
862 if (!aBitmapEx.IsEmpty())
863 {
864 const Size aBitmapExSizePixel(aBitmapEx.GetSizePixel());
865 const Point aPos(
866 ((maPreviewSize.Width() - aBitmapExSizePixel.Width()) >> 1),
867 ((maPreviewSize.Height() - aBitmapExSizePixel.Height()) >> 1));
868
869 if (aBitmapEx.IsAlpha())
870 {
871 // draw checkered background
872 GalleryIconView::drawTransparenceBackground(*xDev, aPos, aBitmapExSizePixel);
873 }
874
875 xDev->DrawBitmapEx(aPos, aBitmapEx);
876 }
877
878 mxListView->set_text(rEntry, sItemTextTitle);
879 mxListView->set_image(rEntry, *xDev);
880 mxListView->set_id(rEntry, OUString());
881
882 return false;
883 };
884
885 if (bVisibleOnly)
886 {
887 // ensure all visible entries are up to date
888 mxListView->visible_foreach(lambda);
889 // and ensure all selected entries are up to date
890 mxListView->selected_foreach(lambda);
891 return;
892 }
893
894 mxListView->all_foreach(lambda);
895}
896
898{
899 UpdateRows(true);
900}
901
902IMPL_LINK_NOARG(GalleryBrowser2, SizeAllocHdl, const Size&, void)
903{
904 UpdateRows(true);
905}
906
908{
909 if (!mpCurTheme)
910 return;
911 mxInfoBar->set_label( mpCurTheme->GetName() );
912}
913
915{
916 if (!mpCurTheme)
917 return;
918 auto nSelectedObject = (GALLERYBROWSERMODE_ICON == GetMode()) ? (mxIconView->GetSelectedItemId() - 1) : mxListView->get_selected_index();
919 m_xHelper->SelectObject(nSelectedObject);
920}
921
922sal_uInt32 GalleryBrowser2::ImplGetSelectedItemId( const Point* pSelPos, Point& rSelPos )
923{
924 sal_uInt32 nRet = 0;
925
927 {
928 nRet = ( ( GALLERYBROWSERMODE_ICON == meLastMode ) ? mxIconView->GetSelectedItemId() : ( mxListView->get_selected_index() + 1 ) );
929
930 if( pSelPos )
931 rSelPos = *pSelPos;
932 else
933 {
934 Size aOutputSizePixel(mxPreview->GetOutputSizePixel());
935 rSelPos = Point( aOutputSizePixel.Width() >> 1, aOutputSizePixel.Height() >> 1 );
936 }
937 }
938 else if (GALLERYBROWSERMODE_ICON == GetMode())
939 {
940 if (pSelPos)
941 {
942 nRet = mxIconView->GetItemId( *pSelPos );
943 rSelPos = *pSelPos;
944 }
945 else
946 {
947 nRet = mxIconView->GetSelectedItemId();
948 rSelPos = mxIconView->GetItemRect(nRet).Center();
949 }
950 }
951 else
952 {
953 std::unique_ptr<weld::TreeIter> xIter = mxListView->make_iterator();
954 if( pSelPos )
955 {
956 if (mxListView->get_dest_row_at_pos(*pSelPos, xIter.get(), false))
957 nRet = mxListView->get_iter_index_in_parent(*xIter) + 1;
958 rSelPos = *pSelPos;
959 }
960 else
961 {
962 if (mxListView->get_selected(xIter.get()))
963 {
964 nRet = mxListView->get_iter_index_in_parent(*xIter) + 1;
965 rSelPos = mxListView->get_row_area(*xIter).Center();
966 }
967 }
968 }
969
970 if( nRet && ( !mpCurTheme || ( nRet > mpCurTheme->GetObjectCount() ) ) )
971 {
972 nRet = 0;
973 }
974
975 return nRet;
976}
977
978void GalleryBrowser2::ImplSelectItemId(sal_uInt32 nItemId)
979{
980 if( nItemId )
981 {
982 mxIconView->SelectItem(nItemId);
983 mxListView->select( nItemId - 1 );
985 }
986}
987
988css::uno::Reference< css::frame::XFrame >
990{
991 css::uno::Reference< css::frame::XFrame > xFrame;
992 SfxViewFrame* pCurrentViewFrame = SfxViewFrame::Current();
993 if ( pCurrentViewFrame )
994 {
995 SfxBindings& rBindings = pCurrentViewFrame->GetBindings();
996 xFrame.set( rBindings.GetActiveFrame() );
997 }
998
999 return xFrame;
1000}
1001
1003 const css::uno::Reference< css::frame::XDispatch > &rxDispatch,
1004 const css::util::URL &rURL)
1005{
1006 Point aSelPos;
1007 const sal_uInt32 nItemId = ImplGetSelectedItemId( nullptr, aSelPos );
1008
1009 if( !mpCurTheme || !nItemId )
1010 return;
1011
1012 mnCurActionPos = nItemId - 1;
1013
1014 css::uno::Reference< css::frame::XDispatch > xDispatch( rxDispatch );
1015 css::util::URL aURL = rURL;
1016
1017 if ( !xDispatch.is() )
1018 {
1019 css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider(
1020 GetFrame(), css::uno::UNO_QUERY );
1021 if ( !xDispatchProvider.is() || !m_xTransformer.is() )
1022 return;
1023
1024 aURL.Complete = ".uno:InsertGalleryPic";
1025 m_xTransformer->parseStrict( aURL );
1026 xDispatch = xDispatchProvider->queryDispatch(
1027 aURL,
1028 "_self",
1029 css::frame::FrameSearchFlag::SELF );
1030 }
1031
1032 if ( !xDispatch.is() )
1033 return;
1034
1035 sal_Int8 nType = 0;
1036 OUString aFilterName;
1037 css::uno::Reference< css::lang::XComponent > xDrawing;
1038 css::uno::Reference< css::graphic::XGraphic > xGraphic;
1039
1040 aFilterName = GetFilterName();
1041
1043 {
1044 case SgaObjKind::Bitmap:
1046 case SgaObjKind::Inet:
1047 // TODO drawing objects are inserted as drawings only via drag&drop
1048 case SgaObjKind::SvDraw:
1049 nType = css::gallery::GalleryItemType::GRAPHIC;
1050 break;
1051
1052 case SgaObjKind::Sound :
1053 nType = css::gallery::GalleryItemType::MEDIA;
1054 break;
1055
1056 default:
1058 break;
1059 }
1060
1061 Graphic aGraphic;
1062 bool bGraphic = mpCurTheme->GetGraphic( mnCurActionPos, aGraphic );
1063 if ( bGraphic && !aGraphic.IsNone() )
1064 xGraphic.set( aGraphic.GetXGraphic() );
1065 OSL_ENSURE( xGraphic.is(), "gallery item is graphic, but the reference is invalid!" );
1066
1067 css::uno::Sequence< css::beans::PropertyValue > aSeq{
1073 };
1074 assert(aSeq.getLength() == SVXGALLERYITEM_PARAMS);
1075
1076 css::uno::Sequence< css::beans::PropertyValue > aArgs{ comphelper::makePropertyValue(
1078
1079 std::unique_ptr<DispatchInfo> pInfo(new DispatchInfo);
1080 pInfo->TargetURL = aURL;
1081 pInfo->Arguments = aArgs;
1082 pInfo->Dispatch = xDispatch;
1083
1085 LINK( nullptr, GalleryBrowser2, AsyncDispatch_Impl), pInfo.get() ) )
1086 pInfo.release();
1087}
1088
1089void GalleryBrowser2::Execute(std::string_view rIdent)
1090{
1091 Point aSelPos;
1092 const sal_uInt32 nItemId = ImplGetSelectedItemId( nullptr, aSelPos );
1093
1094 if( !(mpCurTheme && nItemId) )
1095 return;
1096
1097 mnCurActionPos = nItemId - 1;
1098
1099 if (rIdent == "preview")
1101 else if (rIdent == "delete")
1102 {
1103 if (!mpCurTheme->IsReadOnly())
1104 {
1105 std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetViewWindow(), "svx/ui/querydeleteobjectdialog.ui"));
1106 std::unique_ptr<weld::MessageDialog> xQuery(xBuilder->weld_message_dialog("QueryDeleteObjectDialog"));
1107 if (xQuery->run() == RET_YES)
1108 {
1110 }
1111 }
1112 }
1113 else if (rIdent == "title")
1114 {
1115 std::unique_ptr<SgaObject> pObj = mpCurTheme->AcquireObject( mnCurActionPos );
1116
1117 if( pObj )
1118 {
1119 const OUString aOldTitle( GetItemText( *pObj, GalleryItemFlags::Title ) );
1120
1123 if( aDlg->Execute() == RET_OK )
1124 {
1125 OUString aNewTitle( aDlg->GetTitle() );
1126
1127 if( ( aNewTitle.isEmpty() && !pObj->GetTitle().isEmpty() ) || ( aNewTitle != aOldTitle ) )
1128 {
1129 if( aNewTitle.isEmpty() )
1130 aNewTitle = "__<empty>__";
1131
1132 pObj->SetTitle( aNewTitle );
1133 mpCurTheme->InsertObject( *pObj );
1134 }
1135 }
1136 }
1137 }
1138 else if (rIdent == "copy")
1139 {
1141 }
1142 else if (rIdent == "paste")
1143 {
1144 if( !mpCurTheme->IsReadOnly() )
1145 {
1146 weld::Widget* pParent = GetViewWindow();
1149 }
1150 }
1151}
1152
1153OUString GalleryBrowser2::GetItemText( const SgaObject& rObj, GalleryItemFlags nItemTextFlags )
1154{
1155 OUString aRet;
1156
1157 const INetURLObject& aURL(rObj.GetURL());
1158
1159 if( nItemTextFlags & GalleryItemFlags::Title )
1160 {
1161 OUString aTitle( rObj.GetTitle() );
1162
1163 if( aTitle.isEmpty() )
1165
1166 if( aTitle.isEmpty() )
1167 {
1169 aTitle = aTitle.copy( aTitle.lastIndexOf('/')+1 );
1170 }
1171
1172 aRet += aTitle;
1173 }
1174
1175 if( nItemTextFlags & GalleryItemFlags::Path )
1176 {
1177 const OUString aPath( aURL.getFSysPath( FSysStyle::Detect ) );
1178
1179 if( !aPath.isEmpty() && ( nItemTextFlags & GalleryItemFlags::Title ) )
1180 aRet += " (";
1181
1182 aRet += aURL.getFSysPath( FSysStyle::Detect );
1183
1184 if( !aPath.isEmpty() && ( nItemTextFlags & GalleryItemFlags::Title ) )
1185 aRet += ")";
1186 }
1187
1188 return aRet;
1189}
1190
1192{
1194
1195 if( mpCurTheme && mnCurActionPos != 0xffffffff )
1197
1198 return aURL;
1199}
1200
1202{
1203 OUString aFilterName;
1204
1205 if( mpCurTheme && mnCurActionPos != 0xffffffff )
1206 {
1208
1209 if( ( SgaObjKind::Bitmap == eObjKind ) || ( SgaObjKind::Animation == eObjKind ) )
1210 {
1214 sal_uInt16 nFilter = rFilter.GetImportFormatNumberForShortName(aURL.GetFileExtension());
1215
1216 if( GRFILTER_FORMAT_DONTKNOW != nFilter )
1217 aFilterName = rFilter.GetImportFormatName( nFilter );
1218 }
1219 }
1220
1221 return aFilterName;
1222}
1223
1224IMPL_LINK_NOARG(GalleryBrowser2, SelectObjectValueSetHdl, ValueSet*, void)
1225{
1226 ImplUpdateSelection();
1227}
1228
1230{
1231 ImplUpdateSelection();
1232}
1233
1234IMPL_LINK(GalleryBrowser2, SelectTbxHdl, weld::Toggleable&, rBox, void)
1235{
1236 if (&rBox == mxIconButton.get())
1237 SetMode(rBox.get_active() ? GALLERYBROWSERMODE_ICON : GALLERYBROWSERMODE_LIST);
1238 else if (&rBox == mxListButton.get())
1239 SetMode(rBox.get_active() ? GALLERYBROWSERMODE_LIST : GALLERYBROWSERMODE_ICON);
1240}
1241
1242/* 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:1201
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:726
static css::uno::Reference< css::frame::XFrame > GetFrame()
Definition: galbrws2.cxx:989
void ShowContextMenu(const CommandEvent &rCEvt)
Definition: galbrws2.cxx:489
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:824
void ImplUpdateSelection()
Definition: galbrws2.cxx:914
void SelectTheme(std::u16string_view rThemeName)
Definition: galbrws2.cxx:600
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:516
rtl::Reference< GalleryTransferable > m_xHelper
Definition: galbrws2.hxx:89
void ImplSelectItemId(sal_uInt32 nItemId)
Definition: galbrws2.cxx:978
void ImplUpdateViews(sal_uInt16 nSelectionId)
Definition: galbrws2.cxx:775
std::unique_ptr< weld::TreeView > mxListView
Definition: galbrws2.hxx:81
weld::Widget * GetViewWindow() const
Definition: galbrws2.cxx:709
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:1002
bool StartDrag()
Definition: galbrws2.cxx:470
void ImplUpdateInfoBar()
Definition: galbrws2.cxx:907
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: galbrws2.cxx:406
void SetMode(GalleryBrowserMode eMode)
Definition: galbrws2.cxx:628
bool KeyInput(const KeyEvent &rEvt)
Definition: galbrws2.cxx:521
css::uno::Reference< css::util::XURLTransformer > m_xTransformer
Definition: galbrws2.hxx:95
static OUString GetItemText(const SgaObject &rObj, GalleryItemFlags nItemTextFlags)
Definition: galbrws2.cxx:1153
sal_uInt32 ImplGetSelectedItemId(const Point *pSelPosPixel, Point &rSelPos)
Definition: galbrws2.cxx:922
INetURLObject GetURL() const
Definition: galbrws2.cxx:1191
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
void Execute(std::string_view rIdent)
Definition: galbrws2.cxx:1089
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:194
GalleryHintType GetType() const
Definition: galmisc.hxx:191
static void drawTransparenceBackground(vcl::RenderContext &rOut, const Point &rPos, const Size &rSize)
Definition: galctrl.cxx:275
static void PreviewMedia(const INetURLObject &rURL)
Definition: galctrl.cxx:198
const OUString & GetName() const
Definition: galtheme.cxx:778
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:109
bool IsReadOnly() const
Definition: galtheme.cxx:775
SAL_DLLPRIVATE const INetURLObject & GetObjectURL(sal_uInt32 nPos) const
Definition: galtheme.hxx:128
SAL_DLLPRIVATE sal_uInt32 GetObjectCount() const
Definition: galtheme.hxx:82
SAL_DLLPRIVATE bool IsDragging() const
Definition: galtheme.hxx:99
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:121
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:708
GalleryTheme * AcquireTheme(std::u16string_view rThemeName, SfxListener &rListener)
Definition: gallery1.cxx:694
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 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
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:56
#define GRFILTER_FORMAT_DONTKNOW
constexpr OStringLiteral HID_GALLERY_WINDOW
Definition: helpids.h:34
constexpr OStringLiteral HID_GALLERY_LISTVIEW
Definition: helpids.h:31
constexpr OStringLiteral HID_GALLERY_ICONVIEW
Definition: helpids.h:30
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