LibreOffice Module sfx2 (master) 1
sfxbasecontroller.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 <time.h>
22#include <com/sun/star/awt/XVclWindowPeer.hpp>
23#include <com/sun/star/beans/XPropertySet.hpp>
24#include <com/sun/star/util/XCloseable.hpp>
25#include <com/sun/star/util/XCloseBroadcaster.hpp>
26#include <com/sun/star/util/XCloseListener.hpp>
27#include <com/sun/star/util/CloseVetoException.hpp>
28#include <com/sun/star/document/XCmisDocument.hpp>
29#include <com/sun/star/document/XViewDataSupplier.hpp>
31#include <com/sun/star/frame/FrameActionEvent.hpp>
32#include <com/sun/star/frame/FrameAction.hpp>
33#include <com/sun/star/frame/FrameSearchFlag.hpp>
34#include <com/sun/star/frame/CommandGroup.hpp>
35#include <com/sun/star/frame/XFrame.hpp>
36#include <com/sun/star/frame/XBorderResizeListener.hpp>
37#include <com/sun/star/frame/XUntitledNumbers.hpp>
38#include <com/sun/star/lang/DisposedException.hpp>
39#include <com/sun/star/lang/EventObject.hpp>
40#include <com/sun/star/lang/XEventListener.hpp>
41#include <com/sun/star/lang/XComponent.hpp>
42#include <com/sun/star/container/XIndexAccess.hpp>
45#include <sfx2/viewsh.hxx>
46#include <sfx2/docfac.hxx>
47#include <sfx2/viewfrm.hxx>
48#include <sfx2/objsh.hxx>
49#include <sfx2/app.hxx>
50#include <sfx2/msgpool.hxx>
51#include <sfx2/dispatch.hxx>
53
54#include <unoctitm.hxx>
55#include <sfx2/childwin.hxx>
56#include <sfx2/sfxsids.hrc>
57#include <sfx2/sfxresid.hxx>
58#include <workwin.hxx>
59#include <sfx2/infobar.hxx>
60
61#include <osl/mutex.hxx>
68#include <vcl/svapp.hxx>
69#include <tools/svborder.hxx>
70
71#include <sfx2/event.hxx>
72#include <sfx2/viewfac.hxx>
73#include <sfx2/strings.hrc>
75
76#include <unordered_map>
77
78#include <com/sun/star/ui/XSidebarProvider.hpp>
80
81#define TIMEOUT_START_RESCHEDULE 10L /* 10th s */
82
83using namespace ::com::sun::star;
84using ::com::sun::star::uno::Reference;
85using ::com::sun::star::uno::RuntimeException;
86using ::com::sun::star::uno::UNO_QUERY_THROW;
87using ::com::sun::star::lang::DisposedException;
88using ::com::sun::star::awt::XWindow;
89using ::com::sun::star::frame::XController;
90using ::com::sun::star::frame::XDispatchProvider;
91using ::com::sun::star::document::XViewDataSupplier;
92using ::com::sun::star::container::XIndexAccess;
93using ::com::sun::star::beans::PropertyValue;
94using ::com::sun::star::beans::StringPair;
95using ::com::sun::star::uno::Sequence;
96using ::com::sun::star::uno::UNO_QUERY;
97using ::com::sun::star::uno::Exception;
98using ::com::sun::star::frame::XFrame;
99using ::com::sun::star::frame::XFrameActionListener;
100using ::com::sun::star::util::XCloseListener;
101using ::com::sun::star::task::XStatusIndicator;
102using ::com::sun::star::frame::XTitle;
103using ::com::sun::star::ui::XSidebarProvider;
104
105
106typedef std::unordered_map< SfxGroupId, sal_Int16 > GroupHashMap;
107
109{
110 static GroupHashMap s_aHashMap
111 {
112 { SfxGroupId::Intern , frame::CommandGroup::INTERNAL },
113 { SfxGroupId::Application , frame::CommandGroup::APPLICATION },
114 { SfxGroupId::Document , frame::CommandGroup::DOCUMENT },
115 { SfxGroupId::View , frame::CommandGroup::VIEW },
116 { SfxGroupId::Edit , frame::CommandGroup::EDIT },
117 { SfxGroupId::Macro , frame::CommandGroup::MACRO },
118 { SfxGroupId::Options , frame::CommandGroup::OPTIONS },
119 { SfxGroupId::Math , frame::CommandGroup::MATH },
120 { SfxGroupId::Navigator , frame::CommandGroup::NAVIGATOR },
121 { SfxGroupId::Insert , frame::CommandGroup::INSERT },
122 { SfxGroupId::Format , frame::CommandGroup::FORMAT },
123 { SfxGroupId::Template , frame::CommandGroup::TEMPLATE },
124 { SfxGroupId::Text , frame::CommandGroup::TEXT },
126 { SfxGroupId::Graphic , frame::CommandGroup::GRAPHIC },
127 { SfxGroupId::Table , frame::CommandGroup::TABLE },
128 { SfxGroupId::Enumeration , frame::CommandGroup::ENUMERATION },
129 { SfxGroupId::Data , frame::CommandGroup::DATA },
130 { SfxGroupId::Special , frame::CommandGroup::SPECIAL },
131 { SfxGroupId::Image , frame::CommandGroup::IMAGE },
132 { SfxGroupId::Chart , frame::CommandGroup::CHART },
133 { SfxGroupId::Explorer , frame::CommandGroup::EXPLORER },
134 { SfxGroupId::Connector , frame::CommandGroup::CONNECTOR },
135 { SfxGroupId::Modify , frame::CommandGroup::MODIFY },
136 { SfxGroupId::Drawing , frame::CommandGroup::DRAWING },
137 { SfxGroupId::Controls , frame::CommandGroup::CONTROLS },
138 };
139
140
141 GroupHashMap::const_iterator pIter = s_aHashMap.find( nGroupID );
142 if ( pIter != s_aHashMap.end() )
143 return pIter->second;
144 else
145 return frame::CommandGroup::INTERNAL;
146}
147
148sal_uInt32 Get10ThSec()
149{
150 sal_uInt32 n10Ticks = 10 * static_cast<sal_uInt32>(clock());
151 return n10Ticks / CLOCKS_PER_SEC;
152}
153
154static sal_Int32 m_nInReschedule = 0;
155
156static void reschedule()
157{
158 if ( m_nInReschedule == 0 )
159 {
163 }
164}
165
166namespace {
167
168class SfxStatusIndicator : public ::cppu::WeakImplHelper< task::XStatusIndicator, lang::XEventListener >
169{
170 Reference < XController > xOwner;
171 Reference < task::XStatusIndicator > xProgress;
172 SfxWorkWindow* pWorkWindow;
173 tools::Long _nStartTime;
174public:
175 SfxStatusIndicator(SfxBaseController* pController, SfxWorkWindow* pWork)
176 : xOwner( pController )
177 , pWorkWindow( pWork )
178 , _nStartTime(0)
179 {
180 osl_atomic_increment(&m_refCount);
181 Reference< lang::XComponent > xComponent = pController;
182 if (xComponent.is())
183 xComponent->addEventListener(this);
184 osl_atomic_decrement(&m_refCount);
185 }
186
187 virtual void SAL_CALL start(const OUString& aText, sal_Int32 nRange) override;
188 virtual void SAL_CALL end() override;
189 virtual void SAL_CALL setText(const OUString& aText) override;
190 virtual void SAL_CALL setValue(sal_Int32 nValue) override;
191 virtual void SAL_CALL reset() override;
192
193 virtual void SAL_CALL disposing( const lang::EventObject& Source ) override;
194};
195
196}
197
198void SAL_CALL SfxStatusIndicator::start(const OUString& aText, sal_Int32 nRange)
199{
200 SolarMutexGuard aGuard;
201 if ( xOwner.is() )
202 {
203 if ( !xProgress.is() )
204 xProgress = pWorkWindow->GetStatusIndicator();
205
206 if ( xProgress.is() )
207 xProgress->start( aText, nRange );
208
209 _nStartTime = Get10ThSec();
210 reschedule();
211 }
212}
213
214void SAL_CALL SfxStatusIndicator::end()
215{
216 SolarMutexGuard aGuard;
217 if ( xOwner.is() )
218 {
219 if ( !xProgress.is() )
220 xProgress = pWorkWindow->GetStatusIndicator();
221
222 if ( xProgress.is() )
223 xProgress->end();
224
225 reschedule();
226 }
227}
228
229void SAL_CALL SfxStatusIndicator::setText(const OUString& aText)
230{
231 SolarMutexGuard aGuard;
232 if ( xOwner.is() )
233 {
234 if ( !xProgress.is() )
235 xProgress = pWorkWindow->GetStatusIndicator();
236
237 if ( xProgress.is() )
238 xProgress->setText( aText );
239
240 reschedule();
241 }
242}
243
244void SAL_CALL SfxStatusIndicator::setValue( sal_Int32 nValue )
245{
246 SolarMutexGuard aGuard;
247 if ( xOwner.is() )
248 {
249 if ( !xProgress.is() )
250 xProgress = pWorkWindow->GetStatusIndicator();
251
252 if ( xProgress.is() )
253 xProgress->setValue( nValue );
254
255 bool bReschedule = (( Get10ThSec() - _nStartTime ) > TIMEOUT_START_RESCHEDULE );
256 if ( bReschedule )
257 reschedule();
258 }
259}
260
261void SAL_CALL SfxStatusIndicator::reset()
262{
263 SolarMutexGuard aGuard;
264 if ( xOwner.is() )
265 {
266 if ( !xProgress.is() )
267 xProgress = pWorkWindow->GetStatusIndicator();
268
269 if ( xProgress.is() )
270 xProgress->reset();
271
272 reschedule();
273 }
274}
275
276void SAL_CALL SfxStatusIndicator::disposing( const lang::EventObject& /*Source*/ )
277{
278 SolarMutexGuard aGuard;
279 xOwner = nullptr;
280 xProgress.clear();
281}
282
283
284// declaration IMPL_SfxBaseController_ListenerHelper
285
286namespace {
287
288class IMPL_SfxBaseController_ListenerHelper : public ::cppu::WeakImplHelper< frame::XFrameActionListener >
289{
290public:
291 explicit IMPL_SfxBaseController_ListenerHelper( SfxBaseController* pController ) ;
292
293 virtual void SAL_CALL frameAction( const frame::FrameActionEvent& aEvent ) override ;
294 virtual void SAL_CALL disposing( const lang::EventObject& aEvent ) override ;
295
296private:
297
298 SfxBaseController* m_pController ;
299
300} ; // class IMPL_SfxBaseController_ListenerContainer
301
302class IMPL_SfxBaseController_CloseListenerHelper : public ::cppu::WeakImplHelper< util::XCloseListener >
303{
304public:
305 explicit IMPL_SfxBaseController_CloseListenerHelper( SfxBaseController* pController ) ;
306
307 virtual void SAL_CALL queryClosing( const lang::EventObject& aEvent, sal_Bool bDeliverOwnership ) override ;
308 virtual void SAL_CALL notifyClosing( const lang::EventObject& aEvent ) override ;
309 virtual void SAL_CALL disposing( const lang::EventObject& aEvent ) override ;
310
311private:
312
313 SfxBaseController* m_pController;
314
315} ; // class IMPL_SfxBaseController_ListenerContainer
316
317}
318
319IMPL_SfxBaseController_CloseListenerHelper::IMPL_SfxBaseController_CloseListenerHelper( SfxBaseController* pController )
320 : m_pController ( pController )
321{
322}
323
324void SAL_CALL IMPL_SfxBaseController_CloseListenerHelper::disposing( const lang::EventObject& /*aEvent*/ )
325{
326}
327
328void SAL_CALL IMPL_SfxBaseController_CloseListenerHelper::queryClosing( const lang::EventObject& /*aEvent*/, sal_Bool /*bDeliverOwnership*/ )
329{
330 SolarMutexGuard aGuard;
331 SfxViewShell* pShell = m_pController->GetViewShell_Impl();
332 if (pShell)
333 {
334 bool bCanClose = pShell->PrepareClose( false );
335 if ( !bCanClose )
336 {
337 throw util::CloseVetoException("Controller disagree ...",getXWeak());
338 }
339 }
340}
341
342void SAL_CALL IMPL_SfxBaseController_CloseListenerHelper::notifyClosing( const lang::EventObject& /*aEvent*/ )
343{
344}
345
346
347// declaration IMPL_SfxBaseController_DataContainer
348
349
351{
352 Reference< XFrame > m_xFrame ;
353 Reference< XFrameActionListener > m_xListener ;
354 Reference< XCloseListener > m_xCloseListener ;
358 Reference< XStatusIndicator > m_xIndicator ;
363 Reference< XTitle > m_xTitleHelper ;
364 Sequence< PropertyValue > m_aCreationArgs ;
365
367 SfxViewShell* pViewShell ,
368 SfxBaseController* pController )
369 : m_xListener ( new IMPL_SfxBaseController_ListenerHelper( pController ) )
370 , m_xCloseListener ( new IMPL_SfxBaseController_CloseListenerHelper( pController ) )
371 , m_aUserInputInterception ( *pController, aMutex )
374 , m_pViewShell ( pViewShell )
375 , m_pController ( pController )
376 , m_bDisposing ( false )
377 , m_bSuspendState ( false )
378 {
379 }
380
381} ; // struct IMPL_SfxBaseController_DataContainer
382
383
384// IMPL_SfxBaseController_ListenerHelper constructor
385
386
387IMPL_SfxBaseController_ListenerHelper::IMPL_SfxBaseController_ListenerHelper( SfxBaseController* pController )
388 : m_pController ( pController )
389{
390}
391
392void SAL_CALL IMPL_SfxBaseController_ListenerHelper::frameAction( const frame::FrameActionEvent& aEvent )
393{
394 SolarMutexGuard aGuard;
395 if (
396 ( m_pController != nullptr ) &&
397 ( aEvent.Frame == m_pController->getFrame() ) &&
398 ( m_pController->GetViewShell_Impl() && m_pController->GetViewShell_Impl()->GetWindow() != nullptr )
399 )
400 {
401 if ( aEvent.Action == frame::FrameAction_FRAME_UI_ACTIVATED )
402 {
403 if ( !m_pController->GetViewShell_Impl()->GetUIActiveIPClient_Impl() )
404 m_pController->GetViewShell_Impl()->GetViewFrame().MakeActive_Impl( false );
405 }
406 else if ( aEvent.Action == frame::FrameAction_CONTEXT_CHANGED )
407 {
408 m_pController->GetViewShell_Impl()->GetViewFrame().GetBindings().ContextChanged_Impl();
409 }
410 }
411}
412
413
414// IMPL_SfxBaseController_ListenerHelper -> XEventListener
415
416
417void SAL_CALL IMPL_SfxBaseController_ListenerHelper::disposing( const lang::EventObject& /*aEvent*/ )
418{
419 SolarMutexGuard aGuard;
420 if ( m_pController && m_pController->getFrame().is() )
421 m_pController->getFrame()->removeFrameActionListener( this ) ;
422}
423
425 : m_pData ( new IMPL_SfxBaseController_DataContainer( m_aMutex, pViewShell, this ))
426{
427 m_pData->m_pViewShell->SetController( this );
428}
429
430
431// SfxBaseController -> destructor
432
433
435{
436}
437
438
439// SfxBaseController -> XController2
440
441
442Reference< XWindow > SAL_CALL SfxBaseController::getComponentWindow()
443{
444 SolarMutexGuard aGuard;
445 if ( !m_pData->m_pViewShell )
446 throw DisposedException();
447
448 return Reference< XWindow >( GetViewFrame_Impl().GetFrame().GetWindow().GetComponentInterface(), UNO_QUERY_THROW );
449}
450
452{
453 SolarMutexGuard aGuard;
454 if ( !m_pData->m_pViewShell || !m_pData->m_pViewShell->GetObjectShell() )
455 throw DisposedException();
456
457 const SfxObjectFactory& rDocFac( m_pData->m_pViewShell->GetObjectShell()->GetFactory() );
458 sal_uInt16 nViewNo = rDocFac.GetViewNo_Impl( GetViewFrame_Impl().GetCurViewId(), rDocFac.GetViewFactoryCount() );
459 OSL_ENSURE( nViewNo < rDocFac.GetViewFactoryCount(), "SfxBaseController::getViewControllerName: view ID not found in view factories!" );
460
461 OUString sViewName;
462 if ( nViewNo < rDocFac.GetViewFactoryCount() )
463 sViewName = rDocFac.GetViewFactory( nViewNo ).GetAPIViewName();
464
465 return sViewName;
466}
467
468Sequence< PropertyValue > SAL_CALL SfxBaseController::getCreationArguments()
469{
470 SolarMutexGuard aGuard;
471 if ( !m_pData->m_pViewShell || !m_pData->m_pViewShell->GetObjectShell() )
472 throw DisposedException();
473
474 return m_pData->m_aCreationArgs;
475}
476
477void SfxBaseController::SetCreationArguments_Impl( const Sequence< PropertyValue >& i_rCreationArgs )
478{
479 OSL_ENSURE( !m_pData->m_aCreationArgs.hasElements(), "SfxBaseController::SetCreationArguments_Impl: not intended to be called twice!" );
480 m_pData->m_aCreationArgs = i_rCreationArgs;
481}
482
484{
485 ENSURE_OR_THROW( m_pData->m_pViewShell, "not to be called without a view shell" );
486 SfxViewFrame* pActFrame = m_pData->m_pViewShell->GetFrame();
487 ENSURE_OR_THROW( pActFrame, "a view shell without a view frame is pretty pathological" );
488 return *pActFrame;
489}
490
491
492Reference<XSidebarProvider> SAL_CALL SfxBaseController::getSidebar()
493{
494 SfxViewFrame& rViewFrame = GetViewFrame_Impl();
495 SfxFrame& rFrame = rViewFrame.GetFrame();
496
497 Reference<XSidebarProvider> rSidebar = new SfxUnoSidebar(rFrame.GetFrameInterface());
498 return rSidebar;
499}
500
501
502// SfxBaseController -> XController2 -> XController
503
504
505void SAL_CALL SfxBaseController::attachFrame( const Reference< frame::XFrame >& xFrame )
506{
507 Reference< frame::XFrame > xTemp( getFrame() ) ;
508
509 SolarMutexGuard aGuard;
510 if ( xTemp.is() )
511 {
512 xTemp->removeFrameActionListener( m_pData->m_xListener ) ;
513 Reference < util::XCloseBroadcaster > xCloseable( xTemp, uno::UNO_QUERY );
514 if ( xCloseable.is() )
515 xCloseable->removeCloseListener( m_pData->m_xCloseListener );
516 }
517
518 m_pData->m_xFrame = xFrame;
519
520 if ( !xFrame.is() )
521 return;
522
523 xFrame->addFrameActionListener( m_pData->m_xListener ) ;
524 Reference < util::XCloseBroadcaster > xCloseable( xFrame, uno::UNO_QUERY );
525 if ( xCloseable.is() )
526 xCloseable->addCloseListener( m_pData->m_xCloseListener );
527
528 if ( m_pData->m_pViewShell )
529 {
531 ShowInfoBars( );
532
533 // attaching the frame to the controller is the last step in the creation of a new view, so notify this
534 SfxViewEventHint aHint( SfxEventHintId::ViewCreated, GlobalEventConfig::GetEventName( GlobalEventId::VIEWCREATED ), m_pData->m_pViewShell->GetObjectShell(), Reference< frame::XController2 >( this ) );
535 SfxGetpApp()->NotifyEvent( aHint );
536 }
537}
538
539
540// SfxBaseController -> XController
541
542
543sal_Bool SAL_CALL SfxBaseController::attachModel( const Reference< frame::XModel >& xModel )
544{
545 if ( m_pData->m_pViewShell && xModel.is() && xModel != m_pData->m_pViewShell->GetObjectShell()->GetModel() )
546 {
547 // don't allow to reattach a model!
548 OSL_FAIL("Can't reattach model!");
549 return false;
550 }
551
552 Reference < util::XCloseBroadcaster > xCloseable( xModel, uno::UNO_QUERY );
553 if ( xCloseable.is() )
554 xCloseable->addCloseListener( m_pData->m_xCloseListener );
555 return true;
556}
557
558
559// SfxBaseController -> XController
560
561
563{
564 SolarMutexGuard aGuard;
565
566 // ignore duplicate calls, which doesn't change anything real
567 if (bool(bSuspend) == m_pData->m_bSuspendState)
568 return true;
569
570 if ( bSuspend )
571 {
572 if ( !m_pData->m_pViewShell )
573 {
574 m_pData->m_bSuspendState = true;
575 return true;
576 }
577
578 if ( !m_pData->m_pViewShell->PrepareClose() )
579 return false;
580
581 if ( getFrame().is() )
582 getFrame()->removeFrameActionListener( m_pData->m_xListener ) ;
583 SfxViewFrame* pActFrame = m_pData->m_pViewShell->GetFrame() ;
584
585 // More Views on the same document?
586 SfxObjectShell* pDocShell = m_pData->m_pViewShell->GetObjectShell() ;
587 bool bOther = false ;
588
589 for ( const SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell ); !bOther && pFrame; pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell ) )
590 bOther = (pFrame != pActFrame);
591
592 bool bRet = bOther || pDocShell->PrepareClose();
593 if ( bRet )
594 {
596 m_pData->m_bSuspendState = true;
597 }
598
599 return bRet;
600 }
601 else
602 {
603 if ( getFrame().is() )
604 getFrame()->addFrameActionListener( m_pData->m_xListener ) ;
605
606 if ( m_pData->m_pViewShell )
607 {
609 }
610
611 m_pData->m_bSuspendState = false;
612 return true ;
613 }
614}
615
616
617// SfxBaseController -> XController
618
619
621{
622 uno::Any aAny;
623 SolarMutexGuard aGuard;
624 if ( m_pData->m_pViewShell )
625 {
626 OUString sData;
627 m_pData->m_pViewShell->WriteUserData( sData ) ;
628 aAny <<= sData ;
629 }
630
631 return aAny ;
632}
633
634
635// SfxBaseController -> XController
636
637
638void SAL_CALL SfxBaseController::restoreViewData( const uno::Any& aValue )
639{
640 SolarMutexGuard aGuard;
641 if ( m_pData->m_pViewShell )
642 {
643 OUString sData;
644 aValue >>= sData ;
645 m_pData->m_pViewShell->ReadUserData( sData ) ;
646 }
647}
648
649
650// SfxBaseController -> XController
651
652
653Reference< frame::XFrame > SAL_CALL SfxBaseController::getFrame()
654{
655 SolarMutexGuard aGuard;
656 return m_pData->m_xFrame;
657}
658
659
660// SfxBaseController -> XController
661
662
663Reference< frame::XModel > SAL_CALL SfxBaseController::getModel()
664{
665 SolarMutexGuard aGuard;
666 return m_pData->m_pViewShell ? m_pData->m_pViewShell->GetObjectShell()->GetModel() : Reference < frame::XModel > () ;
667}
668
669
670// SfxBaseController -> XDispatchProvider
671
672static css::uno::Reference<css::frame::XDispatch>
673GetSlotDispatchWithFallback(SfxViewFrame* pViewFrame, const css::util::URL& aURL,
674 const OUString& sActCommand, bool bMasterCommand, const SfxSlot* pSlot)
675{
676 assert(pViewFrame);
677
678 if (pSlot && (!pViewFrame->GetFrame().IsInPlace() || !pSlot->IsMode(SfxSlotMode::CONTAINER)))
679 return pViewFrame->GetBindings().GetDispatch(pSlot, aURL, bMasterCommand);
680
681 // try to find parent SfxViewFrame
682 if (const auto& xOwnFrame = pViewFrame->GetFrame().GetFrameInterface())
683 {
684 if (const auto& xParentFrame = xOwnFrame->getCreator())
685 {
686 // TODO/LATER: in future probably SfxViewFrame hierarchy should be the same as XFrame hierarchy
687 // SfxViewFrame* pParentFrame = pViewFrame->GetParentViewFrame();
688
689 // search the related SfxViewFrame
690 SfxViewFrame* pParentFrame = nullptr;
691 for (SfxViewFrame* pFrame = SfxViewFrame::GetFirst(); pFrame;
692 pFrame = SfxViewFrame::GetNext(*pFrame))
693 {
694 if (pFrame->GetFrame().GetFrameInterface() == xParentFrame)
695 {
696 pParentFrame = pFrame;
697 break;
698 }
699 }
700
701 if (pParentFrame)
702 {
703 const SfxSlotPool& rFrameSlotPool = SfxSlotPool::GetSlotPool(pParentFrame);
704 if (const SfxSlot* pSlot2 = rFrameSlotPool.GetUnoSlot(sActCommand))
705 return pParentFrame->GetBindings().GetDispatch(pSlot2, aURL, bMasterCommand);
706 }
707 }
708 }
709
710 return {};
711}
712
713Reference< frame::XDispatch > SAL_CALL SfxBaseController::queryDispatch( const util::URL& aURL ,
714 const OUString& sTargetFrameName,
715 sal_Int32 eSearchFlags )
716{
717 SolarMutexGuard aGuard;
718
719 if (!m_pData->m_bDisposing && m_pData->m_pViewShell)
720 {
721 SfxViewFrame& rAct = m_pData->m_pViewShell->GetViewFrame() ;
722 if ( sTargetFrameName == "_beamer" )
723 {
724 if ( eSearchFlags & frame::FrameSearchFlag::CREATE )
725 rAct.SetChildWindow( SID_BROWSER, true );
726 if (SfxChildWindow* pChildWin = rAct.GetChildWindow(SID_BROWSER))
727 {
728 if (Reference<frame::XFrame> xFrame{ pChildWin->GetFrame() })
729 {
730 xFrame->setName(sTargetFrameName);
731 if (Reference<XDispatchProvider> xProv{ xFrame, uno::UNO_QUERY })
732 return xProv->queryDispatch(aURL, sTargetFrameName, frame::FrameSearchFlag::SELF);
733 }
734 }
735 }
736
737 if ( aURL.Protocol == ".uno:" )
738 {
739 OUString aActCommand = SfxOfficeDispatch::GetMasterUnoCommand(aURL);
740 bool bMasterCommand(!aActCommand.isEmpty());
741 if (!bMasterCommand)
742 aActCommand = aURL.Path;
743 const SfxSlot* pSlot = SfxSlotPool::GetSlotPool(&rAct).GetUnoSlot(aActCommand);
744 return GetSlotDispatchWithFallback(&rAct, aURL, aActCommand, bMasterCommand, pSlot);
745 }
746 else if ( aURL.Protocol == "slot:" )
747 {
748 sal_uInt16 nId = static_cast<sal_uInt16>(aURL.Path.toInt32());
749
750 if (nId >= SID_VERB_START && nId <= SID_VERB_END)
751 {
752 const SfxSlot* pSlot = m_pData->m_pViewShell->GetVerbSlot_Impl(nId);
753 if ( pSlot )
754 return rAct.GetBindings().GetDispatch( pSlot, aURL, false );
755 }
756
757 const SfxSlot* pSlot = SfxSlotPool::GetSlotPool(&rAct).GetSlot(nId);
758 return GetSlotDispatchWithFallback(&rAct, aURL, aURL.Path, false, pSlot);
759 }
760 else if( sTargetFrameName == "_self" || sTargetFrameName.isEmpty() )
761 {
762 // check for already loaded URL ... but with additional jumpmark!
763 Reference< frame::XModel > xModel = getModel();
764 if( xModel.is() && !aURL.Mark.isEmpty() )
765 {
766 SfxSlotPool& rSlotPool = SfxSlotPool::GetSlotPool( &rAct );
767 const SfxSlot* pSlot = rSlotPool.GetSlot( SID_JUMPTOMARK );
768 if( !aURL.Main.isEmpty() && aURL.Main == xModel->getURL() && pSlot )
769 return Reference< frame::XDispatch >( new SfxOfficeDispatch( rAct.GetBindings(), rAct.GetDispatcher(), pSlot, aURL) );
770 }
771 }
772 }
773
774 return {};
775}
776
777
778// SfxBaseController -> XDispatchProvider
779
780
781uno::Sequence< Reference< frame::XDispatch > > SAL_CALL SfxBaseController::queryDispatches( const uno::Sequence< frame::DispatchDescriptor >& seqDescripts )
782{
783 // Create return list - which must have same size then the given descriptor
784 // It's not allowed to pack it!
785 sal_Int32 nCount = seqDescripts.getLength();
786 uno::Sequence< Reference< frame::XDispatch > > lDispatcher( nCount );
787
788 std::transform(seqDescripts.begin(), seqDescripts.end(), lDispatcher.getArray(),
789 [this](const frame::DispatchDescriptor& rDesc) -> Reference< frame::XDispatch > {
790 return queryDispatch(rDesc.FeatureURL, rDesc.FrameName, rDesc.SearchFlags); });
791
792 return lDispatcher;
793}
794
795
796// SfxBaseController -> XControllerBorder
797
798
799frame::BorderWidths SAL_CALL SfxBaseController::getBorder()
800{
801 frame::BorderWidths aResult;
802
803 SolarMutexGuard aGuard;
804 if ( m_pData->m_pViewShell )
805 {
806 SvBorder aBorder = m_pData->m_pViewShell->GetBorderPixel();
807 aResult.Left = aBorder.Left();
808 aResult.Top = aBorder.Top();
809 aResult.Right = aBorder.Right();
810 aResult.Bottom = aBorder.Bottom();
811 }
812
813 return aResult;
814}
815
816void SAL_CALL SfxBaseController::addBorderResizeListener( const Reference< frame::XBorderResizeListener >& xListener )
817{
818 m_pData->m_aListenerContainer.addInterface( cppu::UnoType<frame::XBorderResizeListener>::get(),
819 xListener );
820}
821
822void SAL_CALL SfxBaseController::removeBorderResizeListener( const Reference< frame::XBorderResizeListener >& xListener )
823{
824 m_pData->m_aListenerContainer.removeInterface( cppu::UnoType<frame::XBorderResizeListener>::get(),
825 xListener );
826}
827
828awt::Rectangle SAL_CALL SfxBaseController::queryBorderedArea( const awt::Rectangle& aPreliminaryRectangle )
829{
830 SolarMutexGuard aGuard;
831 if ( m_pData->m_pViewShell )
832 {
833 tools::Rectangle aTmpRect = VCLRectangle( aPreliminaryRectangle );
834 m_pData->m_pViewShell->QueryObjAreaPixel( aTmpRect );
835 return AWTRectangle( aTmpRect );
836 }
837
838 return aPreliminaryRectangle;
839}
840
842{
843 ::comphelper::OInterfaceContainerHelper2* pContainer = m_pData->m_aListenerContainer.getContainer(
845 if ( !pContainer )
846 return;
847
848 frame::BorderWidths aBWidths = getBorder();
849 Reference< uno::XInterface > xThis( getXWeak() );
850
851 ::comphelper::OInterfaceIteratorHelper2 pIterator(*pContainer);
852 while (pIterator.hasMoreElements())
853 {
854 try
855 {
856 static_cast<frame::XBorderResizeListener*>(pIterator.next())->borderWidthsChanged( xThis, aBWidths );
857 }
858 catch (const RuntimeException&)
859 {
860 pIterator.remove();
861 }
862 }
863}
864
865
866// SfxBaseController -> XComponent
867
868
870{
871 SolarMutexGuard aGuard;
872 Reference< XController > xKeepAlive( this );
873 m_pData->m_bDisposing = true ;
874
875 lang::EventObject aEventObject;
876 aEventObject.Source = *this ;
877 m_pData->m_aListenerContainer.disposeAndClear( aEventObject ) ;
878
879 if ( m_pData->m_pController && m_pData->m_pController->getFrame().is() )
880 m_pData->m_pController->getFrame()->removeFrameActionListener( m_pData->m_xListener ) ;
881
882 if ( !m_pData->m_pViewShell )
883 return;
884
885 SfxViewFrame& rFrame = m_pData->m_pViewShell->GetViewFrame() ;
886 if (rFrame.GetViewShell() == m_pData->m_pViewShell )
887 rFrame.GetFrame().SetIsClosing_Impl();
888 m_pData->m_pViewShell->DisconnectAllClients();
889
890 lang::EventObject aObject;
891 aObject.Source = *this ;
892
893 SfxObjectShell* pDoc = rFrame.GetObjectShell() ;
895 while( pView )
896 {
897 // if there is another ViewFrame or currently the ViewShell in my ViewFrame is switched (PagePreview)
898 if ( pView != &rFrame || pView->GetViewShell() != m_pData->m_pViewShell )
899 break;
900 pView = SfxViewFrame::GetNext( *pView, pDoc );
901 }
902
903 SfxGetpApp()->NotifyEvent( SfxViewEventHint(SfxEventHintId::CloseView, GlobalEventConfig::GetEventName( GlobalEventId::CLOSEVIEW ), pDoc, Reference< frame::XController2 >( this ) ) );
904 if ( !pView )
906
907 Reference< frame::XModel > xModel = pDoc->GetModel();
908 Reference < util::XCloseable > xCloseable( xModel, uno::UNO_QUERY );
909 if ( xModel.is() )
910 {
911 xModel->disconnectController( this );
912 if ( xCloseable.is() )
913 xCloseable->removeCloseListener( m_pData->m_xCloseListener );
914 }
915
916 Reference < frame::XFrame > aXFrame;
917 attachFrame( aXFrame );
918
919 m_pData->m_xListener->disposing( aObject );
920 SfxViewShell *pShell = m_pData->m_pViewShell;
921 m_pData->m_pViewShell = nullptr;
922 if (rFrame.GetViewShell() == pShell)
923 {
924 // Enter registrations only allowed if we are the owner!
925 if ( rFrame.GetFrame().OwnsBindings_Impl() )
926 rFrame.GetBindings().ENTERREGISTRATIONS();
927 rFrame.GetFrame().SetFrameInterface_Impl( aXFrame );
928 rFrame.GetFrame().DoClose_Impl();
929 }
930}
931
932
933// SfxBaseController -> XComponent
934
935
936void SAL_CALL SfxBaseController::addEventListener( const Reference< lang::XEventListener >& aListener )
937{
938 m_pData->m_aListenerContainer.addInterface( cppu::UnoType<lang::XEventListener>::get(), aListener );
939}
940
941
942// SfxBaseController -> XComponent
943
944
945void SAL_CALL SfxBaseController::removeEventListener( const Reference< lang::XEventListener >& aListener )
946{
947 m_pData->m_aListenerContainer.removeInterface( cppu::UnoType<lang::XEventListener>::get(), aListener );
948}
949
951{
952 SolarMutexGuard aGuard;
953 if ( !m_pData->m_pViewShell )
954 return;
955
956 SfxObjectShell* pDoc = m_pData->m_pViewShell->GetObjectShell() ;
957 Reference< frame::XModel > xModel = pDoc->GetModel();
958 Reference < util::XCloseable > xCloseable( xModel, uno::UNO_QUERY );
959 if ( xModel.is() )
960 {
961 xModel->disconnectController( this );
962 if ( xCloseable.is() )
963 xCloseable->removeCloseListener( m_pData->m_xCloseListener );
964 }
965 m_pData->m_pViewShell = nullptr;
966
967 Reference < frame::XFrame > aXFrame;
968 attachFrame( aXFrame );
969}
970
972{
973 if (!m_pData->m_pViewShell)
974 return;
975 SfxLokCallbackInterface* pCallback = nullptr;
976 if (m_pData->m_xFrame)
977 if (auto xCreator = m_pData->m_xFrame->getCreator())
978 if (auto parentVS = SfxViewShell::Get(xCreator->getController()))
979 pCallback = parentVS->getLibreOfficeKitViewCallback();
980 m_pData->m_pViewShell->setLibreOfficeKitViewCallback(pCallback);
981}
982
984{
985 return m_pData->m_pViewShell;
986}
987
988Reference< task::XStatusIndicator > SAL_CALL SfxBaseController::getStatusIndicator( )
989{
990 SolarMutexGuard aGuard;
991 if ( m_pData->m_pViewShell && !m_pData->m_xIndicator.is() )
992 m_pData->m_xIndicator = new SfxStatusIndicator( this, m_pData->m_pViewShell->GetViewFrame().GetFrame().GetWorkWindow_Impl() );
993 return m_pData->m_xIndicator;
994}
995
996void SAL_CALL SfxBaseController::registerContextMenuInterceptor( const Reference< ui::XContextMenuInterceptor >& xInterceptor )
997
998{
999 m_pData->m_aInterceptorContainer.addInterface( xInterceptor );
1000
1001 SolarMutexGuard aGuard;
1002 if ( m_pData->m_pViewShell )
1003 m_pData->m_pViewShell->AddContextMenuInterceptor_Impl( xInterceptor );
1004}
1005
1006void SAL_CALL SfxBaseController::releaseContextMenuInterceptor( const Reference< ui::XContextMenuInterceptor >& xInterceptor )
1007
1008{
1009 m_pData->m_aInterceptorContainer.removeInterface( xInterceptor );
1010
1011 SolarMutexGuard aGuard;
1012 if ( m_pData->m_pViewShell )
1013 m_pData->m_pViewShell->RemoveContextMenuInterceptor_Impl( xInterceptor );
1014}
1015
1016void SAL_CALL SfxBaseController::addKeyHandler( const Reference< awt::XKeyHandler >& xHandler )
1017{
1018 SolarMutexGuard aGuard;
1019 m_pData->m_aUserInputInterception.addKeyHandler( xHandler );
1020}
1021
1022void SAL_CALL SfxBaseController::removeKeyHandler( const Reference< awt::XKeyHandler >& xHandler )
1023{
1024 SolarMutexGuard aGuard;
1025 m_pData->m_aUserInputInterception.removeKeyHandler( xHandler );
1026}
1027
1028void SAL_CALL SfxBaseController::addMouseClickHandler( const Reference< awt::XMouseClickHandler >& xHandler )
1029{
1030 SolarMutexGuard aGuard;
1031 m_pData->m_aUserInputInterception.addMouseClickHandler( xHandler );
1032}
1033
1034void SAL_CALL SfxBaseController::removeMouseClickHandler( const Reference< awt::XMouseClickHandler >& xHandler )
1035{
1036 SolarMutexGuard aGuard;
1037 m_pData->m_aUserInputInterception.removeMouseClickHandler( xHandler );
1038}
1039
1040uno::Sequence< sal_Int16 > SAL_CALL SfxBaseController::getSupportedCommandGroups()
1041{
1042 SolarMutexGuard aGuard;
1043
1044 std::vector< sal_Int16 > aGroupList;
1045 SfxViewFrame* pViewFrame = m_pData->m_pViewShell ? m_pData->m_pViewShell->GetFrame() : nullptr;
1046 SfxSlotPool* pSlotPool = pViewFrame ? &SfxSlotPool::GetSlotPool(pViewFrame) : &SFX_SLOTPOOL();
1048
1049 // Select Group ( Group 0 is internal )
1050 for ( sal_uInt16 i=0; i<pSlotPool->GetGroupCount(); i++ )
1051 {
1052 pSlotPool->SeekGroup( i );
1053 const SfxSlot* pSfxSlot = pSlotPool->FirstSlot();
1054 while ( pSfxSlot )
1055 {
1056 if ( pSfxSlot->GetMode() & nMode )
1057 {
1058 sal_Int16 nCommandGroup = MapGroupIDToCommandGroup( pSfxSlot->GetGroupId() );
1059 aGroupList.push_back( nCommandGroup );
1060 break;
1061 }
1062 pSfxSlot = pSlotPool->NextSlot();
1063 }
1064 }
1065
1066 return comphelper::containerToSequence( aGroupList );
1067}
1068
1069uno::Sequence< frame::DispatchInformation > SAL_CALL SfxBaseController::getConfigurableDispatchInformation( sal_Int16 nCmdGroup )
1070{
1071 std::vector< frame::DispatchInformation > aCmdVector;
1072
1073 SolarMutexGuard aGuard;
1074 if ( m_pData->m_pViewShell )
1075 {
1077
1078 SfxViewFrame* pViewFrame( m_pData->m_pViewShell->GetFrame() );
1079 SfxSlotPool* pSlotPool
1080 = pViewFrame ? &SfxSlotPool::GetSlotPool(pViewFrame) : &SFX_SLOTPOOL();
1081 for ( sal_uInt16 i=0; i<pSlotPool->GetGroupCount(); i++ )
1082 {
1083 pSlotPool->SeekGroup( i );
1084 const SfxSlot* pSfxSlot = pSlotPool->FirstSlot();
1085 if ( pSfxSlot )
1086 {
1087 sal_Int16 nCommandGroup = MapGroupIDToCommandGroup( pSfxSlot->GetGroupId() );
1088 if ( nCommandGroup == nCmdGroup )
1089 {
1090 while ( pSfxSlot )
1091 {
1092 if ( pSfxSlot->GetMode() & nMode )
1093 {
1094 frame::DispatchInformation aCmdInfo;
1095 aCmdInfo.Command = pSfxSlot->GetCommand();
1096 aCmdInfo.GroupId = nCommandGroup;
1097 aCmdVector.push_back( aCmdInfo );
1098 }
1099 pSfxSlot = pSlotPool->NextSlot();
1100 }
1101 }
1102 }
1103 }
1104 }
1105
1106 return comphelper::containerToSequence( aCmdVector );
1107}
1108
1110{
1111 return m_pData->m_aUserInputInterception.handleNotifyEvent( rEvent );
1112}
1113
1115{
1116 return m_pData->m_aUserInputInterception.hasKeyHandlers();
1117}
1118
1120{
1121 return m_pData->m_aUserInputInterception.hasMouseClickListeners();
1122}
1123
1125{
1126 ENSURE_OR_THROW( m_pData->m_pViewShell, "not to be called without a view shell" );
1127 SfxViewFrame* pViewFrame = m_pData->m_pViewShell->GetFrame();
1128 ENSURE_OR_THROW( pViewFrame, "a view shell without a view frame is pretty pathological" );
1129
1130 const bool bConnect = ( i_eConnect != E_DISCONNECT );
1131
1132 // disable window and dispatcher
1133 pViewFrame->Enable( bConnect );
1134 pViewFrame->GetDispatcher()->Lock( !bConnect );
1135
1136 if ( bConnect )
1137 {
1138 if ( i_eConnect == E_CONNECT )
1139 {
1140 if ( ( m_pData->m_pViewShell->GetObjectShell() != nullptr )
1141 && ( m_pData->m_pViewShell->GetObjectShell()->GetCreateMode() == SfxObjectCreateMode::EMBEDDED )
1142 )
1143 {
1144 SfxViewFrame& rViewFrm = m_pData->m_pViewShell->GetViewFrame();
1145 if ( !rViewFrm.GetFrame().IsInPlace() )
1146 {
1147 // for outplace embedded objects, we want the layout manager to keep the content window
1148 // size constant, if possible
1149 try
1150 {
1151 Reference< beans::XPropertySet > xFrameProps( m_pData->m_xFrame, uno::UNO_QUERY_THROW );
1152 Reference< beans::XPropertySet > xLayouterProps(
1153 xFrameProps->getPropertyValue("LayoutManager"), uno::UNO_QUERY_THROW );
1154 xLayouterProps->setPropertyValue("PreserveContentSize", uno::Any( true ) );
1155 }
1156 catch (const uno::Exception&)
1157 {
1158 DBG_UNHANDLED_EXCEPTION("sfx.view");
1159 }
1160 }
1161 }
1162 }
1163
1164 // upon DISCONNECT, we did *not* pop the shells from the stack (this is done elsewhere), so upon
1165 // RECONNECT, we're not allowed to push them
1166 if ( i_eConnect != E_RECONNECT )
1167 {
1168 pViewFrame->GetDispatcher()->Push( *m_pData->m_pViewShell );
1169 m_pData->m_pViewShell->PushSubShells_Impl();
1170 pViewFrame->GetDispatcher()->Flush();
1171 }
1172
1173 vcl::Window* pEditWin = m_pData->m_pViewShell->GetWindow();
1174 if ( pEditWin )
1175 pEditWin->Show();
1176
1177 if ( SfxViewFrame::Current() == pViewFrame )
1178 pViewFrame->GetDispatcher()->Update_Impl( true );
1179
1180 vcl::Window* pFrameWin = &pViewFrame->GetWindow();
1181 if ( pFrameWin != &pViewFrame->GetFrame().GetWindow() )
1182 pFrameWin->Show();
1183
1184 if ( i_eConnect == E_CONNECT )
1185 {
1186 css::uno::Reference<css::frame::XModel3> xModel(getModel(), css::uno::UNO_QUERY_THROW);
1187 const sal_Int16 nPluginMode = ::comphelper::NamedValueCollection::getOrDefault( xModel->getArgs2( { "PluginMode" } ), u"PluginMode", sal_Int16( 0 ) );
1188 const bool bHasPluginMode = ( nPluginMode != 0 );
1189
1190 SfxFrame& rFrame = pViewFrame->GetFrame();
1191 SfxObjectShell& rDoc = *m_pData->m_pViewShell->GetObjectShell();
1192 if ( !rFrame.IsMarkedHidden_Impl() )
1193 {
1194 if ( rDoc.IsHelpDocument() || ( nPluginMode == 2 ) )
1195 pViewFrame->GetDispatcher()->HideUI();
1196 else
1197 pViewFrame->GetDispatcher()->HideUI( false );
1198
1199 if ( rFrame.IsInPlace() )
1200 pViewFrame->LockAdjustPosSizePixel();
1201
1202 if ( nPluginMode == 3 )
1204
1205 if ( !rFrame.IsInPlace() )
1206 pViewFrame->GetDispatcher()->Update_Impl();
1207 pViewFrame->Show();
1208 rFrame.GetWindow().Show();
1209 if ( !rFrame.IsInPlace() || ( nPluginMode == 3 ) )
1210 pViewFrame->MakeActive_Impl( rFrame.GetFrameInterface()->isActive() );
1211
1212 if ( rFrame.IsInPlace() )
1213 {
1214 pViewFrame->UnlockAdjustPosSizePixel();
1215 // force resize for OLE server to fix layout problems of writer and math
1216 // see i53651
1217 if ( nPluginMode == 3 )
1218 pViewFrame->Resize( true );
1219 }
1220 }
1221 else
1222 {
1223 DBG_ASSERT( !rFrame.IsInPlace() && !bHasPluginMode, "Special modes not compatible with hidden mode!" );
1224 rFrame.GetWindow().Show();
1225 }
1226
1227 // UpdateTitle now, hidden TopFrames have otherwise no Name!
1228 pViewFrame->UpdateTitle();
1229
1230 if ( !rFrame.IsInPlace() )
1231 pViewFrame->Resize( true );
1232
1234
1235 // sometimes we want to avoid adding to the recent documents
1236 bool bAllowPickListEntry = aViewArgs.getOrDefault("PickListEntry", true);
1237 m_pData->m_pViewShell->GetObjectShell()->AvoidRecentDocs(!bAllowPickListEntry);
1238
1239 // if there's a JumpMark given, then, well, jump to it
1240 const OUString sJumpMark = aViewArgs.getOrDefault( "JumpMark", OUString() );
1241 const bool bHasJumpMark = !sJumpMark.isEmpty();
1242 OSL_ENSURE( ( !m_pData->m_pViewShell->GetObjectShell()->IsLoading() )
1243 || ( sJumpMark.isEmpty() ),
1244 "SfxBaseController::ConnectSfxFrame_Impl: so this code wasn't dead?" );
1245 // Before CWS autorecovery, there was code which postponed jumping to the Mark to a later time
1246 // (SfxObjectShell::PositionView_Impl), but it seems this branch was never used, since this method
1247 // here is never called before the load process finished. At least not with a non-empty jump mark
1248 if ( !sJumpMark.isEmpty() )
1249 m_pData->m_pViewShell->JumpToMark( sJumpMark );
1250
1251 // if no plugin mode and no jump mark was supplied, check whether the document itself can provide view data, and
1252 // if so, forward it to the view/shell.
1253 if ( !bHasPluginMode && !bHasJumpMark )
1254 {
1255 // Note that this might not be the ideal place here. Restoring view data should, IMO, be the
1256 // responsibility of the loader, not an implementation detail buried here deep within the controller's
1257 // implementation.
1258 // What I think should be done to replace the below code:
1259 // - change SfxBaseController::restoreViewData to also accept a PropertyValue[] (it currently accepts
1260 // a string only), and forward it to its ViewShell's ReadUserDataSequence
1261 // - change the frame loader so that when a new document is loaded (as opposed to an existing
1262 // document being loaded into a new frame), the model's view data is examine the very same
1263 // way as below, and the proper view data is set via XController::restoreViewData
1264 // - extend SfxViewFrame::SwitchToViewShell_Impl. Currently, it cares for the case where a non-PrintPreview
1265 // view is exchanged, and sets the old view's data at the model. It should also care for the other
1266 // way, were the PrintPreview view is left: in this case, the new view should also be initialized
1267 // with the model's view data
1268 try
1269 {
1270 Reference< XViewDataSupplier > xViewDataSupplier( getModel(), UNO_QUERY_THROW );
1271 Reference< XIndexAccess > xViewData( xViewDataSupplier->getViewData() );
1272
1273 // find the view data item whose ViewId matches the ID of the view we're just connecting to
1274 const SfxObjectFactory& rDocFactory( rDoc.GetFactory() );
1275 const sal_Int32 nCount = xViewData.is() ? xViewData->getCount() : 0;
1276 sal_Int32 nViewDataIndex = 0;
1277 for ( sal_Int32 i=0; i<nCount; ++i )
1278 {
1279 const ::comphelper::NamedValueCollection aViewData( xViewData->getByIndex(i) );
1280 OUString sViewId( aViewData.getOrDefault( "ViewId", OUString() ) );
1281 if ( sViewId.isEmpty() )
1282 continue;
1283
1284 const SfxViewFactory* pViewFactory = rDocFactory.GetViewFactoryByViewName( sViewId );
1285 if ( pViewFactory == nullptr )
1286 continue;
1287
1288 if ( pViewFactory->GetOrdinal() == pViewFrame->GetCurViewId() )
1289 {
1290 nViewDataIndex = i;
1291 break;
1292 }
1293 }
1294 if (nViewDataIndex < nCount || !xViewData.is())
1295 {
1296 Sequence< PropertyValue > aViewData;
1297 if (xViewData.is())
1298 {
1299 OSL_VERIFY(xViewData->getByIndex(nViewDataIndex) >>= aViewData);
1300 }
1301 if (aViewData.hasElements() || !xViewData.is())
1302 {
1303 // Tolerate empty xViewData, ReadUserDataSequence() has side effects.
1304 m_pData->m_pViewShell->ReadUserDataSequence( aViewData );
1305 }
1306 }
1307 }
1308 catch (const Exception&)
1309 {
1310 DBG_UNHANDLED_EXCEPTION("sfx.view");
1311 }
1312 }
1313 }
1314 }
1315
1316 // invalidate slot corresponding to the view shell
1317 const sal_uInt16 nViewNo = m_pData->m_pViewShell->GetObjectShell()->GetFactory().GetViewNo_Impl( pViewFrame->GetCurViewId(), USHRT_MAX );
1318 DBG_ASSERT( nViewNo != USHRT_MAX, "view shell id not found" );
1319 if ( nViewNo != USHRT_MAX )
1320 pViewFrame->GetBindings().Invalidate( nViewNo + SID_VIEWSHELL0 );
1321}
1322
1324{
1325 if ( !m_pData->m_pViewShell )
1326 return;
1327
1328 // CMIS verifications
1329 Reference< document::XCmisDocument > xCmisDoc( m_pData->m_pViewShell->GetObjectShell()->GetModel(), uno::UNO_QUERY );
1330 if ( !xCmisDoc.is( ) || !xCmisDoc->canCheckOut( ) )
1331 return;
1332
1333 const uno::Sequence< document::CmisProperty> aCmisProperties = xCmisDoc->getCmisProperties( );
1334
1335 if ( !(xCmisDoc->isVersionable( ) && aCmisProperties.hasElements( )) )
1336 return;
1337
1338 // Loop over the CMIS Properties to find cmis:isVersionSeriesCheckedOut
1339 // and find if it is a Google Drive file.
1340 bool bIsGoogleFile = false;
1341 bool bCheckedOut = false;
1342 for ( const auto& rCmisProp : aCmisProperties )
1343 {
1344 if ( rCmisProp.Id == "cmis:isVersionSeriesCheckedOut" ) {
1345 uno::Sequence< sal_Bool > bTmp;
1346 rCmisProp.Value >>= bTmp;
1347 bCheckedOut = bTmp[0];
1348 }
1349 // if it is a Google Drive file, we don't need the checkout bar,
1350 // still need the checkout feature for the version dialog.
1351 if ( rCmisProp.Name == "title" )
1352 bIsGoogleFile = true;
1353 }
1354
1355 if ( bCheckedOut || bIsGoogleFile )
1356 return;
1357
1358 // Get the Frame and show the InfoBar if not checked out
1359 SfxViewFrame* pViewFrame = m_pData->m_pViewShell->GetFrame();
1360 auto pInfoBar = pViewFrame->AppendInfoBar("checkout", "", SfxResId(STR_NONCHECKEDOUT_DOCUMENT),
1362 if (pInfoBar)
1363 {
1364 weld::Button &rBtn = pInfoBar->addButton();
1365 rBtn.set_label(SfxResId(STR_CHECKOUT));
1366 rBtn.connect_clicked(LINK(this, SfxBaseController, CheckOutHandler));
1367 }
1368}
1369
1371{
1372 if ( m_pData->m_pViewShell )
1373 m_pData->m_pViewShell->GetObjectShell()->CheckOut( );
1374}
1375
1376
1377Reference< frame::XTitle > SfxBaseController::impl_getTitleHelper ()
1378{
1379 SolarMutexGuard aGuard;
1380
1381 if ( ! m_pData->m_xTitleHelper.is ())
1382 {
1383 Reference< frame::XModel > xModel = getModel ();
1384 Reference< frame::XUntitledNumbers > xUntitledProvider(xModel , uno::UNO_QUERY );
1385
1386 m_pData->m_xTitleHelper = new ::framework::TitleHelper(::comphelper::getProcessComponentContext(),
1387 Reference< frame::XController >(this), xUntitledProvider);
1388 }
1389
1390 return m_pData->m_xTitleHelper;
1391}
1392
1393
1394// frame::XTitle
1396{
1397 return impl_getTitleHelper()->getTitle ();
1398}
1399
1400
1401// frame::XTitle
1402void SAL_CALL SfxBaseController::setTitle(const OUString& sTitle)
1403{
1404 impl_getTitleHelper()->setTitle (sTitle);
1405}
1406
1407
1408// frame::XTitleChangeBroadcaster
1409void SAL_CALL SfxBaseController::addTitleChangeListener(const Reference< frame::XTitleChangeListener >& xListener)
1410{
1411 Reference< frame::XTitleChangeBroadcaster > xBroadcaster(impl_getTitleHelper(), uno::UNO_QUERY);
1412 if (xBroadcaster.is ())
1413 xBroadcaster->addTitleChangeListener (xListener);
1414}
1415
1416
1417// frame::XTitleChangeBroadcaster
1418void SAL_CALL SfxBaseController::removeTitleChangeListener(const Reference< frame::XTitleChangeListener >& xListener)
1419{
1420 Reference< frame::XTitleChangeBroadcaster > xBroadcaster(impl_getTitleHelper(), uno::UNO_QUERY);
1421 if (xBroadcaster.is ())
1422 xBroadcaster->removeTitleChangeListener (xListener);
1423}
1424
1425void SfxBaseController::initialize( const css::uno::Sequence< css::uno::Any >& /*aArguments*/ )
1426{
1427}
1428
1429void SAL_CALL SfxBaseController::appendInfobar(const OUString& sId, const OUString& sPrimaryMessage,
1430 const OUString& sSecondaryMessage,
1431 sal_Int32 aInfobarType,
1432 const Sequence<StringPair>& actionButtons,
1433 sal_Bool bShowCloseButton)
1434{
1435 SolarMutexGuard aGuard;
1436
1437 if (aInfobarType < static_cast<sal_Int32>(InfobarType::INFO)
1438 || aInfobarType > static_cast<sal_Int32>(InfobarType::DANGER))
1439 throw lang::IllegalArgumentException("Undefined InfobarType: "
1440 + OUString::number(aInfobarType),
1441 getXWeak(), 0);
1442 SfxViewFrame* pViewFrame = m_pData->m_pViewShell->GetFrame();
1443 if (pViewFrame->HasInfoBarWithID(sId))
1444 throw lang::IllegalArgumentException("Infobar with ID '" + sId + "' already existing.",
1445 getXWeak(), 0);
1446
1447 auto pInfoBar
1448 = pViewFrame->AppendInfoBar(sId, sPrimaryMessage, sSecondaryMessage,
1449 static_cast<InfobarType>(aInfobarType), bShowCloseButton);
1450 if (!pInfoBar)
1451 throw uno::RuntimeException("Could not create Infobar");
1452
1453 for (const StringPair & actionButton : std::as_const(actionButtons))
1454 {
1455 if (actionButton.First.isEmpty() || actionButton.Second.isEmpty())
1456 continue;
1457 weld::Button& rBtn = pInfoBar->addButton(&actionButton.Second);
1458 rBtn.set_label(actionButton.First);
1459 }
1460}
1461
1462void SAL_CALL SfxBaseController::updateInfobar(const OUString& sId, const OUString& sPrimaryMessage,
1463 const OUString& sSecondaryMessage,
1464 sal_Int32 aInfobarType)
1465{
1466 SolarMutexGuard aGuard;
1467
1468 if (aInfobarType < static_cast<sal_Int32>(InfobarType::INFO)
1469 || aInfobarType > static_cast<sal_Int32>(InfobarType::DANGER))
1470 throw lang::IllegalArgumentException("Undefined InfobarType: "
1471 + OUString::number(aInfobarType),
1472 getXWeak(), 0);
1473 SfxViewFrame* pViewFrame = m_pData->m_pViewShell->GetFrame();
1474 if (!pViewFrame->HasInfoBarWithID(sId))
1475 throw css::container::NoSuchElementException("Infobar with ID '" + sId + "' not found.");
1476
1477 pViewFrame->UpdateInfoBar(sId, sPrimaryMessage, sSecondaryMessage,
1478 static_cast<InfobarType>(aInfobarType));
1479}
1480
1481void SAL_CALL SfxBaseController::removeInfobar(const OUString& sId)
1482{
1483 SolarMutexGuard aGuard;
1484
1485 SfxViewFrame* pViewFrame = m_pData->m_pViewShell->GetFrame();
1486 if (!pViewFrame->HasInfoBarWithID(sId))
1487 throw css::container::NoSuchElementException("Infobar with ID '" + sId + "' not found.");
1488 pViewFrame->RemoveInfoBar(sId);
1489}
1490
1491sal_Bool SAL_CALL SfxBaseController::hasInfobar(const OUString& sId)
1492{
1493 SolarMutexGuard aGuard;
1494 SfxViewFrame* pViewFrame = m_pData->m_pViewShell->GetFrame();
1495 return pViewFrame->HasInfoBarWithID(sId);
1496}
1497
1498/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SfxApplication * SfxGetpApp()
Definition: app.hxx:231
constexpr OUStringLiteral sViewId
Definition: appuno.cxx:102
constexpr OUStringLiteral sJumpMark
Definition: appuno.cxx:119
AnyEventRef aEvent
static bool Reschedule(bool bHandleAllCurrentEvents=false)
static OUString GetEventName(GlobalEventId nID)
void NotifyEvent(const SfxEventHint &rEvent, bool bSynchron=true)
Definition: appcfg.cxx:338
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCreationArguments() override
virtual void SAL_CALL releaseContextMenuInterceptor(const css::uno::Reference< css::ui::XContextMenuInterceptor > &xInterceptor) override
SfxBaseController(SfxViewShell *pView)
virtual void SAL_CALL registerContextMenuInterceptor(const css::uno::Reference< css::ui::XContextMenuInterceptor > &xInterceptor) override
SAL_DLLPRIVATE void ConnectSfxFrame_Impl(const ConnectSfxFrame i_eConnect)
virtual void SAL_CALL removeBorderResizeListener(const css::uno::Reference< css::frame::XBorderResizeListener > &xListener) override
css::uno::Reference< css::frame::XFrame > SAL_CALL getFrame() override
virtual sal_Bool SAL_CALL hasInfobar(const OUString &sId) override
virtual OUString SAL_CALL getTitle() override
void CopyLokViewCallbackFromFrameCreator()
virtual void SAL_CALL appendInfobar(const OUString &sId, const OUString &sPrimaryMessage, const OUString &sSecondaryMessage, sal_Int32 aInfobarType, const css::uno::Sequence< css::beans::StringPair > &actionButtons, sal_Bool bShowCloseButton) override
SAL_DLLPRIVATE void ReleaseShell_Impl()
virtual css::uno::Sequence< sal_Int16 > SAL_CALL getSupportedCommandGroups() override
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
virtual css::awt::Rectangle SAL_CALL queryBorderedArea(const css::awt::Rectangle &aPreliminaryRectangle) override
css::uno::Reference< css::frame::XModel > SAL_CALL getModel() override
virtual void SAL_CALL removeTitleChangeListener(const css::uno::Reference< css::frame::XTitleChangeListener > &xListener) override
SfxViewShell * GetViewShell_Impl() const
std::unique_ptr< IMPL_SfxBaseController_DataContainer > m_pData
virtual void SAL_CALL removeKeyHandler(const css::uno::Reference< css::awt::XKeyHandler > &xHandler) override
virtual void SAL_CALL removeMouseClickHandler(const css::uno::Reference< css::awt::XMouseClickHandler > &xHandler) override
virtual ~SfxBaseController() override
SAL_DLLPRIVATE css::uno::Reference< css::frame::XTitle > impl_getTitleHelper()
virtual sal_Bool SAL_CALL suspend(sal_Bool bSuspend) override
virtual void SAL_CALL addBorderResizeListener(const css::uno::Reference< css::frame::XBorderResizeListener > &xListener) override
virtual void SAL_CALL setTitle(const OUString &sTitle) override
virtual css::uno::Sequence< css::frame::DispatchInformation > SAL_CALL getConfigurableDispatchInformation(sal_Int16 nCommandGroup) override
virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches(const css::uno::Sequence< css::frame::DispatchDescriptor > &seqDescriptor) override
virtual sal_Bool SAL_CALL attachModel(const css::uno::Reference< css::frame::XModel > &xModel) override
SAL_DLLPRIVATE bool HasKeyListeners_Impl() const
virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch(const css::util::URL &aURL, const OUString &sTargetFrameName, sal_Int32 eSearchFlags) override
SAL_DLLPRIVATE bool HasMouseClickListeners_Impl() const
SAL_DLLPRIVATE bool HandleEvent_Impl(NotifyEvent const &rEvent)
SAL_DLLPRIVATE void SetCreationArguments_Impl(const css::uno::Sequence< css::beans::PropertyValue > &i_rCreationArgs)
virtual void SAL_CALL removeInfobar(const OUString &sId) override
virtual void SAL_CALL attachFrame(const css::uno::Reference< css::frame::XFrame > &xFrame) override
SAL_DLLPRIVATE void BorderWidthsChanged_Impl()
virtual css::frame::BorderWidths SAL_CALL getBorder() override
css::uno::Any SAL_CALL getViewData() override
virtual void SAL_CALL addTitleChangeListener(const css::uno::Reference< css::frame::XTitleChangeListener > &xListener) override
virtual void SAL_CALL updateInfobar(const OUString &sId, const OUString &sPrimaryMessage, const OUString &sSecondaryMessage, sal_Int32 aInfobarType) override
void SAL_CALL restoreViewData(const css::uno::Any &aValue) override
virtual css::uno::Reference< css::awt::XWindow > SAL_CALL getComponentWindow() override
SAL_DLLPRIVATE void ShowInfoBars()
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
virtual OUString SAL_CALL getViewControllerName() override
virtual void SAL_CALL addMouseClickHandler(const css::uno::Reference< css::awt::XMouseClickHandler > &xHandler) override
virtual css::uno::Reference< css::ui::XSidebarProvider > SAL_CALL getSidebar() override
virtual void SAL_CALL addKeyHandler(const css::uno::Reference< css::awt::XKeyHandler > &xHandler) override
SAL_DLLPRIVATE SfxViewFrame & GetViewFrame_Impl() const
virtual void SAL_CALL dispose() override
css::uno::Reference< css::task::XStatusIndicator > SAL_CALL getStatusIndicator() override
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
css::uno::Reference< css::frame::XDispatch > GetDispatch(const SfxSlot *, const css::util::URL &aURL, bool bMasterCommand)
Definition: bindings.cxx:1752
void Invalidate(sal_uInt16 nId)
Definition: bindings.cxx:639
SAL_DLLPRIVATE void Update_Impl(bool bForce=false)
Definition: dispatch.cxx:1034
void HideUI(bool bHide=true)
Definition: dispatch.cxx:1920
void Lock(bool bLock)
With this method the SfxDispatcher can be locked and released.
Definition: dispatch.cxx:1895
void Push(SfxShell &rShell)
With this method, a <SfxShell> pushed on to the SfxDispatcher.
Definition: dispatch.cxx:168
void Flush()
This method performs outstanding push- and pop- commands.
Definition: dispatch.cxx:155
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
Definition: frame.cxx:515
SAL_DLLPRIVATE void SetIsClosing_Impl()
Definition: frame.cxx:202
SAL_DLLPRIVATE void SetFrameInterface_Impl(const css::uno::Reference< css::frame::XFrame > &rFrame)
Definition: frame.cxx:520
SAL_DLLPRIVATE void DoClose_Impl()
Definition: frame.cxx:127
SAL_DLLPRIVATE SfxWorkWindow * GetWorkWindow_Impl() const
Definition: frame.cxx:588
SAL_DLLPRIVATE bool IsMarkedHidden_Impl() const
Definition: frame2.cxx:401
bool IsInPlace() const
Definition: frame.cxx:657
vcl::Window & GetWindow() const
Definition: frame.hxx:85
SAL_DLLPRIVATE bool OwnsBindings_Impl() const
Definition: frame.cxx:553
SfxViewFactory * GetViewFactoryByViewName(std::u16string_view i_rViewName) const
returns the view factory whose GetAPIViewName or GetLegacyViewName delivers the requested logical nam...
Definition: docfac.cxx:339
SfxViewFactory & GetViewFactory(sal_uInt16 i=0) const
Definition: docfac.cxx:117
SAL_DLLPRIVATE sal_uInt16 GetViewNo_Impl(const SfxInterfaceId i_nViewId, const sal_uInt16 i_nFallback) const
Definition: docfac.cxx:328
sal_uInt16 GetViewFactoryCount() const
Definition: docfac.cxx:111
virtual bool PrepareClose(bool bUI=true)
Definition: objxtor.cxx:506
virtual SfxObjectFactory & GetFactory() const =0
css::uno::Reference< css::frame::XModel3 > GetModel() const
Definition: objxtor.cxx:838
bool IsHelpDocument() const
Definition: objcont.cxx:580
static OUString GetMasterUnoCommand(const css::util::URL &aURL)
Definition: unoctitm.cxx:311
SfxViewShell * GetViewShell() const
Returns the SfxViewShell in which they are located in the subshells.
Definition: shell.cxx:129
static SfxSlotPool & GetSlotPool(SfxViewFrame *pFrame=nullptr)
Definition: msgpool.cxx:316
OUString SeekGroup(sal_uInt16 nNo)
Definition: msgpool.cxx:172
const SfxSlot * FirstSlot()
Definition: msgpool.hxx:65
const SfxSlot * GetSlot(sal_uInt16 nId) const
Definition: msgpool.cxx:155
const SfxSlot * GetUnoSlot(const OUString &rUnoName) const
Definition: msgpool.cxx:300
const SfxSlot * NextSlot()
Definition: msgpool.cxx:259
sal_uInt16 GetGroupCount() const
Definition: msgpool.cxx:210
Definition: msg.hxx:184
SfxGroupId GetGroupId() const
Definition: msg.hxx:276
SFX2_DLLPUBLIC OUString GetCommand() const
Definition: msg.cxx:46
SfxSlotMode GetMode() const
Definition: msg.hxx:260
bool IsMode(SfxSlotMode nMode) const
Definition: msg.hxx:268
get the sidebar for a given frame
Definition: UnoSidebar.hxx:26
OUString GetAPIViewName() const
returns an API-compatible view name.
Definition: viewfac.cxx:34
SfxInterfaceId GetOrdinal() const
Definition: viewfac.hxx:40
void LockAdjustPosSizePixel()
Definition: viewfrm.hxx:117
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
Definition: viewfrm.cxx:1975
void RemoveInfoBar(std::u16string_view sId)
Definition: viewfrm.cxx:3632
vcl::Window & GetWindow() const
Definition: viewfrm.cxx:2792
SfxBindings & GetBindings()
Definition: viewfrm.hxx:110
void Resize(bool bForce=false)
Definition: viewfrm.cxx:2835
SfxInterfaceId GetCurViewId() const
Definition: viewfrm.cxx:2547
void SetChildWindow(sal_uInt16 nId, bool bVisible, bool bSetFocus=true)
Definition: viewfrm.cxx:3531
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetNext(const SfxViewFrame &rPrev, const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
Definition: viewfrm.cxx:2006
SfxDispatcher * GetDispatcher()
Definition: viewfrm.hxx:109
SfxChildWindow * GetChildWindow(sal_uInt16)
Definition: viewfrm.cxx:3567
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
Definition: viewfrm.cxx:1983
SfxFrame & GetFrame() const
Definition: viewfrm.cxx:2782
virtual SfxObjectShell * GetObjectShell() override
Definition: viewfrm.cxx:2218
bool HasInfoBarWithID(std::u16string_view sId)
Definition: viewfrm.cxx:3650
VclPtr< SfxInfoBarWindow > AppendInfoBar(const OUString &sId, const OUString &sPrimaryMessage, const OUString &sSecondaryMessage, InfobarType aInfobarType, bool bShowCloseButton=true)
Append a new InfoBar (see https://wiki.documentfoundation.org/Design/Whiteboards/Infobar).
Definition: viewfrm.cxx:3593
void UpdateTitle()
Definition: viewfrm2.cxx:76
void Show()
Definition: viewfrm.cxx:2135
void Enable(bool bEnable)
Definition: viewfrm.cxx:2100
SAL_DLLPRIVATE void MakeActive_Impl(bool bActivate)
Definition: viewfrm.cxx:2178
void UnlockAdjustPosSizePixel()
Definition: viewfrm.hxx:119
void UpdateInfoBar(std::u16string_view sId, const OUString &sPrimaryMessage, const OUString &sSecondaryMessage, InfobarType eType)
Definition: viewfrm.cxx:3612
One SfxViewShell more or less represents one edit window for a document, there can be multiple ones f...
Definition: viewsh.hxx:165
virtual bool PrepareClose(bool bUI=true)
Initialize is called after the frame has been loaded and the controller has been set.
Definition: viewsh.cxx:1817
static SAL_WARN_UNUSED_RESULT SfxViewShell * Get(const css::uno::Reference< css::frame::XController > &i_rController)
Definition: viewsh.cxx:1855
css::uno::Reference< css::task::XStatusIndicator > GetStatusIndicator()
Definition: workwin.cxx:1107
void SetInternalDockingAllowed(bool bSet)
Definition: workwin.hxx:237
tools::Long & Left()
tools::Long & Top()
tools::Long & Right()
tools::Long & Bottom()
VALUE_TYPE getOrDefault(const OUString &_rValueName, const VALUE_TYPE &_rDefault) const
css::uno::XInterface * next()
helper class for implementing the XUserInputInterception interface for a controller implementation
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
virtual void set_label(const OUString &rText)=0
void connect_clicked(const Link< Button &, void > &rLink)
css::awt::Rectangle AWTRectangle(const ::tools::Rectangle &rVCLRect)
inline ::tools::Rectangle VCLRectangle(const css::awt::Rectangle &rAWTRect)
int nCount
#define DBG_ASSERT(sCon, aError)
#define ENSURE_OR_THROW(c, m)
#define DBG_UNHANDLED_EXCEPTION(...)
URL aURL
float u
FmFilterData * m_pData
SfxGroupId
Definition: groupid.hxx:30
std::mutex m_aMutex
InfobarType
Definition: infobar.hxx:22
SfxSlotMode
Definition: msg.hxx:35
#define SFX_SLOTPOOL()
Definition: msgpool.hxx:70
@ Exception
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
int i
end
long Long
std::mutex aMutex
#define FRAME
sal_Int16 nId
RegError REGISTRY_CALLTYPE setValue(RegKeyHandle hKey, rtl_uString *keyName, RegValueType valueType, RegValue pData, sal_uInt32 valueSize)
std::unordered_map< SfxGroupId, sal_Int16 > GroupHashMap
static void reschedule()
static counter for rescheduling
sal_Int16 MapGroupIDToCommandGroup(SfxGroupId nGroupID)
IMPL_LINK_NOARG(SfxBaseController, CheckOutHandler, weld::Button &, void)
sal_uInt32 Get10ThSec()
static css::uno::Reference< css::frame::XDispatch > GetSlotDispatchWithFallback(SfxViewFrame *pViewFrame, const css::util::URL &aURL, const OUString &sActCommand, bool bMasterCommand, const SfxSlot *pSlot)
#define TIMEOUT_START_RESCHEDULE
static sal_Int32 m_nInReschedule
OUString SfxResId(TranslateId aId)
Definition: sfxresid.cxx:22
::sfx2::UserInputInterception m_aUserInputInterception
Sequence< PropertyValue > m_aCreationArgs
::comphelper::OInterfaceContainerHelper3< ui::XContextMenuInterceptor > m_aInterceptorContainer
IMPL_SfxBaseController_DataContainer(::osl::Mutex &aMutex, SfxViewShell *pViewShell, SfxBaseController *pController)
::comphelper::OMultiTypeInterfaceContainerHelper2 m_aListenerContainer
Reference< XStatusIndicator > m_xIndicator
Reference< XFrameActionListener > m_xListener
Reference< XCloseListener > m_xCloseListener
Reference< XFrame > xFrame
Reference< XModel > xModel
unsigned char sal_Bool
OUString sId