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>
63 class ILibreOfficeKitNotifier;
73namespace basegfx {
class SystemDependentDataManager; }
76 class XComponentContext;
84 class XDisplayConnection;
142 assert(
type == Type::Appear ||
type == Type::PrivateDoShutdown ||
type == Type::QuickStart);
155 type == Type::Accept ||
type == Type::OpenHelpUrl
156 ||
type == Type::ShowDialog ||
type == Type::Unaccept);
157 aData.push_back(data);
170 assert(
type == Type::Open ||
type == Type::Print);
193 ||
aEvent == Type::OpenHelpUrl ||
aEvent == Type::ShowDialog
194 ||
aEvent == Type::Unaccept);
195 assert(
aData.size() == 1);
275 virtual void InitFinished();
284 virtual void DeInit();
354 virtual bool QueryExit();
389 static sal_uInt16 GetCommandLineParamCount();
399 static OUString GetCommandLineParam( sal_uInt16 nParam );
407 static OUString GetAppFileName();
437 static void Abort(
const OUString& rErrorText );
464 static bool IsQuit();
481 static bool Reschedule(
bool bHandleAllCurrentEvents =
false );
498 static void EndYield();
519 static bool IsMainThread();
531 static sal_uInt32 ReleaseSolarMutex();
541 static void AcquireSolarMutex( sal_uInt32
nCount );
550 static bool IsInMain();
558 static bool IsInExecute();
566 static bool IsInModalMode();
572 static sal_uInt16 GetDispatchLevel();
591 static sal_uInt64 GetLastInputInterval();
603 static bool IsUICaptured();
627 virtual void OverrideSystemSettings(
AllSettings& rSettings );
636 static void MergeSystemSettings(
AllSettings& rSettings );
646 static void SetSettings(
const AllSettings& rSettings );
717 static void ImplCallEventListenersApplicationDataChanged(
void*
pData );
768 static void RemoveMouseAndKeyEvents(
vcl::Window *pWin );
785 bool bReferenceLink =
false );
791 static void RemoveUserEvent(
ImplSVEvent * nUserEvent );
801 static css::uno::Reference< css::awt::XDisplayConnection > GetDisplayConnection();
904 static void SetAppName(
const OUString& rUniqueName );
915 static OUString GetAppName();
922 static OUString GetOSVersion();
929 static OUString GetHWOSConfInfo(
const int bSelection = 0,
bool bLocalize =
true);
938 static bool LoadBrandBitmap (std::u16string_view
pName,
BitmapEx &rBitmap);
952 static void SetDisplayName(
const OUString& rDisplayName );
958 static OUString GetDisplayName();
964 static OUString GetToolkitName();
972 static unsigned int GetScreenCount();
988 SAL_DLLPRIVATE
static unsigned int GetBestScreen(
const tools::Rectangle& );
1000 static unsigned int GetDisplayBuiltInScreen();
1009 static unsigned int GetDisplayExternalScreen();
1039 static void RemoveAccel(
Accelerator const * pAccel );
1047 static size_t GetReservedKeyCodeCount();
1074 static void SetHelp(
Help* pHelp =
nullptr );
1083 static Help* GetHelp();
1139 static bool IsDialogCancelEnabled();
1176 static css::uno::Reference< css::awt::XToolkit > GetVCLToolkit();
1202 static void EnableHeadlessMode(
bool dialogsAreFatal );
1208 static bool IsHeadlessModeEnabled();
1214 static void EnableConsoleOnly();
1218 static void EnableBitmapRendering();
1224 static bool IsBitmapRendering();
1229 static void EnableSafeMode();
1232 static bool IsSafeModeEnabled();
1240 static const OUString& GetDesktopEnvironment();
1259 static void AddToRecentDocumentList(
const OUString& rFileUrl,
const OUString& rMimeType,
const OUString& rDocumentService);
1267 static void ShowNativeErrorBox(
const OUString& sTitle ,
1271 static void UpdateMainThread();
1277 static bool hasNativeFileSelection();
1286 static css::uno::Reference< css::ui::dialogs::XFilePicker2 >
1287 createFilePicker(
const css::uno::Reference< css::uno::XComponentContext >& rServiceManager );
1296 static css::uno::Reference< css::ui::dialogs::XFolderPicker2 >
1297 createFolderPicker(
const css::uno::Reference< css::uno::XComponentContext >& rServiceManager );
1303 static bool IsOnSystemEventLoop();
1310 static std::unique_ptr<weld::Builder> CreateBuilder(
weld::Widget* pParent,
const OUString &rUIFile,
bool bMobile =
false, sal_uInt64 nLOKWindowId = 0);
1312 static std::unique_ptr<weld::Builder> CreateInterimBuilder(
vcl::Window* pParent,
const OUString &rUIFile,
bool bAllowCycleFocusOut, sal_uInt64 nLOKWindowId = 0);
1316 const ILibreOfficeKitNotifier* pNotifier =
nullptr);
1325 const OUString& rAction,
1326 const std::vector<vcl::LOKPayloadItem>& rPayload = std::vector<vcl::LOKPayloadItem>())
const override;
1327 virtual void libreOfficeKitViewCallback(
int nType,
const OString& pPayload)
const override;
1336 :
public osl::Guard<comphelper::SolarMutex>
1344 :
public osl::ClearableGuard<comphelper::SolarMutex>
1352 :
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)
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 *)