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>
62 namespace vcl {
class KeyCode; }
71 class XComponentContext;
79 class XDisplayConnection;
139 assert(type == Type::Appear || type == Type::PrivateDoShutdown || type == Type::QuickStart);
152 type == Type::Accept || type == Type::OpenHelpUrl
153 || type == Type::ShowDialog || type == Type::Unaccept);
154 aData.push_back(data);
167 assert(type == Type::Open || type == Type::Print);
190 ||
aEvent == Type::OpenHelpUrl ||
aEvent == Type::ShowDialog
191 ||
aEvent == Type::Unaccept);
192 assert(
aData.size() == 1);
272 virtual void InitFinished();
281 virtual void DeInit();
351 virtual bool QueryExit();
386 static sal_uInt16 GetCommandLineParamCount();
396 static OUString GetCommandLineParam( sal_uInt16
nParam );
404 static OUString GetAppFileName();
434 static void Abort(
const OUString& rErrorText );
461 static bool IsQuit();
478 static bool Reschedule(
bool bHandleAllCurrentEvents =
false );
495 static void EndYield();
516 static bool IsMainThread();
528 static sal_uInt32 ReleaseSolarMutex();
538 static void AcquireSolarMutex( sal_uInt32
nCount );
547 static bool IsInMain();
555 static bool IsInExecute();
563 static bool IsInModalMode();
569 static sal_uInt16 GetDispatchLevel();
588 static sal_uInt64 GetLastInputInterval();
600 static bool IsUICaptured();
624 virtual void OverrideSystemSettings(
AllSettings& rSettings );
633 static void MergeSystemSettings(
AllSettings& rSettings );
643 static void SetSettings(
const AllSettings& rSettings );
714 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();
894 static void SetAppName(
const OUString& rUniqueName );
905 static OUString GetAppName();
912 static OUString GetOSVersion();
919 static OUString GetHWOSConfInfo(
const int bSelection = 0,
bool bLocalize =
true);
928 static bool LoadBrandBitmap (
const char*
pName,
BitmapEx &rBitmap);
942 static void SetDisplayName(
const OUString& rDisplayName );
948 static OUString GetDisplayName();
954 static OUString GetToolkitName();
962 static unsigned int GetScreenCount();
984 static bool IsUnifiedDisplay();
996 SAL_DLLPRIVATE
static unsigned int GetBestScreen(
const tools::Rectangle& );
1008 static unsigned int GetDisplayBuiltInScreen();
1017 static unsigned int GetDisplayExternalScreen();
1047 static void RemoveAccel(
Accelerator const * pAccel );
1055 static size_t GetReservedKeyCodeCount();
1082 static void SetHelp(
Help* pHelp =
nullptr );
1091 static Help* GetHelp();
1147 static bool IsDialogCancelEnabled();
1184 static css::uno::Reference< css::awt::XToolkit > GetVCLToolkit();
1210 static void EnableHeadlessMode(
bool dialogsAreFatal );
1216 static bool IsHeadlessModeEnabled();
1222 static void EnableConsoleOnly();
1226 static void EnableBitmapRendering();
1232 static bool IsBitmapRendering();
1242 static void EnableEventTestingMode();
1248 static bool IsEventTestingModeEnabled();
1251 static void EnableSafeMode();
1254 static bool IsSafeModeEnabled();
1262 static const OUString& GetDesktopEnvironment();
1281 static void AddToRecentDocumentList(
const OUString& rFileUrl,
const OUString& rMimeType,
const OUString& rDocumentService);
1289 static void ShowNativeErrorBox(
const OUString& sTitle ,
1293 static void UpdateMainThread();
1299 static bool hasNativeFileSelection();
1308 static css::uno::Reference< css::ui::dialogs::XFilePicker2 >
1309 createFilePicker(
const css::uno::Reference< css::uno::XComponentContext >& rServiceManager );
1318 static css::uno::Reference< css::ui::dialogs::XFolderPicker2 >
1319 createFolderPicker(
const css::uno::Reference< css::uno::XComponentContext >& rServiceManager );
1327 static void EndAllPopups();
1333 static bool IsOnSystemEventLoop();
1340 static std::unique_ptr<weld::Builder> CreateBuilder(
weld::Widget* pParent,
const OUString &rUIFile,
bool bMobile =
false, sal_uInt64 nLOKWindowId = 0);
1342 static std::unique_ptr<weld::Builder> CreateInterimBuilder(
vcl::Window* pParent,
const OUString &rUIFile,
bool bAllowCycleFocusOut, sal_uInt64 nLOKWindowId = 0);
1346 bool bMobile =
false);
1355 const OUString& rAction,
1356 const std::vector<vcl::LOKPayloadItem>& rPayload = std::vector<vcl::LOKPayloadItem>())
const override;
1357 virtual void libreOfficeKitViewCallback(
int nType,
const char* pPayload)
const override;
1364 :
public osl::Guard<comphelper::SolarMutex>
1372 :
public osl::ClearableGuard<comphelper::SolarMutex>
1380 :
public osl::ResettableGuard<comphelper::SolarMutex>
1407 : m_isAcquired(
false)
1409 , m_isChecked(
false)
1420 assert(m_isChecked);
std::vector< OUString > const & GetStringsData() const
Gets the event's array of strings.
Type GetEvent() const
Get the type of event.
ApplicationEvent(Type type, OUString const &data)
Constructor for ApplicationEvent, accepts a string for the data associated with the event...
VCL_DLLPUBLIC bool IsVCLInit()
static void AcquireSolarMutex(sal_uInt32 nCount)
Acquire Solar Mutex(es) for this thread.
SolarMutexResettableGuard()
~SolarMutexTryAndBuyGuard()
std::unique_ptr< sal_Int32[]> pData
silently cancel any dialogs (LOK case)
VCL_DLLPUBLIC bool InitAccessBridge()
SolarMutexTryAndBuyGuard()
VCL_DLLPUBLIC void SetSVHelpData(ImplSVHelpData *)
std::vector< OUString > aData
VCL_DLLPUBLIC void JoinMainLoopThread()
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
Post a user event to the default window.
An application can be notified of a number of different events:
VCL_DLLPUBLIC void DestroySVHelpData(ImplSVHelpData *)
ApplicationEvent(Type type)
Explicit constructor for ApplicationEvent.
A helper class that calls Application::ReleaseSolarMutex() in its constructor and restores the mutex ...
VCL_DLLPUBLIC void DestroySVWinData(ImplSVWinData *)
sal_uInt32 release(bool bUnlockAll=false)
constexpr OUStringLiteral aData
VCL_DLLPUBLIC bool InitVCL()
const sal_uInt32 mnReleased
SolarMutexTryAndBuyGuard & operator=(const SolarMutexTryAndBuyGuard &)=delete
VCL_DLLPUBLIC Application * GetpApp()
silently cancel any dialogs
void EndAllDialogs(vcl::Window const *pParent)
VCL_DLLPUBLIC ImplSVHelpData * CreateSVHelpData()
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
VCL_DLLPUBLIC void SetSVWinData(ImplSVWinData *)
VCL_DLLPUBLIC sal_UCS4 GetMirroredChar(sal_UCS4)
ApplicationEvent(Type type, std::vector< OUString > &&data)
Constructor for ApplicationEvent, accepts an array of strings for the data associated with the event...
Base class used mainly for the LibreOffice Desktop class.
SolarMutexClearableGuard()
VCL_DLLPUBLIC ImplSVWinData * CreateSVWinData()
exports com.sun.star.chart2. data
VCL_DLLPUBLIC void CreateMainLoopThread(oslWorkerFunction pWorker, void *pThreadData)
LibreOfficeKitCallback m_pCallback
css::uno::Reference< css::ui::dialogs::XFolderPicker2 > createFolderPicker(const css::uno::Reference< css::uno::XComponentContext > &rContext, weld::Window *pPreferredParent)
VCL_DLLPUBLIC sal_UCS4 GetLocalizedChar(sal_UCS4, LanguageType)
long(* VCLEventHookProc)(NotifyEvent &rEvt, void *pData)
cancel any dialogs by std::abort
#define DECL_DLLPRIVATE_STATIC_LINK(Class, Member, ArgType, RetType)
virtual bool tryToAcquire()
VCL_DLLPUBLIC void DeInitVCL()
guard class that uses tryToAcquire() and has isAcquired() to check
OUString const & GetStringData() const
Gets the application event's data string.
comphelper::SolarMutex & m_rSolarMutex
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
bool m_bDetectedRangeSegmentation false