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);
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 );
473 static bool Reschedule(
bool bHandleAllCurrentEvents =
false );
490 static void EndYield();
511 static bool IsMainThread();
523 static sal_uInt32 ReleaseSolarMutex();
533 static void AcquireSolarMutex( sal_uInt32
nCount );
542 static bool IsInMain();
550 static bool IsInExecute();
558 static bool IsInModalMode();
564 static sal_uInt16 GetDispatchLevel();
583 static sal_uInt64 GetLastInputInterval();
595 static bool IsUICaptured();
619 virtual void OverrideSystemSettings(
AllSettings& rSettings );
628 static void MergeSystemSettings(
AllSettings& rSettings );
638 static void SetSettings(
const AllSettings& rSettings );
709 static void ImplCallEventListenersApplicationDataChanged(
void*
pData );
756 static void RemoveMouseAndKeyEvents(
vcl::Window *pWin );
773 bool bReferenceLink =
false );
779 static void RemoveUserEvent(
ImplSVEvent * nUserEvent );
789 static css::uno::Reference< css::awt::XDisplayConnection > GetDisplayConnection();
886 static void SetAppName(
const OUString& rUniqueName );
897 static OUString GetAppName();
904 static OUString GetHWOSConfInfo(
const int bSelection = 0,
bool bLocalize =
true);
913 static bool LoadBrandBitmap (
const char*
pName,
BitmapEx &rBitmap);
927 static void SetDisplayName(
const OUString& rDisplayName );
933 static OUString GetDisplayName();
939 static OUString GetToolkitName();
947 static unsigned int GetScreenCount();
969 static bool IsUnifiedDisplay();
981 SAL_DLLPRIVATE
static unsigned int GetBestScreen(
const tools::Rectangle& );
993 static unsigned int GetDisplayBuiltInScreen();
1002 static unsigned int GetDisplayExternalScreen();
1024 static bool InsertAccel( Accelerator* pAccel );
1032 static void RemoveAccel( Accelerator
const * pAccel );
1040 static size_t GetReservedKeyCodeCount();
1067 static void SetHelp(
Help* pHelp =
nullptr );
1076 static Help* GetHelp();
1128 static bool IsDialogCancelEnabled();
1165 static css::uno::Reference< css::awt::XToolkit > GetVCLToolkit();
1191 static void EnableHeadlessMode(
bool dialogsAreFatal );
1197 static bool IsHeadlessModeEnabled();
1203 static void EnableConsoleOnly();
1207 static void EnableBitmapRendering();
1213 static bool IsBitmapRendering();
1223 static void EnableEventTestingMode();
1229 static bool IsEventTestingModeEnabled();
1232 static void EnableSafeMode();
1235 static bool IsSafeModeEnabled();
1243 static const OUString& GetDesktopEnvironment();
1262 static void AddToRecentDocumentList(
const OUString& rFileUrl,
const OUString& rMimeType,
const OUString& rDocumentService);
1270 static void ShowNativeErrorBox(
const OUString& sTitle ,
1274 static void UpdateMainThread();
1280 static bool hasNativeFileSelection();
1289 static css::uno::Reference< css::ui::dialogs::XFilePicker2 >
1290 createFilePicker(
const css::uno::Reference< css::uno::XComponentContext >& rServiceManager );
1299 static css::uno::Reference< css::ui::dialogs::XFolderPicker2 >
1300 createFolderPicker(
const css::uno::Reference< css::uno::XComponentContext >& rServiceManager );
1308 static void EndAllPopups();
1317 static weld::Builder* CreateInterimBuilder(
vcl::Window* pParent,
const OUString &rUIFile,
bool bAllowCycleFocusOut, sal_uInt64 nLOKWindowId = 0);
1321 bool bMobile =
false);
1330 const OUString& rAction,
1331 const std::vector<vcl::LOKPayloadItem>& rPayload = std::vector<vcl::LOKPayloadItem>())
const override;
1332 virtual void libreOfficeKitViewCallback(
int nType,
const char* pPayload)
const override;
1339 :
public osl::Guard<comphelper::SolarMutex>
1347 :
public osl::ClearableGuard<comphelper::SolarMutex>
1355 :
public osl::ResettableGuard<comphelper::SolarMutex>
1382 : m_isAcquired(false)
1384 , m_isChecked(false)
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< ContentProperties > pData
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.
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
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
ApplicationEvent(Type type, std::vector< OUString > const &data)
Constructor for ApplicationEvent, accepts an array of strings for the data associated with the event...
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)
Base class used mainly for the LibreOffice Desktop class.
SolarMutexClearableGuard()
VCL_DLLPUBLIC ImplSVWinData * CreateSVWinData()
VCL_DLLPUBLIC void CreateMainLoopThread(oslWorkerFunction pWorker, void *pThreadData)
LibreOfficeKitCallback m_pCallback
VCL_DLLPUBLIC sal_UCS4 GetLocalizedChar(sal_UCS4, LanguageType)
long(* VCLEventHookProc)(NotifyEvent &rEvt, void *pData)
cancel any dialogs by std::abort
virtual bool tryToAcquire()
VCL_DLLPUBLIC void DeInitVCL()
guard class that uses tryToAcquire() and has isAcquired() to check
#define DECL_STATIC_LINK(Class, Member, ArgType, RetType)
OUString const & GetStringData() const
Gets the application event's data string.
comphelper::SolarMutex & m_rSolarMutex
weld::Window * GetFrameWeld(const SfxFrame *pFrame)