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>
56#include <sfx2/sfxsids.hrc>
61#include <osl/mutex.hxx>
73#include <sfx2/strings.hrc>
76#include <unordered_map>
78#include <com/sun/star/ui/XSidebarProvider.hpp>
81#define TIMEOUT_START_RESCHEDULE 10L
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;
141 GroupHashMap::const_iterator pIter = s_aHashMap.find( nGroupID );
142 if ( pIter != s_aHashMap.end() )
143 return pIter->second;
145 return frame::CommandGroup::INTERNAL;
150 sal_uInt32 n10Ticks = 10 *
static_cast<sal_uInt32
>(clock());
151 return n10Ticks / CLOCKS_PER_SEC;
168class SfxStatusIndicator :
public ::cppu::WeakImplHelper< task::XStatusIndicator, lang::XEventListener >
170 Reference < XController > xOwner;
171 Reference < task::XStatusIndicator > xProgress;
176 : xOwner( pController )
177 , pWorkWindow( pWork )
180 osl_atomic_increment(&m_refCount);
181 Reference< lang::XComponent > xComponent = pController;
184 osl_atomic_decrement(&m_refCount);
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;
193 virtual void SAL_CALL disposing(
const lang::EventObject& Source )
override;
198void SAL_CALL SfxStatusIndicator::start(
const OUString& aText, sal_Int32 nRange)
203 if ( !xProgress.is() )
206 if ( xProgress.is() )
207 xProgress->start( aText, nRange );
214void SAL_CALL SfxStatusIndicator::end()
219 if ( !xProgress.is() )
222 if ( xProgress.is() )
229void SAL_CALL SfxStatusIndicator::setText(
const OUString& aText)
234 if ( !xProgress.is() )
237 if ( xProgress.is() )
238 xProgress->setText( aText );
244void SAL_CALL SfxStatusIndicator::setValue( sal_Int32 nValue )
249 if ( !xProgress.is() )
252 if ( xProgress.is() )
253 xProgress->setValue( nValue );
261void SAL_CALL SfxStatusIndicator::reset()
266 if ( !xProgress.is() )
269 if ( xProgress.is() )
276void SAL_CALL SfxStatusIndicator::disposing(
const lang::EventObject& )
288class IMPL_SfxBaseController_ListenerHelper :
public ::cppu::WeakImplHelper< frame::XFrameActionListener >
291 explicit IMPL_SfxBaseController_ListenerHelper(
SfxBaseController* pController ) ;
293 virtual void SAL_CALL frameAction(
const frame::FrameActionEvent& aEvent )
override ;
294 virtual void SAL_CALL disposing(
const lang::EventObject& aEvent )
override ;
302class IMPL_SfxBaseController_CloseListenerHelper :
public ::cppu::WeakImplHelper< util::XCloseListener >
305 explicit IMPL_SfxBaseController_CloseListenerHelper(
SfxBaseController* pController ) ;
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 ;
319IMPL_SfxBaseController_CloseListenerHelper::IMPL_SfxBaseController_CloseListenerHelper(
SfxBaseController* pController )
320 : m_pController ( pController )
324void SAL_CALL IMPL_SfxBaseController_CloseListenerHelper::disposing(
const lang::EventObject& )
328void SAL_CALL IMPL_SfxBaseController_CloseListenerHelper::queryClosing(
const lang::EventObject& ,
sal_Bool )
331 SfxViewShell* pShell = m_pController->GetViewShell_Impl();
337 throw util::CloseVetoException(
"Controller disagree ...",getXWeak());
342void SAL_CALL IMPL_SfxBaseController_CloseListenerHelper::notifyClosing(
const lang::EventObject& )
369 :
m_xListener ( new IMPL_SfxBaseController_ListenerHelper( pController ) )
370 ,
m_xCloseListener ( new IMPL_SfxBaseController_CloseListenerHelper( pController ) )
387IMPL_SfxBaseController_ListenerHelper::IMPL_SfxBaseController_ListenerHelper(
SfxBaseController* pController )
388 : m_pController ( pController )
392void SAL_CALL IMPL_SfxBaseController_ListenerHelper::frameAction(
const frame::FrameActionEvent& aEvent )
396 ( m_pController !=
nullptr ) &&
397 (
aEvent.Frame == m_pController->getFrame() ) &&
398 ( m_pController->GetViewShell_Impl() && m_pController->GetViewShell_Impl()->GetWindow() !=
nullptr )
401 if (
aEvent.Action == frame::FrameAction_FRAME_UI_ACTIVATED )
403 if ( !m_pController->GetViewShell_Impl()->GetUIActiveIPClient_Impl() )
404 m_pController->GetViewShell_Impl()->GetViewFrame().MakeActive_Impl(
false );
406 else if (
aEvent.Action == frame::FrameAction_CONTEXT_CHANGED )
408 m_pController->GetViewShell_Impl()->GetViewFrame().GetBindings().ContextChanged_Impl();
417void SAL_CALL IMPL_SfxBaseController_ListenerHelper::disposing(
const lang::EventObject& )
420 if ( m_pController && m_pController->getFrame().is() )
421 m_pController->getFrame()->removeFrameActionListener(
this ) ;
427 m_pData->m_pViewShell->SetController(
this );
446 throw DisposedException();
448 return Reference< XWindow >(
GetViewFrame_Impl().GetFrame().GetWindow().GetComponentInterface(), UNO_QUERY_THROW );
454 if ( !
m_pData->m_pViewShell || !
m_pData->m_pViewShell->GetObjectShell() )
455 throw DisposedException();
459 OSL_ENSURE( nViewNo < rDocFac.
GetViewFactoryCount(),
"SfxBaseController::getViewControllerName: view ID not found in view factories!" );
471 if ( !
m_pData->m_pViewShell || !
m_pData->m_pViewShell->GetObjectShell() )
472 throw DisposedException();
474 return m_pData->m_aCreationArgs;
479 OSL_ENSURE( !
m_pData->m_aCreationArgs.hasElements(),
"SfxBaseController::SetCreationArguments_Impl: not intended to be called twice!" );
480 m_pData->m_aCreationArgs = i_rCreationArgs;
487 ENSURE_OR_THROW( pActFrame,
"a view shell without a view frame is pretty pathological" );
507 Reference< frame::XFrame > xTemp(
getFrame() ) ;
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 );
524 Reference < util::XCloseBroadcaster > xCloseable(
xFrame, uno::UNO_QUERY );
525 if ( xCloseable.is() )
526 xCloseable->addCloseListener(
m_pData->m_xCloseListener );
548 OSL_FAIL(
"Can't reattach model!");
552 Reference < util::XCloseBroadcaster > xCloseable(
xModel, uno::UNO_QUERY );
553 if ( xCloseable.is() )
554 xCloseable->addCloseListener(
m_pData->m_xCloseListener );
567 if (
bool(bSuspend) ==
m_pData->m_bSuspendState)
574 m_pData->m_bSuspendState =
true;
578 if ( !
m_pData->m_pViewShell->PrepareClose() )
587 bool bOther = false ;
590 bOther = (pFrame != pActFrame);
596 m_pData->m_bSuspendState =
true;
611 m_pData->m_bSuspendState =
false;
627 m_pData->m_pViewShell->WriteUserData( sData ) ;
645 m_pData->m_pViewShell->ReadUserData( sData ) ;
666 return m_pData->m_pViewShell ?
m_pData->m_pViewShell->GetObjectShell()->GetModel() : Reference < frame::XModel > () ;
672static css::uno::Reference<css::frame::XDispatch>
674 const OUString& sActCommand,
bool bMasterCommand,
const SfxSlot* pSlot)
684 if (
const auto& xParentFrame = xOwnFrame->getCreator())
694 if (pFrame->GetFrame().GetFrameInterface() == xParentFrame)
696 pParentFrame = pFrame;
714 const OUString& sTargetFrameName,
715 sal_Int32 eSearchFlags )
722 if ( sTargetFrameName ==
"_beamer" )
724 if ( eSearchFlags & frame::FrameSearchFlag::CREATE )
728 if (Reference<frame::XFrame>
xFrame{ pChildWin->GetFrame() })
730 xFrame->setName(sTargetFrameName);
731 if (Reference<XDispatchProvider> xProv{
xFrame, uno::UNO_QUERY })
732 return xProv->queryDispatch(
aURL, sTargetFrameName, frame::FrameSearchFlag::SELF);
737 if (
aURL.Protocol ==
".uno:" )
740 bool bMasterCommand(!aActCommand.isEmpty());
742 aActCommand =
aURL.Path;
746 else if (
aURL.Protocol ==
"slot:" )
748 sal_uInt16
nId =
static_cast<sal_uInt16
>(
aURL.Path.toInt32());
750 if (
nId >= SID_VERB_START &&
nId <= SID_VERB_END)
760 else if( sTargetFrameName ==
"_self" || sTargetFrameName.isEmpty() )
768 if( !
aURL.Main.isEmpty() &&
aURL.Main ==
xModel->getURL() && pSlot )
785 sal_Int32
nCount = seqDescripts.getLength();
786 uno::Sequence< Reference< frame::XDispatch > > lDispatcher(
nCount );
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); });
801 frame::BorderWidths aResult;
807 aResult.Left = aBorder.
Left();
808 aResult.Top = aBorder.
Top();
809 aResult.Right = aBorder.
Right();
810 aResult.Bottom = aBorder.
Bottom();
834 m_pData->m_pViewShell->QueryObjAreaPixel( aTmpRect );
838 return aPreliminaryRectangle;
848 frame::BorderWidths aBWidths =
getBorder();
849 Reference< uno::XInterface > xThis( getXWeak() );
856 static_cast<frame::XBorderResizeListener*
>(pIterator.
next())->borderWidthsChanged( xThis, aBWidths );
872 Reference< XController > xKeepAlive(
this );
875 lang::EventObject aEventObject;
876 aEventObject.Source = *this ;
877 m_pData->m_aListenerContainer.disposeAndClear( aEventObject ) ;
879 if (
m_pData->m_pController &&
m_pData->m_pController->getFrame().is() )
880 m_pData->m_pController->getFrame()->removeFrameActionListener(
m_pData->m_xListener ) ;
888 m_pData->m_pViewShell->DisconnectAllClients();
890 lang::EventObject aObject;
891 aObject.Source = *this ;
908 Reference < util::XCloseable > xCloseable(
xModel, uno::UNO_QUERY );
911 xModel->disconnectController(
this );
912 if ( xCloseable.is() )
913 xCloseable->removeCloseListener(
m_pData->m_xCloseListener );
916 Reference < frame::XFrame > aXFrame;
919 m_pData->m_xListener->disposing( aObject );
921 m_pData->m_pViewShell =
nullptr;
958 Reference < util::XCloseable > xCloseable(
xModel, uno::UNO_QUERY );
961 xModel->disconnectController(
this );
962 if ( xCloseable.is() )
963 xCloseable->removeCloseListener(
m_pData->m_xCloseListener );
965 m_pData->m_pViewShell =
nullptr;
967 Reference < frame::XFrame > aXFrame;
977 if (
auto xCreator =
m_pData->m_xFrame->getCreator())
979 pCallback = parentVS->getLibreOfficeKitViewCallback();
980 m_pData->m_pViewShell->setLibreOfficeKitViewCallback(pCallback);
992 m_pData->m_xIndicator =
new SfxStatusIndicator(
this,
m_pData->m_pViewShell->GetViewFrame().GetFrame().GetWorkWindow_Impl() );
999 m_pData->m_aInterceptorContainer.addInterface( xInterceptor );
1003 m_pData->m_pViewShell->AddContextMenuInterceptor_Impl( xInterceptor );
1009 m_pData->m_aInterceptorContainer.removeInterface( xInterceptor );
1013 m_pData->m_pViewShell->RemoveContextMenuInterceptor_Impl( xInterceptor );
1019 m_pData->m_aUserInputInterception.addKeyHandler( xHandler );
1025 m_pData->m_aUserInputInterception.removeKeyHandler( xHandler );
1031 m_pData->m_aUserInputInterception.addMouseClickHandler( xHandler );
1037 m_pData->m_aUserInputInterception.removeMouseClickHandler( xHandler );
1044 std::vector< sal_Int16 > aGroupList;
1056 if ( pSfxSlot->
GetMode() & nMode )
1059 aGroupList.push_back( nCommandGroup );
1071 std::vector< frame::DispatchInformation > aCmdVector;
1088 if ( nCommandGroup == nCmdGroup )
1092 if ( pSfxSlot->
GetMode() & nMode )
1094 frame::DispatchInformation aCmdInfo;
1096 aCmdInfo.GroupId = nCommandGroup;
1097 aCmdVector.push_back( aCmdInfo );
1111 return m_pData->m_aUserInputInterception.handleNotifyEvent( rEvent );
1116 return m_pData->m_aUserInputInterception.hasKeyHandlers();
1121 return m_pData->m_aUserInputInterception.hasMouseClickListeners();
1128 ENSURE_OR_THROW( pViewFrame,
"a view shell without a view frame is pretty pathological" );
1133 pViewFrame->
Enable( bConnect );
1140 if ( (
m_pData->m_pViewShell->GetObjectShell() !=
nullptr )
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 ) );
1156 catch (
const uno::Exception&)
1169 m_pData->m_pViewShell->PushSubShells_Impl();
1186 css::uno::Reference<css::frame::XModel3>
xModel(
getModel(), css::uno::UNO_QUERY_THROW);
1188 const bool bHasPluginMode = ( nPluginMode != 0 );
1202 if ( nPluginMode == 3 )
1209 if ( !rFrame.
IsInPlace() || ( nPluginMode == 3 ) )
1217 if ( nPluginMode == 3 )
1218 pViewFrame->
Resize(
true );
1223 DBG_ASSERT( !rFrame.
IsInPlace() && !bHasPluginMode,
"Special modes not compatible with hidden mode!" );
1231 pViewFrame->
Resize(
true );
1236 bool bAllowPickListEntry = aViewArgs.
getOrDefault(
"PickListEntry",
true);
1237 m_pData->m_pViewShell->GetObjectShell()->AvoidRecentDocs(!bAllowPickListEntry);
1241 const bool bHasJumpMark = !
sJumpMark.isEmpty();
1242 OSL_ENSURE( ( !
m_pData->m_pViewShell->GetObjectShell()->IsLoading() )
1244 "SfxBaseController::ConnectSfxFrame_Impl: so this code wasn't dead?" );
1253 if ( !bHasPluginMode && !bHasJumpMark )
1270 Reference< XViewDataSupplier > xViewDataSupplier(
getModel(), UNO_QUERY_THROW );
1271 Reference< XIndexAccess > xViewData( xViewDataSupplier->getViewData() );
1275 const sal_Int32
nCount = xViewData.is() ? xViewData->getCount() : 0;
1276 sal_Int32 nViewDataIndex = 0;
1279 const ::comphelper::NamedValueCollection aViewData( xViewData->getByIndex(
i) );
1280 OUString
sViewId( aViewData.getOrDefault(
"ViewId", OUString() ) );
1285 if ( pViewFactory ==
nullptr )
1294 if (nViewDataIndex <
nCount || !xViewData.is())
1296 Sequence< PropertyValue > aViewData;
1299 OSL_VERIFY(xViewData->getByIndex(nViewDataIndex) >>= aViewData);
1301 if (aViewData.hasElements() || !xViewData.is())
1304 m_pData->m_pViewShell->ReadUserDataSequence( aViewData );
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 )
1329 Reference< document::XCmisDocument > xCmisDoc(
m_pData->m_pViewShell->GetObjectShell()->GetModel(), uno::UNO_QUERY );
1330 if ( !xCmisDoc.is( ) || !xCmisDoc->canCheckOut( ) )
1333 const uno::Sequence< document::CmisProperty> aCmisProperties = xCmisDoc->getCmisProperties( );
1335 if ( !(xCmisDoc->isVersionable( ) && aCmisProperties.hasElements( )) )
1340 bool bIsGoogleFile =
false;
1341 bool bCheckedOut =
false;
1342 for (
const auto& rCmisProp : aCmisProperties )
1344 if ( rCmisProp.Id ==
"cmis:isVersionSeriesCheckedOut" ) {
1345 uno::Sequence< sal_Bool > bTmp;
1346 rCmisProp.Value >>= bTmp;
1347 bCheckedOut = bTmp[0];
1351 if ( rCmisProp.Name ==
"title" )
1352 bIsGoogleFile =
true;
1355 if ( bCheckedOut || bIsGoogleFile )
1373 m_pData->m_pViewShell->GetObjectShell()->CheckOut( );
1381 if ( !
m_pData->m_xTitleHelper.is ())
1384 Reference< frame::XUntitledNumbers > xUntitledProvider(
xModel , uno::UNO_QUERY );
1386 m_pData->m_xTitleHelper = new ::framework::TitleHelper(::comphelper::getProcessComponentContext(),
1387 Reference< frame::XController >(
this), xUntitledProvider);
1390 return m_pData->m_xTitleHelper;
1411 Reference< frame::XTitleChangeBroadcaster > xBroadcaster(
impl_getTitleHelper(), uno::UNO_QUERY);
1412 if (xBroadcaster.is ())
1413 xBroadcaster->addTitleChangeListener (xListener);
1420 Reference< frame::XTitleChangeBroadcaster > xBroadcaster(
impl_getTitleHelper(), uno::UNO_QUERY);
1421 if (xBroadcaster.is ())
1422 xBroadcaster->removeTitleChangeListener (xListener);
1430 const OUString& sSecondaryMessage,
1431 sal_Int32 aInfobarType,
1432 const Sequence<StringPair>& actionButtons,
1439 throw lang::IllegalArgumentException(
"Undefined InfobarType: "
1440 + OUString::number(aInfobarType),
1444 throw lang::IllegalArgumentException(
"Infobar with ID '" +
sId +
"' already existing.",
1449 static_cast<InfobarType>(aInfobarType), bShowCloseButton);
1451 throw uno::RuntimeException(
"Could not create Infobar");
1453 for (
const StringPair & actionButton : std::as_const(actionButtons))
1455 if (actionButton.First.isEmpty() || actionButton.Second.isEmpty())
1457 weld::Button& rBtn = pInfoBar->addButton(&actionButton.Second);
1463 const OUString& sSecondaryMessage,
1464 sal_Int32 aInfobarType)
1470 throw lang::IllegalArgumentException(
"Undefined InfobarType: "
1471 + OUString::number(aInfobarType),
1475 throw css::container::NoSuchElementException(
"Infobar with ID '" +
sId +
"' not found.");
1487 throw css::container::NoSuchElementException(
"Infobar with ID '" +
sId +
"' not found.");
SfxApplication * SfxGetpApp()
constexpr OUStringLiteral sViewId
constexpr OUStringLiteral sJumpMark
static bool Reschedule(bool bHandleAllCurrentEvents=false)
static OUString GetEventName(GlobalEventId nID)
void NotifyEvent(const SfxEventHint &rEvent, bool bSynchron=true)
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)
void Invalidate(sal_uInt16 nId)
SAL_DLLPRIVATE void Update_Impl(bool bForce=false)
void HideUI(bool bHide=true)
void Lock(bool bLock)
With this method the SfxDispatcher can be locked and released.
void Push(SfxShell &rShell)
With this method, a <SfxShell> pushed on to the SfxDispatcher.
void Flush()
This method performs outstanding push- and pop- commands.
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
SAL_DLLPRIVATE void SetIsClosing_Impl()
SAL_DLLPRIVATE void SetFrameInterface_Impl(const css::uno::Reference< css::frame::XFrame > &rFrame)
SAL_DLLPRIVATE void DoClose_Impl()
SAL_DLLPRIVATE SfxWorkWindow * GetWorkWindow_Impl() const
SAL_DLLPRIVATE bool IsMarkedHidden_Impl() const
vcl::Window & GetWindow() const
SAL_DLLPRIVATE bool OwnsBindings_Impl() const
SfxViewFactory * GetViewFactoryByViewName(std::u16string_view i_rViewName) const
returns the view factory whose GetAPIViewName or GetLegacyViewName delivers the requested logical nam...
SfxViewFactory & GetViewFactory(sal_uInt16 i=0) const
SAL_DLLPRIVATE sal_uInt16 GetViewNo_Impl(const SfxInterfaceId i_nViewId, const sal_uInt16 i_nFallback) const
sal_uInt16 GetViewFactoryCount() const
virtual bool PrepareClose(bool bUI=true)
virtual SfxObjectFactory & GetFactory() const =0
css::uno::Reference< css::frame::XModel3 > GetModel() const
bool IsHelpDocument() const
static OUString GetMasterUnoCommand(const css::util::URL &aURL)
SfxViewShell * GetViewShell() const
Returns the SfxViewShell in which they are located in the subshells.
static SfxSlotPool & GetSlotPool(SfxViewFrame *pFrame=nullptr)
OUString SeekGroup(sal_uInt16 nNo)
const SfxSlot * FirstSlot()
const SfxSlot * GetSlot(sal_uInt16 nId) const
const SfxSlot * GetUnoSlot(const OUString &rUnoName) const
const SfxSlot * NextSlot()
sal_uInt16 GetGroupCount() const
SfxGroupId GetGroupId() const
SFX2_DLLPUBLIC OUString GetCommand() const
SfxSlotMode GetMode() const
bool IsMode(SfxSlotMode nMode) const
OUString GetAPIViewName() const
returns an API-compatible view name.
SfxInterfaceId GetOrdinal() const
void LockAdjustPosSizePixel()
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
void RemoveInfoBar(std::u16string_view sId)
vcl::Window & GetWindow() const
SfxBindings & GetBindings()
void Resize(bool bForce=false)
SfxInterfaceId GetCurViewId() const
void SetChildWindow(sal_uInt16 nId, bool bVisible, bool bSetFocus=true)
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetNext(const SfxViewFrame &rPrev, const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
SfxDispatcher * GetDispatcher()
SfxChildWindow * GetChildWindow(sal_uInt16)
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
SfxFrame & GetFrame() const
virtual SfxObjectShell * GetObjectShell() override
bool HasInfoBarWithID(std::u16string_view sId)
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).
void Enable(bool bEnable)
SAL_DLLPRIVATE void MakeActive_Impl(bool bActivate)
void UnlockAdjustPosSizePixel()
void UpdateInfoBar(std::u16string_view sId, const OUString &sPrimaryMessage, const OUString &sSecondaryMessage, InfobarType eType)
One SfxViewShell more or less represents one edit window for a document, there can be multiple ones f...
virtual bool PrepareClose(bool bUI=true)
Initialize is called after the frame has been loaded and the controller has been set.
static SAL_WARN_UNUSED_RESULT SfxViewShell * Get(const css::uno::Reference< css::frame::XController > &i_rController)
css::uno::Reference< css::task::XStatusIndicator > GetStatusIndicator()
void SetInternalDockingAllowed(bool bSet)
VALUE_TYPE getOrDefault(const OUString &_rValueName, const VALUE_TYPE &_rDefault) const
css::uno::XInterface * next()
bool hasMoreElements() const
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
css::awt::Rectangle AWTRectangle(const ::tools::Rectangle &rVCLRect)
inline ::tools::Rectangle VCLRectangle(const css::awt::Rectangle &rAWTRect)
#define DBG_ASSERT(sCon, aError)
#define ENSURE_OR_THROW(c, m)
#define DBG_UNHANDLED_EXCEPTION(...)
#define LINK(Instance, Class, Member)
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
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)
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)
SfxViewShell * m_pViewShell
::sfx2::UserInputInterception m_aUserInputInterception
Sequence< PropertyValue > m_aCreationArgs
SfxBaseController * m_pController
Reference< XFrame > m_xFrame
::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< XTitle > m_xTitleHelper
Reference< XFrame > xFrame
Reference< XModel > xModel