20#include <config_features.h>
23#include <com/sun/star/frame/XTerminateListener.hpp>
24#include <com/sun/star/uno/Reference.hxx>
25#include <com/sun/star/frame/theGlobalEventBroadcaster.hpp>
26#include <com/sun/star/frame/Desktop.hpp>
27#include <com/sun/star/lang/XServiceInfo.hpp>
35#include <osl/module.hxx>
55class SfxTerminateListener_Impl :
public ::cppu::WeakImplHelper< XTerminateListener, XServiceInfo >
60 virtual void SAL_CALL queryTermination(
const EventObject& aEvent )
override;
61 virtual void SAL_CALL notifyTermination(
const EventObject& aEvent )
override;
62 virtual void SAL_CALL disposing(
const EventObject& Source )
override;
72void SAL_CALL SfxTerminateListener_Impl::disposing(
const EventObject& )
76void SAL_CALL SfxTerminateListener_Impl::queryTermination(
const EventObject& )
80void SAL_CALL SfxTerminateListener_Impl::notifyTermination(
const EventObject& aEvent )
82 Reference< XDesktop > xDesktop(
aEvent.Source, UNO_QUERY );
84 xDesktop->removeTerminateListener(
this );
94 css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
95 css::uno::Reference< css::document::XDocumentEventListener >
xGlobalBroadcaster(css::frame::theGlobalEventBroadcaster::get(xContext), css::uno::UNO_QUERY_THROW);
97 css::document::DocumentEvent aEvent2;
98 aEvent2.EventName =
"OnCloseApp";
105OUString SAL_CALL SfxTerminateListener_Impl::getImplementationName()
107 return "com.sun.star.comp.sfx2.SfxTerminateListener";
110sal_Bool SAL_CALL SfxTerminateListener_Impl::supportsService(
const OUString& sServiceName )
115Sequence< OUString > SAL_CALL SfxTerminateListener_Impl::getSupportedServiceNames()
123 return {
"com.sun.star.frame.TerminateListener" };
134#ifndef DISABLE_DYNLOADING
148#ifndef DISABLE_DYNLOADING
154 DBG_ASSERT( pfunc,
"GetSpecialCharsForEdit() not found!" );
163 if ( pfunc_getSpecialCharsForEdit )
166 (*pfunc_getSpecialCharsForEdit)( pParent, rFont, aRet );
175 StgIo::SetErrorLink(
LINK(
this, SfxStorageErrHdl,
Error ) );
178 Reference < XDesktop2 > xDesktop = Desktop::create ( ::comphelper::getProcessComponentContext() );
179 xDesktop->addTerminateListener(
new SfxTerminateListener_Impl );
187 pImpl->m_pToolsErrorHdl.emplace(
188 RID_ERRHDL, ErrCodeArea::Io, ErrCodeArea::Vcl);
190 pImpl->m_pSoErrorHdl.emplace(
192#if HAVE_FEATURE_SCRIPTING
193 pImpl->m_pSbxErrorHdl.emplace(
202 pImpl->mxAppPickList.emplace(*
this);
206 pImpl->pAppDispat.emplace();
207 pImpl->pSlotPool.emplace();
212 pImpl->bDowning =
false;
218 if (
pImpl->bDowning )
222 pImpl->pAppDispat->Push(*
this);
223 pImpl->pAppDispat->Flush();
224 pImpl->pAppDispat->DoActivate_Impl(
true );
Reference< css::document::XDocumentEventListener > xGlobalBroadcaster
SfxApplication * SfxGetpApp()
bool(* PFunc_getSpecialCharsForEdit)(weld::Widget *i_pParent, const vcl::Font &i_rFont, OUString &o_rOutString)
static OUString SfxGetSpecialCharsForEdit(weld::Widget *pParent, const vcl::Font &rFont)
static void EnableContextHelp()
static void EnableExtHelp()
static SfxItemPool * GetItemPool()
rtl::Reference< SfxStatusDispatcher > mxAppDispatch
SAL_DLLPRIVATE SfxAppData_Impl * Get_Impl() const
std::unique_ptr< SfxAppData_Impl > pImpl
SAL_DLLPRIVATE void Initialize_Impl()
static SAL_DLLPRIVATE void Registrations_Impl()
void Broadcast(const SfxHint &rHint)
void SetPool(SfxItemPool *pNewPool)
With this method, the subclasses register their special <SfxItemPool> in the SfxShell.
static void storeConfigItems()
#define DBG_ASSERT(sCon, aError)
SVT_DLLPUBLIC const ErrMsgCode RID_ERRHDL[]
SAL_DLLPUBLIC_EXPORT bool GetSpecialCharsForEdit(weld::Widget *i_pParent, const vcl::Font &i_rFont, OUString &o_rResult)
#define LINK(Instance, Class, Member)
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
void SetGetSpecialCharsFunction(FncGetSpecialChars fn)
BASIC_DLLPUBLIC std::pair< TranslateId, ErrCode > const RID_BASIC_START[]
std::locale BasResLocale()
SVT_DLLPUBLIC const ErrMsgCode RID_SO_ERROR_HANDLER[]
SVT_DLLPUBLIC std::locale SvtResLocale()