20#ifndef INCLUDED_VCL_SVAPP_HXX
21#define INCLUDED_VCL_SVAPP_HXX
30#include <LibreOfficeKit/LibreOfficeKitTypes.h>
31#include <osl/mutex.hxx>
32#include <rtl/ustring.hxx>
33#include <osl/thread.h>
44#include <com/sun/star/uno/Reference.h>
62namespace vcl {
class KeyCode; }
69namespace basegfx {
class SystemDependentDataManager; }
72 class XComponentContext;
80 class XDisplayConnection;
138 assert(
type == Type::Appear ||
type == Type::PrivateDoShutdown ||
type == Type::QuickStart);
151 type == Type::Accept ||
type == Type::OpenHelpUrl
152 ||
type == Type::ShowDialog ||
type == Type::Unaccept);
153 aData.push_back(data);
166 assert(
type == Type::Open ||
type == Type::Print);
189 ||
aEvent == Type::OpenHelpUrl ||
aEvent == Type::ShowDialog
190 ||
aEvent == Type::Unaccept);
191 assert(
aData.size() == 1);
271 virtual void InitFinished();
280 virtual void DeInit();
350 virtual bool QueryExit();
385 static sal_uInt16 GetCommandLineParamCount();
395 static OUString GetCommandLineParam( sal_uInt16 nParam );
403 static OUString GetAppFileName();
433 static void Abort(
const OUString& rErrorText );
460 static bool IsQuit();
477 static bool Reschedule(
bool bHandleAllCurrentEvents =
false );
494 static void EndYield();
515 static bool IsMainThread();
527 static sal_uInt32 ReleaseSolarMutex();
537 static void AcquireSolarMutex( sal_uInt32
nCount );
546 static bool IsInMain();
554 static bool IsInExecute();
562 static bool IsInModalMode();
568 static sal_uInt16 GetDispatchLevel();
587 static sal_uInt64 GetLastInputInterval();
599 static bool IsUICaptured();
623 virtual void OverrideSystemSettings(
AllSettings& rSettings );
632 static void MergeSystemSettings(
AllSettings& rSettings );
642 static void SetSettings(
const AllSettings& rSettings );
713 static void ImplCallEventListenersApplicationDataChanged(
void*
pData );
764 static void RemoveMouseAndKeyEvents(
vcl::Window *pWin );
781 bool bReferenceLink =
false );
787 static void RemoveUserEvent(
ImplSVEvent * nUserEvent );
797 static css::uno::Reference< css::awt::XDisplayConnection > GetDisplayConnection();
900 static void SetAppName(
const OUString& rUniqueName );
911 static OUString GetAppName();
918 static OUString GetOSVersion();
925 static OUString GetHWOSConfInfo(
const int bSelection = 0,
bool bLocalize =
true);
934 static bool LoadBrandBitmap (std::u16string_view
pName,
BitmapEx &rBitmap);
948 static void SetDisplayName(
const OUString& rDisplayName );
954 static OUString GetDisplayName();
960 static OUString GetToolkitName();
968 static unsigned int GetScreenCount();
990 static bool IsUnifiedDisplay();
1002 SAL_DLLPRIVATE
static unsigned int GetBestScreen(
const tools::Rectangle& );
1014 static unsigned int GetDisplayBuiltInScreen();
1023 static unsigned int GetDisplayExternalScreen();
1053 static void RemoveAccel(
Accelerator const * pAccel );
1061 static size_t GetReservedKeyCodeCount();
1088 static void SetHelp(
Help* pHelp =
nullptr );
1097 static Help* GetHelp();
1153 static bool IsDialogCancelEnabled();
1190 static css::uno::Reference< css::awt::XToolkit > GetVCLToolkit();
1216 static void EnableHeadlessMode(
bool dialogsAreFatal );
1222 static bool IsHeadlessModeEnabled();
1228 static void EnableConsoleOnly();
1232 static void EnableBitmapRendering();
1238 static bool IsBitmapRendering();
1248 static void EnableEventTestingMode();
1254 static bool IsEventTestingModeEnabled();
1257 static void EnableSafeMode();
1260 static bool IsSafeModeEnabled();
1268 static const OUString& GetDesktopEnvironment();
1287 static void AddToRecentDocumentList(
const OUString& rFileUrl,
const OUString& rMimeType,
const OUString& rDocumentService);
1295 static void ShowNativeErrorBox(
const OUString& sTitle ,
1299 static void UpdateMainThread();
1305 static bool hasNativeFileSelection();
1314 static css::uno::Reference< css::ui::dialogs::XFilePicker2 >
1315 createFilePicker(
const css::uno::Reference< css::uno::XComponentContext >& rServiceManager );
1324 static css::uno::Reference< css::ui::dialogs::XFolderPicker2 >
1325 createFolderPicker(
const css::uno::Reference< css::uno::XComponentContext >& rServiceManager );
1333 static void EndAllPopups();
1339 static bool IsOnSystemEventLoop();
1346 static std::unique_ptr<weld::Builder> CreateBuilder(
weld::Widget* pParent,
const OUString &rUIFile,
bool bMobile =
false, sal_uInt64 nLOKWindowId = 0);
1348 static std::unique_ptr<weld::Builder> CreateInterimBuilder(
vcl::Window* pParent,
const OUString &rUIFile,
bool bAllowCycleFocusOut, sal_uInt64 nLOKWindowId = 0);
1360 const OUString& rAction,
1361 const std::vector<vcl::LOKPayloadItem>& rPayload = std::vector<vcl::LOKPayloadItem>())
const override;
1362 virtual void libreOfficeKitViewCallback(
int nType,
const char* pPayload)
const override;
1369 :
public osl::Guard<comphelper::SolarMutex>
1377 :
public osl::ClearableGuard<comphelper::SolarMutex>
1385 :
public osl::ResettableGuard<comphelper::SolarMutex>
An application can be notified of a number of different events:
std::vector< OUString > aData
ApplicationEvent(Type type, std::vector< OUString > &&data)
Constructor for ApplicationEvent, accepts an array of strings for the data associated with the event.
OUString const & GetStringData() const
Gets the application event's data string.
Type GetEvent() const
Get the type of event.
ApplicationEvent(Type type)
Explicit constructor for ApplicationEvent.
std::vector< OUString > const & GetStringsData() const
Gets the event's array of strings.
ApplicationEvent(Type type, OUString const &data)
Constructor for ApplicationEvent, accepts a string for the data associated with the event.
Base class used mainly for the LibreOffice Desktop class.
LibreOfficeKitCallback m_pCallback
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
Post a user event to the default window.
DECL_DLLPRIVATE_STATIC_LINK(Application, PostEventHandler, void *, void)
static void AcquireSolarMutex(sal_uInt32 nCount)
Acquire Solar Mutex(es) for this thread.
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
SolarMutexClearableGuard()
A helper class that calls Application::ReleaseSolarMutex() in its constructor and restores the mutex ...
const sal_uInt32 mnReleased
SolarMutexResettableGuard()
sal_uInt32 release(bool bUnlockAll=false)
virtual bool tryToAcquire()
guard class that uses tryToAcquire() and has isAcquired() to check
~SolarMutexTryAndBuyGuard()
SolarMutexTryAndBuyGuard & operator=(const SolarMutexTryAndBuyGuard &)=delete
SolarMutexTryAndBuyGuard()
SolarMutexTryAndBuyGuard(const SolarMutexTryAndBuyGuard &)=delete
comphelper::SolarMutex & m_rSolarMutex
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
std::unique_ptr< sal_Int32[]> pData
constexpr OUStringLiteral aData
css::uno::Reference< css::ui::dialogs::XFolderPicker2 > createFolderPicker(const css::uno::Reference< css::uno::XComponentContext > &rContext, weld::Window *pPreferredParent)
void EndAllDialogs(vcl::Window const *pParent)
VCL_DLLPUBLIC ImplSVHelpData * CreateSVHelpData()
VCL_DLLPUBLIC bool InitVCL()
VCL_DLLPUBLIC Application * GetpApp()
@ Silent
silently cancel any dialogs
@ Fatal
cancel any dialogs by std::abort
@ LOKSilent
silently cancel any dialogs (LOK case)
VCL_DLLPUBLIC void DestroySVHelpData(ImplSVHelpData *)
long(* VCLEventHookProc)(NotifyEvent &rEvt, void *pData)
VCL_DLLPUBLIC sal_UCS4 GetLocalizedChar(sal_UCS4, LanguageType)
VCL_DLLPUBLIC void SetSVHelpData(ImplSVHelpData *)
VCL_DLLPUBLIC void CreateMainLoopThread(oslWorkerFunction pWorker, void *pThreadData)
VCL_DLLPUBLIC void SetSVWinData(ImplSVWinData *)
VCL_DLLPUBLIC void DeInitVCL()
VCL_DLLPUBLIC void JoinMainLoopThread()
VCL_DLLPUBLIC bool InitAccessBridge()
VCL_DLLPUBLIC bool IsVCLInit()
VCL_DLLPUBLIC ImplSVWinData * CreateSVWinData()
VCL_DLLPUBLIC void DestroySVWinData(ImplSVWinData *)