20 #include <config_features.h>
22 #include <osl/file.hxx>
23 #include <osl/thread.hxx>
24 #include <osl/module.hxx>
25 #include <rtl/ustrbuf.hxx>
62 #include <strings.hrc>
63 #include <strings.hxx>
64 #if OSL_DEBUG_LEVEL > 0
68 #include <com/sun/star/uno/Reference.h>
69 #include <com/sun/star/awt/XToolkit.hpp>
72 #include <osl/process.h>
76 #include <string_view>
135 , maKeyEvent(rKeyEvent)
141 , maMouseEvent(rMouseEvent)
147 , maGestureEvent(rGestureEvent)
156 return pSVData->
mpApp;
162 OUString aVar(
"LIBO_VERSION"), aValue(LIBO_VERSION_DOTTED);
163 osl_setEnvironment(aVar.pData, aValue.pData);
178 SAL_WARN(
"vcl",
"Application is a base class and should be overridden.");
188 return pAppWin->
Close();
211 return static_cast<sal_uInt16
>(osl_getCommandArgCount());
217 osl_getCommandArg( nParam, &aParam.pData );
232 OUString aAppFileName;
233 OUString aExeFileName;
234 osl_getExecutableFile(&aExeFileName.pData);
237 osl::FileBase::getSystemPathFromFileURL(aExeFileName, aAppFileName);
251 Abort(
"Unknown Error");
261 #if OSL_DEBUG_LEVEL > 0
262 bool dumpCore =
true;
264 bool dumpCore =
false;
266 for (sal_uInt16
i = 0;
i != n; ++
i) {
287 return &ReservedKeys[i];
319 const std::vector<vcl::LOKPayloadItem>& )
const
342 if (xWin->IsVisible())
349 bool InjectKeyEvent(
SvStream& rStream)
366 sal_uInt16
nCode, nCharCode;
372 KeyEvent aVCLKeyEvt(nCharCode, nCode);
378 void CloseDialogsAndQuit()
390 mpEventTestingIdle->Start();
406 CloseDialogsAndQuit();
414 SAL_INFO(
"vcl.eventtesting",
"Event Input exhausted, exit next cycle");
455 SAL_INFO(
"vcl.schedule",
"Enter ImplYield: " << (i_bWait ?
"wait" :
"no wait") <<
456 ": " << (i_bAllEvents ?
"all events" :
"one event"));
472 SAL_INFO(
"vcl.schedule",
"Leave ImplYield with return " << bProcessedEvent );
473 return bProcessedEvent;
486 if (0 == ++nSanity % 1000)
488 SAL_WARN(
"vcl.schedule",
"ProcessEventsToIdle: " << nSanity);
491 #if OSL_DEBUG_LEVEL > 0
498 for (
int nTaskPriority = 0; nTaskPriority <
PRIO_COUNT; ++nTaskPriority)
501 while (pSchedulerData)
504 if (pSchedulerData->
mpTask)
515 pSchedulerData = pSchedulerData->
mpNext;
646 InitSettings(pSVData);
659 if (
bool(nChangeFlags) )
673 nOldDPIX = pFirstFrame->
GetDPIX();
674 nOldDPIY = pFirstFrame->
GetDPIY();
690 pClientWin = pTempWin;
697 pFrame = pFrame->
mpWindowImpl->mpFrameData->mpNextFrame;
705 if ( (pFirstFrame->
GetDPIX() != nOldDPIX) ||
706 (pFirstFrame->
GetDPIY() != nOldDPIY) )
712 (pVirDev->
GetDPIX() == nOldDPIX) &&
713 (pVirDev->
GetDPIY() == nOldDPIY) )
725 pVirDev = pVirDev->
mpNext;
738 InitSettings(pSVData);
775 pFrame = pFrame->
mpWindowImpl->mpFrameData->mpNextFrame;
815 rVec.erase( std::remove(rVec.begin(), rVec.end(), rKeyListener ), rVec.end() );
828 bool bProcessed =
false;
833 if( rLink.Call( aEvent ) )
847 if( pWin && pKeyEvent )
849 std::unique_ptr<ImplPostEventData> pPostEventData(
new ImplPostEventData( nEvent, pWin, *pKeyEvent ));
853 pPostEventData.get() );
857 pPostEventData->mnEventId = nEventId;
870 if (pWin && pGestureEvent)
872 Point aTransformedPosition(pGestureEvent->
mnX, pGestureEvent->
mnY);
878 sal_Int32(aTransformedPosition.X()),
879 sal_Int32(aTransformedPosition.Y()),
885 std::unique_ptr<ImplPostEventData> pPostEventData(
new ImplPostEventData(nEvent, pWin, aGestureEvent));
889 pPostEventData.get());
893 pPostEventData->mnEventId = nEventId;
906 if( pWin && pMouseEvent )
920 std::unique_ptr<ImplPostEventData> pPostEventData(
new ImplPostEventData( nEvent, pWin, aTransformedEvent ));
924 pPostEventData.get() );
928 pPostEventData->mnEventId = nEventId;
941 const void* pEventData;
979 pEventData =
nullptr;
988 ::std::vector< ImplPostEventPair >::iterator aIter( svdata->maAppData.maPostedEventList.begin() );
990 while( aIter != svdata->maAppData.maPostedEventList.end() )
992 if( nEventId == (*aIter).second->mnEventId )
994 delete (*aIter).second;
995 aIter = svdata->maAppData.maPostedEventList.erase( aIter );
1008 ::std::vector< ImplPostEventPair >::iterator aIter( svdata->maAppData.maPostedEventList.begin() );
1010 while( aIter != svdata->maAppData.maPostedEventList.end() )
1012 if( pWin == (*aIter).first )
1014 if( (*aIter).second->mnEventId )
1017 delete (*aIter).second;
1018 aIter = svdata->maAppData.maPostedEventList.erase( aIter );
1026 bool bReferenceLink )
1029 if ( pDefWindow ==
nullptr )
1032 std::unique_ptr<ImplSVEvent> pSVEvent(
new ImplSVEvent);
1033 pSVEvent->mpData = pCaller;
1034 pSVEvent->maLink = rLink;
1035 pSVEvent->mpWindow =
nullptr;
1036 pSVEvent->mbCall =
true;
1041 assert(dynamic_cast<vcl::Window *>(
1042 static_cast<OutputDevice *>(rLink.GetInstance())) ==
1044 pSVEvent->mpInstanceRef =
static_cast<vcl::Window *
>(rLink.GetInstance());
1047 auto pTmpEvent = pSVEvent.get();
1058 "Application::RemoveUserEvent(): Event is send to a window" );
1060 "Application::RemoveUserEvent(): Event is already removed" );
1064 nUserEvent->
mbCall =
false;
1086 return pWindow->
mpWindowImpl->mpFrameData->mpNextFrame;
1112 if( nIdx == nIndex )
1151 static OUString
Localize(
const char *pId,
const bool bLocalize)
1162 OUStringBuffer aDetails;
1164 const auto appendDetails = [&aDetails](std::u16string_view sep,
auto&& val) {
1165 if (!aDetails.isEmpty() && !sep.empty())
1166 aDetails.append(sep);
1167 aDetails.append(std::move(val));
1170 if (bSelection !=
hwUI) {
1171 appendDetails(
u"; ",
Localize(SV_APP_CPUTHREADS, bLocalize)
1172 + OUString::number(std::thread::hardware_concurrency()));
1180 appendDetails(
u"; ",
Localize(SV_APP_OSVERSION, bLocalize) + aVersion);
1183 if (bSelection !=
hwEnv) {
1184 appendDetails(
u"; ",
Localize(SV_APP_UIRENDER, bLocalize));
1185 #if HAVE_FEATURE_SKIA
1188 switch(SkiaHelper::renderMethodToUse())
1190 case SkiaHelper::RenderVulkan:
1191 appendDetails(
u"",
Localize(SV_APP_SKIA_VULKAN, bLocalize));
1193 case SkiaHelper::RenderRaster:
1194 appendDetails(
u"",
Localize(SV_APP_SKIA_RASTER, bLocalize));
1200 appendDetails(
u"",
Localize(SV_APP_DEFAULT, bLocalize));
1202 #if (defined LINUX || defined _WIN32 || defined MACOSX || defined __FreeBSD__)
1207 return aDetails.makeStringAndClear();
1273 SAL_WARN(
"vcl",
"Requesting screen size/pos for screen #" << nScreen <<
" failed");
1279 SAL_WARN(
"vcl",
"Requesting screen size/pos for screen #" << nScreen <<
" returned 0 height.");
1287 (i_rRect.
Top() + i_rRect.
Bottom())/ 2 );
1288 const tools::Long nDX = aRectCenter.X() - i_rPoint.X();
1289 const tools::Long nDY = aRectCenter.Y() - i_rPoint.Y();
1290 return nDX*nDX + nDY*nDY;
1300 unsigned int nBestMatchScreen = 0;
1301 unsigned long nOverlap = 0;
1302 for(
unsigned int i = 0;
i < nScreens;
i++ )
1306 if( aCurScreenRect.
IsInside( i_rRect ) )
1310 if( ! aIntersection.IsEmpty() )
1312 const unsigned long nCurOverlap( aIntersection.GetWidth() * aIntersection.GetHeight() );
1313 if( nCurOverlap > nOverlap )
1315 nOverlap = nCurOverlap;
1316 nBestMatchScreen =
i;
1321 return nBestMatchScreen;
1326 tools::Long nDist = std::numeric_limits<tools::Long>::max();
1327 for(
unsigned int i = 0;
i < nScreens;
i++ )
1330 const tools::Long nCurDist( calcDistSquare( aCenter, aCurScreenRect ) );
1331 if( nCurDist < nDist )
1333 nBestMatchScreen =
i;
1337 return nBestMatchScreen;
1402 OSL_FAIL(
"Window hierarchy corrupted!" );
1409 return pWin->
mpWindowImpl->mpFrameWindow->ImplGetWindow();
1417 return pWin->
mpWindowImpl->mpFrameWindow->ImplGetWindow();
1431 return pWin->
mpWindowImpl->mpFrameWindow->ImplGetWindow();
1467 css::uno::Reference< css::awt::XToolkit > xT;
1474 #ifdef DISABLE_DYNLOADING
1487 static bool bAlreadyTriedToCreate =
false;
1488 if ( !pSVData->
mpUnoWrapper && bCreateIfNotExist && !bAlreadyTriedToCreate )
1490 #ifndef DISABLE_DYNLOADING
1492 aTkLib.loadRelative(&
thisModule, TK_DLL_NAME);
1496 if ( fnCreateWrapper )
1506 bAlreadyTriedToCreate =
true;
1546 if (eOldMode != eNewMode)
1580 bEventTestingMode =
true;
1596 const OUString& sMessage)
1602 SAL_WARN(
"vcl",
"ShowNativeMessageBox returned " << btn);
1610 static const OUString aNone(
"none");
1629 bool bRet = ImplInitAccessBridge();
1636 aMisc.SetEnableATToolSupport(
false );
1655 Reference< ui::dialogs::XFilePicker2 >
1662 Reference< ui::dialogs::XFolderPicker2 >
1681 LibreOfficeKitPollCallback pPollCallback,
1682 LibreOfficeKitWakeCallback pWakeCallback,
static vcl::Window * GetTopWindow(tools::Long nIndex)
Get the nth top window.
static OUString GetDisplayName()
Get the default name of the application for message dialogs and printing.
do not automatically cancel dialogs
#define LINK(Instance, Class, Member)
constexpr sal_uInt16 KEY_4
const OUString & SalGetDesktopEnvironment()
static bool bEventTestingMode
static OUString GetAppName()
Get the application's name.
vcl::Window * ImplGetWindow() const
if this is a proxy return the client, otherwise itself
const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK
const LocaleDataWrapper & GetLocaleDataWrapper() const
constexpr sal_uInt16 KEY_7
static void AcquireSolarMutex(sal_uInt32 nCount)
Acquire Solar Mutex(es) for this thread.
oslThreadIdentifier mnMainThreadId
VclPtr< vcl::Window > mpFocusWin
Application()
Default constructor for Application class.
constexpr sal_uInt16 KEY_MOD1
static comphelper::SolarMutex & GetSolarMutex()
Get the Solar Mutex for this thread.
static bool IsUICaptured()
static bool IsMainThread()
Queries whether we are in main thread.
static bool IsInExecute()
Queries whether the application is in the event loop.
std::optional< OUString > mxToolkitName
Link< LinkParamNone *, void > maDeInitHook
static void NotifyAllWindows(DataChangedEvent &rDCEvt)
Notify all windows that the application has changed data.
SvStream & ReadUInt16(sal_uInt16 &rUInt16)
const LanguageTag & GetUILanguageTag() const
std::unique_ptr< ContentProperties > pData
VclPtr< VirtualDevice > mpNext
static bool IsBitmapRendering()
Determines if bitmap rendering is enabled.
void NotifyAllChildren(DataChangedEvent &rDCEvt)
static sal_uInt16 GetDispatchLevel()
Return how many events are being dispatched.
virtual void InitFinished()
Finish initialization of the application.
constexpr sal_uInt16 KEY_2
static Help * GetHelp()
Gets the application's help.
static tools::Long GetTopWindowCount()
Return the number of top-level windows being used by the application.
ImplPostEventData(VclEventId nEvent, vcl::Window *pWin, const GestureEvent &rGestureEvent)
static SAL_DLLPRIVATE void ImplInitAppFontData(vcl::Window const *pWindow)
LanguageType getLanguageType(bool bResolveSystem=true) const
static vcl::Window * GetDefDialogParent()
Get the default parent window for dialog boxes.
static void RemoveEventListener(const Link< VclSimpleEvent &, void > &rEventListener)
Remove a VCL event listener from the application.
void SetMiscSettings(const MiscSettings &rSet)
MouseEventModifiers GetMode() const
static size_t GetReservedKeyCodeCount()
Get the number of reserved key codes used by the application.
std::unique_ptr< GraphicConverter > mxGrfConverter
bool ImplWindowFrameProc(vcl::Window *_pWindow, SalEvent nEvent, const void *pEvent)
static const AllSettings & GetSettings()
Gets the application's settings.
constexpr sal_uInt16 KEY_0
virtual bool IsMainThread() const =0
static ImplSVEvent * PostGestureEvent(VclEventId nEvent, vcl::Window *pWin, GestureEvent const *pGestureEvent)
virtual css::uno::Reference< css::ui::dialogs::XFilePicker2 > createFilePicker(const css::uno::Reference< css::uno::XComponentContext > &)
SAL_DLLPRIVATE void SetDPIX(sal_Int32 nDPIX)
bool IsMapModeEnabled() const
tools::Long GetOutOffXPixel() const
Important idle events to be run before processing drawing events.
std::unique_ptr< AllSettings > mpSettings
ImplPostEventData(VclEventId nEvent, vcl::Window *pWin, const KeyEvent &rKeyEvent)
IMPL_STATIC_LINK_NOARG(ImplSVAppData, ImplEndAllPopupsMsg, void *, void)
constexpr sal_uInt16 KEY_F4
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
Post a user event to the default window.
const MapMode & GetMapMode() const
static void EndAllPopups()
Cancel all open popups.
static bool IsUnifiedDisplay()
Determines if the screens that make up a display are separate or form one large display area...
virtual int ShowNativeMessageBox(const OUString &rTitle, const OUString &rMessage)=0
Idle * mpEventTestingIdle
static OUString GetHWOSConfInfo(const int bSelection=0, bool bLocalize=true)
Get useful OS, Hardware and configuration information, cf.
static void EnableSafeMode()
Set safe mode to enabled.
constexpr sal_uInt16 KEY_F6
static void EndAllDialogs()
Cancel all open dialogs.
virtual unsigned int GetDisplayBuiltInScreen()
constexpr sal_uInt16 KEY_ADD
std::vector< Link< VclWindowEvent &, bool > > maKeyListeners
virtual void Exception(ExceptionCategory nCategory)
Handles an error.
virtual bool AnyInput(VclInputFlags nType)=0
An application can be notified of a number of different events:
static void AddEventListener(const Link< VclSimpleEvent &, void > &rEventListener)
Add a VCL event listener to the application.
ImplSchedulerData * mpFirstSchedulerData[PRIO_COUNT]
list of all active tasks per priority
virtual css::uno::Reference< css::ui::dialogs::XFolderPicker2 > createFolderPicker(const css::uno::Reference< css::uno::XComponentContext > &)
static bool ImplYield(bool i_bWait, bool i_bAllEvents)
static void EnableConsoleOnly()
Enable Console Only mode.
std::optional< OUString > mxAppFileName
virtual bool hasNativeFileSelection() const
static const OUString & GetDesktopEnvironment()
Get the desktop environment the process is currently running in.
static OUString GetCommandLineParam(sal_uInt16 nParam)
Gets a particular command line parameter.
static OUString Localize(const char *pId, const bool bLocalize)
static css::uno::Reference< css::awt::XDisplayConnection > GetDisplayConnection()
GestureEventType meEventType
static bool IsSafeModeEnabled()
Determines if safe mode is enabled.
constexpr sal_uInt16 KEY_F1
static OutputDevice * GetDefaultDevice()
Get the default "device" (in this case the default window).
constexpr sal_uInt16 KEY_9
virtual tools::Rectangle GetDisplayScreenPosSizePixel(unsigned int nScreen)=0
sal_uInt16 GetClicks() const
std::locale Create(const char *pPrefixName, const LanguageTag &rLocale)
static void ImplCallEventListenersApplicationDataChanged(void *pData)
Send event to all VCL application event listeners.
std::vector< ImplPostEventPair > maPostedEventList
virtual bool Close() override
void AcquireYieldMutex(sal_uInt32 nCount=1)
LibreOfficeKitPollCallback mpPollCallback
static void SetFilterHdl(const Link< ConvertData &, bool > &rLink)
Setup a new graphics filter.
virtual unsigned int GetDisplayScreenCount()=0
UnoWrapperBase *(* FN_TkCreateUnoWrapper)()
sal_uInt16 GetButtons() const
static unsigned int GetDisplayExternalScreen()
Get the display's external screen.
static void Yield()
Process the next event.
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
void removeListener(const Link< VclSimpleEvent &, void > &rListener)
constexpr sal_uInt16 KEY_1
void SalAbort(const OUString &rErrorText, bool bDumpCore)
constexpr sal_uInt16 KEY_F2
virtual void Start() override
Activates the timer task.
static void RemoveKeyListener(const Link< VclWindowEvent &, bool > &rKeyListener)
Remove a keypress listener from the application.
#define SV_APP_VCLBACKEND
static void SetAppName(const OUString &rUniqueName)
Set the application's name.
static void Quit()
Quit the program.
VclPtr< VirtualDevice > mpFirstVirDev
ImplSchedulerData * mpNext
Pointer to the next element in list.
static SystemWindowFlags GetSystemWindowMode()
Get the system window mode of dialogs.
virtual void updateMainThread()
Set the app's (somewhat) magic/main-thread to this one.
void Call(VclSimpleEvent &rEvent) const
void registerPollCallbacks(LibreOfficeKitPollCallback pPollCallback, LibreOfficeKitWakeCallback pWakeCallback, void *pData)
static void ImplCallEventListeners(VclSimpleEvent &rEvent)
Send event to all VCL application event listeners.
static bool IsDialogCancelEnabled()
Determines if dialog cancel mode is enabled.
#define SAL_N_ELEMENTS(arr)
virtual css::uno::Reference< css::awt::XToolkit > GetVCLToolkit()=0
WinBits const WB_INTROWIN
LibreOfficeKitWakeCallback mpWakeCallback
static ImplSVEvent * PostMouseEvent(VclEventId nEvent, vcl::Window *pWin, MouseEvent const *pMouseEvent)
Send mouse event.
static void RemoveUserEvent(ImplSVEvent *nUserEvent)
Remove user event based on event ID.
static vcl::Window * GetFirstTopLevelWindow()
Get the first top-level window of the application.
static bool IsEventTestingModeEnabled()
Determines if event testing mode is enabled.
constexpr sal_uInt16 KEY_5
ImplSVData * ImplGetSVData()
void RemoveAccel(Accelerator const *pAccel)
SalSystem * ImplGetSalSystem()
static tools::Rectangle GetScreenPosSizePixel(unsigned int nScreen)
Get a screen's rectangular area.
VclPtr< vcl::Window > mpCaptureWin
static bool Reschedule(bool bHandleAllCurrentEvents=false)
Attempt to process current pending event(s)
silently cancel any dialogs
static void ShowNativeErrorBox(const OUString &sTitle, const OUString &sMessage)
SvFileStream * mpEventTestInput
comphelper::SolarMutex * GetYieldMutex()
ImplPostEventData(VclEventId nEvent, vcl::Window *pWin, const MouseEvent &rMouseEvent)
void unregisterPollCallbacks()
virtual bool PostEvent(std::unique_ptr< ImplSVEvent > pData)=0
virtual void releaseMainThread()
Disconnect that - good for detaching from the JavaVM on Android.
VclPtr< vcl::Window > mpInstanceRef
void EndAllDialogs(vcl::Window const *pParent)
static bool AnyInput(VclInputFlags nType=VCL_INPUT_ANY)
Determine if there are any pending input events.
static const LocaleDataWrapper & GetAppLocaleDataWrapper()
Get the application's locale data wrapper.
static void SetSystemWindowMode(SystemWindowFlags nMode)
Make a dialog box a system window or not.
virtual OUString getOSVersion()
get information about underlying versions
static void SetSettings(const AllSettings &rSettings)
Sets the application's settings and notifies all windows of the change.
static bool InsertAccel(Accelerator *pAccel)
Insert accelerator.
Task * mpTask
Pointer to VCL Task instance.
static css::uno::Reference< css::ui::dialogs::XFilePicker2 > createFilePicker(const css::uno::Reference< css::uno::XComponentContext > &rServiceManager)
Create a platform specific file picker, if one is available, otherwise return an empty reference...
static void EnableEventTestingMode()
Enables event testing mode.
static void UpdateMainThread()
Update main thread identifier.
VclPtr< WorkWindow > mpAppWin
bool IsMenuFloatingWindow() const
SystemWindowFlags mnSysWinMode
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
static OUString GetToolkitName()
Get the toolkit's name.
static ImplSVEvent * PostKeyEvent(VclEventId nEvent, vcl::Window *pWin, KeyEvent const *pKeyEvent)
Send keypress event.
std::unique_ptr< WindowImpl > mpWindowImpl
constexpr sal_uInt16 KEY_3
LocaleConfigurationListener * mpCfgListener
static sal_uInt64 GetLastInputInterval()
The interval from the last time that input was received.
VclPtr< vcl::Window > mpWin
static bool HandleKey(VclEventId nEvent, vcl::Window *pWin, KeyEvent *pKeyEvent)
Handle keypress event.
IMPL_STATIC_LINK(Application, PostEventHandler, void *, pCallData, void)
sal_uInt32 ReleaseYieldMutexAll()
GestureEvent maGestureEvent
static unsigned int GetScreenCount()
Get the number of screens available for the display.
Base class used mainly for the LibreOffice Desktop class.
static SAL_DLLPRIVATE unsigned int GetBestScreen(const tools::Rectangle &)
Get the "best" screen.
sal_uInt16 GetModifier() const
virtual void libreOfficeKitViewCallback(int nType, const char *pPayload) const override
constexpr sal_uInt16 KEY_MOD2
virtual void AppEvent(const ApplicationEvent &rAppEvent)
constexpr sal_uInt16 KEY_F10
VclPtr< vcl::Window > mpTrackWin
SAL_DLLPRIVATE vcl::Window * ImplGetClientWindow() const
static DialogCancelMode GetDialogCancelMode()
Gets the dialog cancel mode for headless environments.
static vcl::Window * GetActiveTopWindow()
Get the "active" top window.
virtual void notifyWindow(vcl::LOKWindowId nLOKWindowId, const OUString &rAction, const std::vector< vcl::LOKPayloadItem > &rPayload=std::vector< vcl::LOKPayloadItem >()) const override
constexpr sal_uInt16 KEY_6
static bool IsInMain()
Queries whether the application is in "main", i.e.
tools::Long GetOutOffYPixel() const
ImplSchedulerContext maSchedCtx
static void MergeSystemSettings(AllSettings &rSettings)
Set the settings object to the platform/desktop environment system settings.
static sal_uInt16 GetCommandLineParamCount()
Gets the number of command line parameters passed to the application.
SalFrame * ImplGetFrame() const
virtual void Init()
Initialize the application itself.
virtual bool IsUnifiedDisplay()
static void SetDialogCancelMode(DialogCancelMode mode)
Sets the dialog cancel mode for headless environments.
static vcl::Window * GetFocusWindow()
Get the currently focused window.
static void AddToRecentDocumentList(const OUString &rFileUrl, const OUString &rMimeType, const OUString &rDocumentService)
Add a file to the system shells recent document list if there is any.
static void setDeInitHook(Link< LinkParamNone *, void > const &hook)
VCL_DLLPUBLIC bool isVCLSkiaEnabled()
static bool IsInModalMode()
Queries whether application has a modal dialog active.
constexpr sal_uInt16 KEY_8
LibreOfficeKitCallback m_pCallback
static sal_uInt32 ReleaseSolarMutex()
Release Solar Mutex(es) for this thread.
static void Abort(const OUString &rErrorText)
Ends the program prematurely with an error message.
static vcl::Window * GetNextTopLevelWindow(vcl::Window const *pWindow)
Get the next top level window.
static bool IsHeadlessModeEnabled()
Determines if headless mode is enabled.
#define SAL_WARN_IF(condition, area, stream)
static void SetUnoWrapper(UnoWrapperBase *pWrapper)
Sets the application's UNO Wrapper object.
ImplSVFrameData maFrameData
virtual OUString GetText() const override
static void SetHelp(Help *pHelp=nullptr)
Sets up help.
#define SAL_INFO(area, stream)
static css::uno::Reference< css::ui::dialogs::XFolderPicker2 > createFolderPicker(const css::uno::Reference< css::uno::XComponentContext > &rServiceManager)
Create a platform specific folder picker, if one is available, otherwise return an empty reference...
VclPtr< vcl::Window > mpActiveApplicationFrame
TOOLKIT_DLLPUBLIC UnoWrapperBase * CreateUnoWrapper()
static void EnableBitmapRendering()
Enable software-only bitmap rendering.
virtual void AddToRecentDocumentList(const OUString &rFileUrl, const OUString &rMimeType, const OUString &rDocumentService)=0
sal_uInt16 mnDispatchLevel
IMPL_LINK_NOARG(ImplSVAppData, VclEventTestingHdl, Timer *, void)
SAL_DLLPUBLIC_EXPORT void unit_lok_process_events_to_idle()
used by unit tests that test only via the LOK API
PanningOrientation meOrientation
VclEventListeners maEventListeners
cancel any dialogs by std::abort
static void ProcessEventsToIdle()
Process all events until none is pending.
static css::uno::Reference< css::awt::XToolkit > GetVCLToolkit()
Gets the VCL toolkit.
void SetInvokeHandler(const Link< Timer *, void > &rLink)
SAL_DLLPRIVATE void SetDPIY(sal_Int32 nDPIY)
virtual bool QueryExit()
Exit from the application.
const Point & GetPosPixel() const
virtual void OverrideSystemSettings(AllSettings &rSettings)
Sets user settings in settings object to override system settings.
static void EnableHeadlessMode(bool dialogsAreFatal)
Enables headless mode.
SAL_DLLPRIVATE void ImplUpdateGlobalSettings(AllSettings &rSettings, bool bCallHdl=true) const
VclPtr< FloatingWindow > mpFirstFloat
VclPtr< vcl::Window > mpWindow
virtual void DeInit()
Deinitialized the application itself.
DialogCancelMode meDialogCancel
static void RemoveMouseAndKeyEvents(vcl::Window *pWin)
Remove mouse and keypress events from a window...
const MiscSettings & GetMiscSettings() const
reference_type * get() const
Get the body.
VclPtr< vcl::Window > mpFirstFrame
#define SAL_WARN(area, stream)
ImplAccelManager * mpAccelMgr
OUString VclResId(const char *pId)
void SetPriority(TaskPriority ePriority)
static unsigned int GetDisplayBuiltInScreen()
Get the built-in screen.
virtual bool DoYield(bool bWait, bool bHandleAllCurrentEvents)=0
Wait for the next event (if bWait) and dispatch it, includes posted events, and timers.
#define DBG_TESTSOLARMUTEX()
std::optional< OUString > mxDisplayName
OUString get(const char *pContextAndId, const std::locale &loc)
static UnoWrapperBase * GetUnoWrapper(bool bCreateIfNotExists=true)
Get the application's UNO wrapper object.
std::optional< OUString > mxAppName
static const vcl::KeyCode * GetReservedKeyCode(size_t i)
Get the reserved key code.
rtl::Reference< vcl::DisplayConnectionDispatch > mxDisplayConnection
constexpr sal_uInt16 KEY_SHIFT
bool InsertAccel(Accelerator *pAccel)
virtual ~Application()
Virtual destructor for Application class.
UnoWrapperBase * mpUnoWrapper
vcl::Window * ImplGetDefaultWindow()
Returns either the application window, or the default GL context window.
static OUString GetAppFileName()
Get the name of the file used to start the application.
const char * GetDebugName() const
SAL_DLLPRIVATE sal_Int32 GetDPIY() const
Get the output device's DPI y-axis value.
AllSettingsFlags GetChangeFlags(const AllSettings &rSettings) const
void EndPopupMode(FloatWinPopupEndFlags nFlags=FloatWinPopupEndFlags::NONE)
static void RemoveAccel(Accelerator const *pAccel)
Remove accelerator.
SAL_DLLPRIVATE sal_Int32 GetDPIX() const
Get the output device's DPI x-axis value.
An idle is a timer to be scheduled immediately.
bool mbInScheduler
Is the Task currently processed / on the stack?
ImplSVWinData * mpWinData
static bool IsQuit()
Has Quit() been called?
static void SetDisplayName(const OUString &rDisplayName)
Set the default name of the application for message dialogs and printing.
void addListener(const Link< VclSimpleEvent &, void > &rListener)
void UpdateSettings(const AllSettings &rSettings, bool bChild=false)
static void Execute()
Run the main event processing loop until it is quit by Quit().
static bool hasNativeFileSelection()
Do we have a native / system file selector available?
static void AddKeyListener(const Link< VclWindowEvent &, bool > &rKeyListener)
Add a keypress listener to the application.
virtual int Main()
Pure virtual entrypoint to the application.