LibreOffice Module vcl (master) 1
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | List of all members
Application Class Reference

Base class used mainly for the LibreOffice Desktop class. More...

#include <svapp.hxx>

Inheritance diagram for Application:
[legend]
Collaboration diagram for Application:
[legend]

Public Member Functions

virtual int Main ()
 Pure virtual entrypoint to the application. More...
 
virtual bool QueryExit ()
 Exit from the application. More...
 
virtual void Shutdown ()
 
virtual void notifyWindow (vcl::LOKWindowId nLOKWindowId, const OUString &rAction, const std::vector< vcl::LOKPayloadItem > &rPayload=std::vector< vcl::LOKPayloadItem >()) const override
 Callbacks. More...
 
virtual void libreOfficeKitViewCallback (int nType, const OString &pPayload) const override
 
virtual void notifyInvalidation (tools::Rectangle const *) const override
 Emits a LOK_CALLBACK_INVALIDATE_TILES. More...
 
Initialization

The following functions perform initialization and deinitialization of the application.

 Application ()
 Default constructor for Application class. More...
 
virtual ~Application ()
 Virtual destructor for Application class. More...
 
virtual void Init ()
 Initialize the application itself. More...
 
virtual void InitFinished ()
 Finish initialization of the application. More...
 
virtual void DeInit ()
 Deinitialized the application itself. More...
 
- Public Member Functions inherited from vcl::ILibreOfficeKitNotifier
virtual ~ILibreOfficeKitNotifier ()
 
virtual void notifyWindow (vcl::LOKWindowId nLOKWindowId, const OUString &rAction, const std::vector< LOKPayloadItem > &rPayload=std::vector< LOKPayloadItem >()) const =0
 Callbacks. More...
 
virtual void libreOfficeKitViewCallback (int nType, const OString &pPayload) const =0
 
virtual void notifyInvalidation (tools::Rectangle const *) const =0
 Emits a LOK_CALLBACK_INVALIDATE_TILES. More...
 

Static Public Member Functions

static bool IsUICaptured ()
 
static void SetAppName (const OUString &rUniqueName)
 Set the application's name. More...
 
static void EnableSafeMode ()
 Set safe mode to enabled. More...
 
static bool IsSafeModeEnabled ()
 Determines if safe mode is enabled. More...
 
static const OUString & GetDesktopEnvironment ()
 Get the desktop environment the process is currently running in. More...
 
static void setDeInitHook (Link< LinkParamNone *, void > const &hook)
 
static std::unique_ptr< weld::BuilderCreateBuilder (weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false, sal_uInt64 nLOKWindowId=0)
 
static std::unique_ptr< weld::BuilderCreateInterimBuilder (vcl::Window *pParent, const OUString &rUIFile, bool bAllowCycleFocusOut, sal_uInt64 nLOKWindowId=0)
 
static weld::MessageDialogCreateMessageDialog (weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
 
static weld::WindowGetFrameWeld (const css::uno::Reference< css::awt::XWindow > &rWindow)
 
Change Notification Functions

Functions that notify when changes occur in the application.

static void NotifyAllWindows (DataChangedEvent &rDCEvt)
 Notify all windows that the application has changed data. More...
 
Command Line Processing

Command line processing is done via the following functions.

They give the number of parameters, the parameters themselves and a way to get the name of the invoking application.

static sal_uInt16 GetCommandLineParamCount ()
 Gets the number of command line parameters passed to the application. More...
 
static OUString GetCommandLineParam (sal_uInt16 nParam)
 Gets a particular command line parameter. More...
 
static OUString GetAppFileName ()
 Get the name of the file used to start the application. More...
 
Event Loop Functions

Functions that handle the LibreOffice main event loop are here, including a global lock called the Solar Mutex.

static void Execute ()
 Run the main event processing loop until it is quit by Quit(). More...
 
static void Quit ()
 Quit the program. More...
 
static bool IsQuit ()
 Has Quit() been called? More...
 
static bool Reschedule (bool bHandleAllCurrentEvents=false)
 Attempt to process current pending event(s) More...
 
static void Yield ()
 Process the next event. More...
 
static void EndYield ()
 
static comphelper::SolarMutexGetSolarMutex ()
 Get the Solar Mutex for this thread. More...
 
static bool IsMainThread ()
 Queries whether we are in main thread. More...
 
static sal_uInt32 ReleaseSolarMutex ()
 Release Solar Mutex(es) for this thread. More...
 
static void AcquireSolarMutex (sal_uInt32 nCount)
 Acquire Solar Mutex(es) for this thread. More...
 
static bool IsInMain ()
 Queries whether the application is in "main", i.e. More...
 
static bool IsInExecute ()
 Queries whether the application is in the event loop. More...
 
static bool IsInModalMode ()
 Queries whether application has a modal dialog active. More...
 
static sal_uInt16 GetDispatchLevel ()
 Return how many events are being dispatched. More...
 
static bool AnyInput (VclInputFlags nType=VCL_INPUT_ANY)
 Determine if there are any pending input events. More...
 
static sal_uInt64 GetLastInputInterval ()
 The interval from the last time that input was received. More...
 
Application Window Functions

Functions that deal with the application's windows

static vcl::WindowGetFocusWindow ()
 Get the currently focused window. More...
 
static OutputDeviceGetDefaultDevice ()
 Get the default "device" (in this case the default window). More...
 
static basegfx::SystemDependentDataManagerGetSystemDependentDataManager ()
 access the DataManager for buffering system-dependent data More...
 
static vcl::WindowGetFirstTopLevelWindow ()
 Get the first top-level window of the application. More...
 
static vcl::WindowGetNextTopLevelWindow (vcl::Window const *pWindow)
 Get the next top level window. More...
 
static tools::Long GetTopWindowCount ()
 Return the number of top-level windows being used by the application. More...
 
static vcl::WindowGetTopWindow (tools::Long nIndex)
 Get the nth top window. More...
 
static vcl::WindowGetActiveTopWindow ()
 Get the "active" top window. More...
 
Application Name, Branding
static OUString GetAppName ()
 Get the application's name. More...
 
static OUString GetOSVersion ()
 Get the OS version based on the OS specific implementation. More...
 
static OUString GetHWOSConfInfo (const int bSelection=0, bool bLocalize=true)
 Get useful OS, Hardware and configuration information, cf. More...
 
static bool LoadBrandBitmap (std::u16string_view pName, BitmapEx &rBitmap)
 Load a localized branding PNG file as a bitmap. More...
 
Display and Screen
static void SetDisplayName (const OUString &rDisplayName)
 Set the default name of the application for message dialogs and printing. More...
 
static OUString GetDisplayName ()
 Get the default name of the application for message dialogs and printing. More...
 
static OUString GetToolkitName ()
 Get the toolkit's name. More...
 
static unsigned int GetScreenCount ()
 Get the number of screens available for the display. More...
 
static tools::Rectangle GetScreenPosSizePixel (unsigned int nScreen)
 Get a screen's rectangular area. More...
 
static SAL_DLLPRIVATE unsigned int GetBestScreen (const tools::Rectangle &)
 Get the "best" screen. More...
 
static unsigned int GetDisplayBuiltInScreen ()
 Get the built-in screen. More...
 
static unsigned int GetDisplayExternalScreen ()
 Get the display's external screen. More...
 
Accelerators and Mnemonics

Accelerators allow a user to hold down Ctrl+key (or CMD+key on macOS) combination to gain quick access to functionality.

Mnemonics are underline letters in things like menus and dialog boxes that allow a user to type in the letter to activate the menu or option.

static bool InsertAccel (Accelerator *pAccel)
 Insert accelerator. More...
 
static void RemoveAccel (Accelerator const *pAccel)
 Remove accelerator. More...
 
static size_t GetReservedKeyCodeCount ()
 Get the number of reserved key codes used by the application. More...
 
static const vcl::KeyCodeGetReservedKeyCode (size_t i)
 Get the reserved key code. More...
 
Application Help

Deals with the help system, and "auto-help", where a user hovers a mouse above a UI element and a tooltip with an explanation pops up.

static void SetHelp (Help *pHelp=nullptr)
 Sets up help. More...
 
static HelpGetHelp ()
 Gets the application's help. More...
 
Dialogs
Remarks
"Dialog cancel mode" tells a headless install whether to cancel dialogs when they appear. See the DialogCancelMode enumerator.
static weld::WindowGetDefDialogParent ()
 Get the default parent window for dialog boxes. More...
 
static DialogCancelMode GetDialogCancelMode ()
 Gets the dialog cancel mode for headless environments. More...
 
static void SetDialogCancelMode (DialogCancelMode mode)
 Sets the dialog cancel mode for headless environments. More...
 
static bool IsDialogCancelEnabled ()
 Determines if dialog cancel mode is enabled. More...
 
static void SetSystemWindowMode (SystemWindowFlags nMode)
 Make a dialog box a system window or not. More...
 
static SystemWindowFlags GetSystemWindowMode ()
 Get the system window mode of dialogs. More...
 
VCL Toolkit and UNO Wrapper

The VCL Toolkit implements the UNO XToolkit interface, which specifies a factory interface for the window toolkit.

It is similar to the abstract window toolkit (AWT) in Java.

static css::uno::Reference< css::awt::XToolkit > GetVCLToolkit ()
 Gets the VCL toolkit. More...
 
static void SetFilterHdl (const Link< ConvertData &, bool > &rLink)
 Setup a new graphics filter. More...
 
Headless Mode
static void EnableHeadlessMode (bool dialogsAreFatal)
 Enables headless mode. More...
 
static bool IsHeadlessModeEnabled ()
 Determines if headless mode is enabled. More...
 
static void EnableConsoleOnly ()
 Enable Console Only mode. More...
 
static void EnableBitmapRendering ()
 Enable software-only bitmap rendering. More...
 
static bool IsBitmapRendering ()
 Determines if bitmap rendering is enabled. More...
 
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. More...
 
static void ShowNativeErrorBox (const OUString &sTitle, const OUString &sMessage)
 
static void UpdateMainThread ()
 Update main thread identifier. More...
 
static bool hasNativeFileSelection ()
 Do we have a native / system file selector available? More...
 
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. More...
 
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. More...
 
static bool IsOnSystemEventLoop ()
 Returns true, if the VCL plugin runs on the system event loop. More...
 

Public Attributes

void * m_pCallbackData
 
LibreOfficeKitCallback m_pCallback
 

Private Member Functions

 DECL_DLLPRIVATE_STATIC_LINK (Application, PostEventHandler, void *, void)
 

Error Handling

Very rudimentary error handling is done by these functions.

virtual void Exception (ExceptionCategory nCategory)
 Handles an error. More...
 
static void Abort (const OUString &rErrorText)
 Ends the program prematurely with an error message. More...
 

Settings

The following functions set system settings (e.g.

tab color, etc.). There are functions that set settings objects, and functions that set and get the actual system settings for the application.

virtual void OverrideSystemSettings (AllSettings &rSettings)
 Sets user settings in settings object to override system settings. More...
 
static void MergeSystemSettings (AllSettings &rSettings)
 Set the settings object to the platform/desktop environment system settings. More...
 
static void SetSettings (const AllSettings &rSettings)
 Sets the application's settings and notifies all windows of the change. More...
 
static const AllSettingsGetSettings ()
 Gets the application's settings. More...
 
static const LocaleDataWrapperGetAppLocaleDataWrapper ()
 Get the application's locale data wrapper. More...
 

Event Listeners/Handlers

A set of event listeners and callers.

Note that in this code there is platform specific functions - namely for zoom and scroll events.

virtual void AppEvent (const ApplicationEvent &rAppEvent)
 
static void AddEventListener (const Link< VclSimpleEvent &, void > &rEventListener)
 Add a VCL event listener to the application. More...
 
static void RemoveEventListener (const Link< VclSimpleEvent &, void > &rEventListener)
 Remove a VCL event listener from the application. More...
 
static void AddKeyListener (const Link< VclWindowEvent &, bool > &rKeyListener)
 Add a keypress listener to the application. More...
 
static void RemoveKeyListener (const Link< VclWindowEvent &, bool > &rKeyListener)
 Remove a keypress listener from the application. More...
 
static void ImplCallEventListenersApplicationDataChanged (void *pData)
 Send event to all VCL application event listeners. More...
 
static void ImplCallEventListeners (VclSimpleEvent &rEvent)
 Send event to all VCL application event listeners. More...
 
static bool HandleKey (VclEventId nEvent, vcl::Window *pWin, KeyEvent *pKeyEvent)
 Handle keypress event. More...
 
static ImplSVEventPostKeyEvent (VclEventId nEvent, vcl::Window *pWin, KeyEvent const *pKeyEvent)
 Send keypress event. More...
 
static bool LOKHandleMouseEvent (VclEventId nEvent, vcl::Window *pWin, const MouseEvent *pEvent)
 
static ImplSVEventPostMouseEvent (VclEventId nEvent, vcl::Window *pWin, MouseEvent const *pMouseEvent)
 Send mouse event. More...
 
static ImplSVEventPostGestureEvent (VclEventId nEvent, vcl::Window *pWin, GestureEventPan const *pGestureEvent)
 
static void RemoveMouseAndKeyEvents (vcl::Window *pWin)
 Remove mouse and keypress events from a window... any also zoom and scroll events if the platform supports it. More...
 
static ImplSVEventPostUserEvent (const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
 Post a user event to the default window. More...
 
static void RemoveUserEvent (ImplSVEvent *nUserEvent)
 Remove user event based on event ID. More...
 
static css::uno::Reference< css::awt::XDisplayConnection > GetDisplayConnection ()
 

Detailed Description

Base class used mainly for the LibreOffice Desktop class.

The Application class is a base class mainly used by the Desktop class. It is really meant to be subclassed, and the Main() function should be overridden. Many of the ImplSVData members should be moved to this class.

The reason Application exists is because the VCL used to be a standalone framework, long since abandoned by anything other than our application.

See also
Desktop, ImplSVData

Definition at line 236 of file svapp.hxx.

Constructor & Destructor Documentation

◆ Application()

Application::Application ( )

Default constructor for Application class.

Initializes the LibreOffice global instance data structure if needed, and then sets itself to be the Application class. Also initializes any platform specific data structures.

Attention: \n The initialization of the application itself is done in Init()

Definition at line 162 of file svapp.cxx.

References ImplGetSVData(), m_pCallback, m_pCallbackData, and ImplSVData::mpApp.

◆ ~Application()

Application::~Application ( )
virtual

Virtual destructor for Application class.

Deinitializes the LibreOffice global instance data structure, then deinitializes any platform specific data structures.

Definition at line 173 of file svapp.cxx.

References ImplDeInitSVData(), ImplGetSVData(), and ImplSVData::mpApp.

Member Function Documentation

◆ Abort()

void Application::Abort ( const OUString &  rErrorText)
static

Ends the program prematurely with an error message.

If the

--norestore

command line argument is given (assuming this process is run by developers who are interested in cores, vs. end users who are not) then it does a coredump.

Parameters
rErrorTextThe error message to report.
See also
Exception

Definition at line 259 of file svapp.cxx.

References GetCommandLineParam(), GetCommandLineParamCount(), i, n, and SalAbort().

Referenced by vcl::Window::dispose(), Exception(), and OutputDevice::ImplInitFontList().

◆ AcquireSolarMutex()

void Application::AcquireSolarMutex ( sal_uInt32  nCount)
static

Acquire Solar Mutex(es) for this thread.

Acquire the Solar Mutex(es) that prevents other threads from accessing VCL concurrently.

See also
Execute, Quit, Reschedule, Yield, EndYield, GetSolarMutex, IsMainThread, ReleaseSolarMutex,

Definition at line 468 of file svapp.cxx.

References SalInstance::AcquireYieldMutex(), ImplGetSVData(), ImplSVData::mpDefInst, and nCount.

Referenced by SolarMutexReleaser::~SolarMutexReleaser().

◆ AddEventListener()

void Application::AddEventListener ( const Link< VclSimpleEvent &, void > &  rEventListener)
static

Add a VCL event listener to the application.

If no event listener exists, then initialize the application's event listener with a new one, then add the event listener.

Parameters
rEventListenerConst reference to the event listener to add.
See also
RemoveEventListener, AddKeyListener, RemoveKeyListener

Definition at line 698 of file svapp.cxx.

References VclEventListeners::addListener(), ImplGetSVData(), ImplSVData::maAppData, and ImplSVAppData::maEventListeners.

Referenced by MenuBarUpdateIconManager::MenuBarUpdateIconManager().

◆ AddKeyListener()

void Application::AddKeyListener ( const Link< VclWindowEvent &, bool > &  rKeyListener)
static

Add a keypress listener to the application.

If keypress listener exists, then initialize the application's keypress event listener with a new one, then add the keypress listener.

Parameters
rKeyListenerConst reference to the keypress event listener to add
See also
AddEventListener, RemoveEventListener, RemoveKeyListener

Definition at line 710 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::maAppData, and ImplSVAppData::maKeyListeners.

Referenced by SalInstanceWidget::ensure_key_listener().

◆ AddToRecentDocumentList()

void Application::AddToRecentDocumentList ( const OUString &  rFileUrl,
const OUString &  rMimeType,
const OUString &  rDocumentService 
)
static

Add a file to the system shells recent document list if there is any.

This function may have no effect under Unix because there is no standard API among the different desktop managers.

Parameters
rFileUrlThe file url of the document.
rMimeTypeThe mime content type of the document specified by aFileUrl. If an empty string will be provided "application/octet-stream" will be used.
rDocumentServiceThe app (or "document service") you will be adding the file to e.g. com.sun.star.text.TextDocument

Definition at line 1594 of file svapp.cxx.

References SalInstance::AddToRecentDocumentList(), ImplGetSVData(), and ImplSVData::mpDefInst.

◆ AnyInput()

bool Application::AnyInput ( VclInputFlags  nType = VCL_INPUT_ANY)
static

Determine if there are any pending input events.

Parameters
nTypeinput identifier, defined in include/vcl/inputtypes.hxx The default is VCL_INPUT_ANY.
Returns
true if there are pending events, false if not.
See also
GetLastInputInterval

Definition at line 500 of file svapp.cxx.

References SalInstance::AnyInput(), ImplGetSVData(), ImplSVData::mpDefInst, and nType.

Referenced by Scheduler::CallbackTaskScheduling(), TextView::KeyInput(), and TaskStopwatch::nextIter().

◆ AppEvent()

void Application::AppEvent ( const ApplicationEvent rAppEvent)
virtual
Deprecated:
AppEvent is used only in the Desktop class now. However, it is intended to notify the application that an event has occurred. It was in oldsv.cxx, but is still needed by a number of functions.
Parameters
rAppEventconst reference to ApplicationEvent event

Definition at line 1622 of file svapp.cxx.

◆ CreateBuilder()

std::unique_ptr< weld::Builder > Application::CreateBuilder ( weld::Widget pParent,
const OUString &  rUIFile,
bool  bMobile = false,
sal_uInt64  nLOKWindowId = 0 
)
static

◆ createFilePicker()

Reference< ui::dialogs::XFilePicker2 > Application::createFilePicker ( const css::uno::Reference< css::uno::XComponentContext > &  rServiceManager)
static

Create a platform specific file picker, if one is available, otherwise return an empty reference.

Parameters
rServiceManagerConst reference to a UNO component context (service manager).
Returns
File picker if available, otherwise an empty reference.

Definition at line 1633 of file svapp.cxx.

References SalInstance::createFilePicker(), ImplGetSVData(), and ImplSVData::mpDefInst.

◆ createFolderPicker()

Reference< ui::dialogs::XFolderPicker2 > Application::createFolderPicker ( const css::uno::Reference< css::uno::XComponentContext > &  rServiceManager)
static

Create a platform specific folder picker, if one is available, otherwise return an empty reference.

Parameters
rServiceManagerConst reference to a UNO component context (service manager).
Returns
Folder picker if available, otherwise an empty reference.

Definition at line 1640 of file svapp.cxx.

References SalInstance::createFolderPicker(), ImplGetSVData(), and ImplSVData::mpDefInst.

◆ CreateInterimBuilder()

std::unique_ptr< weld::Builder > Application::CreateInterimBuilder ( vcl::Window pParent,
const OUString &  rUIFile,
bool  bAllowCycleFocusOut,
sal_uInt64  nLOKWindowId = 0 
)
static

◆ CreateMessageDialog()

weld::MessageDialog * Application::CreateMessageDialog ( weld::Widget pParent,
VclMessageType  eMessageType,
VclButtonsType  eButtonType,
const OUString &  rPrimaryMessage,
const ILibreOfficeKitNotifier *  pNotifier = nullptr 
)
static

◆ DECL_DLLPRIVATE_STATIC_LINK()

Application::DECL_DLLPRIVATE_STATIC_LINK ( Application  ,
PostEventHandler  ,
void *  ,
void   
)
private

◆ DeInit()

void Application::DeInit ( )
virtual

Deinitialized the application itself.

Attention: \n Note that the global data structures and platform specific
deinitialization is done in the destructor.
See also
Init, InitFinished

Definition at line 208 of file svapp.cxx.

Referenced by DeInitVCL().

◆ EnableBitmapRendering()

void Application::EnableBitmapRendering ( )
static

Enable software-only bitmap rendering.

Definition at line 1544 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::maAppData, and ImplSVAppData::mbRenderToBitmaps.

Referenced by CreateSalInstance(), and EnableConsoleOnly().

◆ EnableConsoleOnly()

void Application::EnableConsoleOnly ( )
static

Enable Console Only mode.

Convenience function to enable headless and bitmap rendering.

Definition at line 1554 of file svapp.cxx.

References EnableBitmapRendering(), and EnableHeadlessMode().

◆ EnableHeadlessMode()

void Application::EnableHeadlessMode ( bool  dialogsAreFatal)
static

Enables headless mode.

Parameters
dialogsAreFatalSet to true if a dialog ends the session, false if not.

Definition at line 1530 of file svapp.cxx.

References Fatal, GetDialogCancelMode(), Off, SetDialogCancelMode(), and Silent.

Referenced by EnableConsoleOnly().

◆ EnableSafeMode()

void Application::EnableSafeMode ( )
static

Set safe mode to enabled.

Definition at line 1567 of file svapp.cxx.

References bSafeMode.

◆ EndYield()

void Application::EndYield ( )
inlinestatic

◆ Exception()

void Application::Exception ( ExceptionCategory  nCategory)
virtual

Handles an error.

Parameters
nCategoryThe error category, see include/vcl/exceptiontypes.hxx
See also
Abort

Definition at line 245 of file svapp.cxx.

References Abort(), System, and UserInterface.

Referenced by VCLExceptionSignal_impl().

◆ Execute()

void Application::Execute ( )
static

◆ GetActiveTopWindow()

vcl::Window * Application::GetActiveTopWindow ( )
static

Get the "active" top window.

An "active" top window is one that has a child window that has the application's focus.

Returns
the active top window
See also
GetFirstTopLevelWindow, GetNextTopLevelWindow, GetTopWindowCount, GetTopWindow

Definition at line 1105 of file svapp.cxx.

References ImplGetSVData(), vcl::Window::IsTopWindow(), ImplSVWinData::mpFocusWin, ImplSVData::mpWinData, and vcl::Window::mpWindowImpl.

Referenced by DebugEventInjector::ChooseWindow(), IMPL_LINK_NOARG(), and GDIMetaFile::ImplPlayWithRenderer().

◆ GetAppFileName()

OUString Application::GetAppFileName ( )
static

Get the name of the file used to start the application.

Returns
The filename as an OUString
See also
GetCommandLineParamCount, GetCommandLineParam

Definition at line 224 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::maAppData, ImplSVAppData::mxAppFileName, and SAL_WARN_IF.

◆ GetAppLocaleDataWrapper()

const LocaleDataWrapper & Application::GetAppLocaleDataWrapper ( )
static

Get the application's locale data wrapper.

Returns
reference to a LocaleDataWrapper object

Definition at line 1525 of file svapp.cxx.

References AllSettings::GetLocaleDataWrapper(), and GetSettings().

Referenced by Calendar::ImplInit().

◆ GetAppName()

OUString Application::GetAppName ( )
static

Get the application's name.

Returns
The application name.

Definition at line 1123 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::maAppData, and ImplSVAppData::mxAppName.

◆ GetBestScreen()

unsigned int Application::GetBestScreen ( const tools::Rectangle i_rRect)
static

◆ GetCommandLineParam()

OUString Application::GetCommandLineParam ( sal_uInt16  nParam)
static

Gets a particular command line parameter.

Parameters
nParamThe index of the parameter to return.
Returns
The command line parameter as an OUString
See also
GetCommandLineParamCount, GetAppFileName

Definition at line 217 of file svapp.cxx.

Referenced by Abort().

◆ GetCommandLineParamCount()

sal_uInt16 Application::GetCommandLineParamCount ( )
static

Gets the number of command line parameters passed to the application.

Returns
sal_uInt16 - the number of parameters
See also
GetCommandLineParam, GetAppFileName

Definition at line 212 of file svapp.cxx.

Referenced by Abort().

◆ GetDefaultDevice()

OutputDevice * Application::GetDefaultDevice ( )
static

◆ GetDefDialogParent()

weld::Window * Application::GetDefDialogParent ( )
static

Get the default parent window for dialog boxes.

Remarks
This is almost always a terrible method to use to get a parent for a dialog, try hard to instead pass a specific parent window to dialogs.

GetDefDialogParent does all sorts of things to try and find a useful parent window for dialogs. It first uses the topmost parent of the active window to avoid using floating windows or other dialog boxes. If there are no active windows, then it will take a random stab and choose the first visible top window. Otherwise, it defaults to the desktop.

Returns
Pointer to the default window.

Definition at line 1423 of file svapp.cxx.

References Dialog::GetDefDialogParent(), and vcl::Window::GetFrameWeld().

◆ GetDesktopEnvironment()

const OUString & Application::GetDesktopEnvironment ( )
static

Get the desktop environment the process is currently running in.

Returns
String representing the desktop environment

Definition at line 1583 of file svapp.cxx.

References IsHeadlessModeEnabled(), and SalGetDesktopEnvironment().

Referenced by StyleSettings::GetAutomaticallyChosenIconTheme(), and getButtonPriority().

◆ GetDialogCancelMode()

DialogCancelMode Application::GetDialogCancelMode ( )
static

Gets the dialog cancel mode for headless environments.

Returns
DialogCancelMode value
See also
SetDialogCancelMode, IsDialogCancelEnabled

Definition at line 1429 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::maAppData, and ImplSVAppData::meDialogCancel.

Referenced by EnableHeadlessMode(), and Dialog::ImplStartExecute().

◆ GetDispatchLevel()

sal_uInt16 Application::GetDispatchLevel ( )
static

Return how many events are being dispatched.

Returns
the number of events currently being dispatched

Definition at line 495 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::maAppData, and ImplSVAppData::mnDispatchLevel.

◆ GetDisplayBuiltInScreen()

unsigned int Application::GetDisplayBuiltInScreen ( )
static

Get the built-in screen.

Returns
This returns the LCD screen number for a laptop, or the primary external VGA display for a desktop machine - it is where a presenter console should be rendered if there are other (non-built-in) screens present.
See also
IsUnifiedDisplay, GetBestScreen

Definition at line 1225 of file svapp.cxx.

References SalSystem::GetDisplayBuiltInScreen(), and ImplGetSalSystem().

Referenced by GetDisplayExternalScreen().

◆ GetDisplayConnection()

css::uno::Reference< css::awt::XDisplayConnection > Application::GetDisplayConnection ( )
static

Definition at line 1507 of file svapp.cxx.

References ImplGetSVData(), and ImplSVData::mxDisplayConnection.

Referenced by vcl::X11DnDHelper().

◆ GetDisplayExternalScreen()

unsigned int Application::GetDisplayExternalScreen ( )
static

Get the display's external screen.

Practically, this means - Get the screen we should run a presentation on.

Returns
0 or 1 currently, will fallback to the first available screen if there are more than one external screens. May be changed in the future.

Definition at line 1231 of file svapp.cxx.

References GetDisplayBuiltInScreen().

◆ GetDisplayName()

OUString Application::GetDisplayName ( )
static

Get the default name of the application for message dialogs and printing.

Returns
The display name of the application.

Definition at line 1208 of file svapp.cxx.

References SystemWindow::GetText(), ImplGetSVData(), ImplSVData::maAppData, ImplSVData::maFrameData, ImplSVFrameData::mpAppWin, and ImplSVAppData::mxDisplayName.

Referenced by MessageDialog::MessageDialog(), and Printer::StartJob().

◆ GetFirstTopLevelWindow()

vcl::Window * Application::GetFirstTopLevelWindow ( )
static

Get the first top-level window of the application.

Returns
Pointer to top-level window (a Window object)
See also
GetNextTopLevelWindow, GetTopWindowCount, GetTopWindow, GetActiveTopWindow

Definition at line 1061 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::maFrameData, and ImplSVFrameData::mpFirstFrame.

Referenced by vcl::lok::dumpState(), IMPL_LINK_NOARG(), GDIMetaFile::ImplPlayWithRenderer(), TopLevelWindowLocker::incBusy(), and MiscSettings::SetDarkMode().

◆ GetFocusWindow()

vcl::Window * Application::GetFocusWindow ( )
static

◆ GetFrameWeld()

weld::Window * Application::GetFrameWeld ( const css::uno::Reference< css::awt::XWindow > &  rWindow)
static

Definition at line 225 of file builder.cxx.

References SalInstance::GetFrameWeld(), ImplGetSVData(), and ImplSVData::mpDefInst.

◆ GetHelp()

Help * Application::GetHelp ( )
static

Gets the application's help.

Returns
Pointer to application's help object. Note that the application may not have a help object, so it might return NULL.
See also
SetHelp

Definition at line 1352 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::maAppData, and ImplSVAppData::mpHelp.

Referenced by vcl::Window::GetHelpText(), HeaderBar::GetHelpText(), StatusBar::GetHelpText(), SalInstanceWindow::help(), IMPL_LINK(), Menu::ImplGetHelpText(), ToolBox::ImplGetHelpText(), MenuWindow::ImplHandleHelpEvent(), and vcl::Window::RequestHelp().

◆ GetHWOSConfInfo()

OUString Application::GetHWOSConfInfo ( const int  bSelection = 0,
bool  bLocalize = true 
)
static

Get useful OS, Hardware and configuration information, cf.

Help->About, and User-Agent bSelection = 0 to return all info, 1 for environment only, and 2 for VCL/render related infos

Definition at line 1153 of file svapp.cxx.

References GetOSVersion(), GetToolkitName(), hwEnv, hwUI, SkiaHelper::isVCLSkiaEnabled(), Localize(), SV_APP_VCLBACKEND, and u.

◆ GetLastInputInterval()

sal_uInt64 Application::GetLastInputInterval ( )
static

The interval from the last time that input was received.

Returns
system ticks - last input time
See also
AnyInput

Definition at line 505 of file svapp.cxx.

References tools::Time::GetSystemTicks(), and ImplGetSVData().

◆ GetNextTopLevelWindow()

vcl::Window * Application::GetNextTopLevelWindow ( vcl::Window const *  pWindow)
static

Get the next top level window.

Parameters
pWindowPointer to Window object you wish to get the next window from.
Returns
Pointer to next top window.

Definition at line 1067 of file svapp.cxx.

References vcl::Window::mpWindowImpl.

Referenced by vcl::lok::dumpState(), IMPL_LINK_NOARG(), TopLevelWindowLocker::incBusy(), and MiscSettings::SetDarkMode().

◆ GetOSVersion()

OUString Application::GetOSVersion ( )
static

Get the OS version based on the OS specific implementation.

Returns
OUString version string or "-" in case of problems

Definition at line 1142 of file svapp.cxx.

References SalInstance::getOSVersion(), ImplGetSVData(), and ImplSVData::mpDefInst.

Referenced by GetHWOSConfInfo().

◆ GetReservedKeyCode()

const vcl::KeyCode * Application::GetReservedKeyCode ( size_t  i)
static

Get the reserved key code.

Parameters
iThe keycode number to retrieve
Returns
Const pointer to a KeyCode object
See also
GetReservedKeyCodeCount

Definition at line 285 of file svapp.cxx.

References GetReservedKeyCodeCount(), i, and ReservedKeys.

◆ GetReservedKeyCodeCount()

size_t Application::GetReservedKeyCodeCount ( )
static

Get the number of reserved key codes used by the application.

Returns
number of reserved key codes
See also
GetReservedKeyCode

Definition at line 280 of file svapp.cxx.

References ReservedKeys, and SAL_N_ELEMENTS.

Referenced by GetReservedKeyCode().

◆ GetScreenCount()

unsigned int Application::GetScreenCount ( )
static

Get the number of screens available for the display.

Returns
The number of screens available.
See also
GetScreenPosSizePixel

Definition at line 1219 of file svapp.cxx.

References SalSystem::GetDisplayScreenCount(), and ImplGetSalSystem().

Referenced by GetBestScreen(), FloatingWindow::ImplCalcPos(), vcl::WindowOutputDevice::ImplGetCanvas(), SystemWindow::ImplMoveToScreen(), and PopupMenu::PrepareRun().

◆ GetScreenPosSizePixel()

tools::Rectangle Application::GetScreenPosSizePixel ( unsigned int  nScreen)
static

Get a screen's rectangular area.

Parameters
nScreenThe number of the screen requested.
Returns
The area of the screen in a Rectangle object.
See also
GetScreenCount

Definition at line 1254 of file svapp.cxx.

References SalSystem::GetDisplayScreenPosSizePixel(), tools::Rectangle::GetHeight(), ImplGetSalSystem(), and SAL_WARN.

Referenced by GetBestScreen(), FloatingWindow::ImplCalcPos(), Menu::ImplCalcSize(), SystemWindow::ImplMoveToScreen(), and PopupMenu::PrepareRun().

◆ GetSettings()

const AllSettings & Application::GetSettings ( )
static

Gets the application's settings.

If the application hasn't initialized it's settings, then it does so (lazy initialization).

Returns
AllSettings instance that contains the current settings of the application.
See also
OverrideSystemSettings, MergeSystemSettings, SetSettings

Definition at line 638 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::maAppData, and ImplSVAppData::mxSettings.

Referenced by ToolBox::ApplyBackgroundSettings(), MenuBarWindow::ApplySettings(), SalInstanceComboBox< vcl_type >::create_render_virtual_device(), MnemonicGenerator::CreateMnemonic(), Edit::CreatePopupMenu(), Splitter::DataChanged(), ImplImageTree::doLoadImage(), ImplWin::DrawEntry(), ImplListBoxWindow::DrawEntry(), MetricField::DumpAsPropertyTree(), vcl::findMatchingEntry(), weld::MetricSpinButton::format_number(), weld::TimeFormatter::FormatNumber(), weld::DateFormatter::FormatNumber(), GetAppLocaleDataWrapper(), OutputDevice::GetDefaultFont(), ToolBox::GetDefaultImageSize(), OutputDevice::GetFontFeatures(), MenuItemList::GetItemCount(), FormatterBase::GetLanguageTag(), TextEngine::GetLocale(), FormatterBase::GetLocale(), MenuBarWindow::HighlightItem(), weld::IMPL_LINK(), weld::IMPL_LINK_NOARG(), OutputDevice::ImplBreakLinesWithIterator(), ToolBox::ImplDrawBackground(), PushButton::ImplDrawPushButton(), ImplFindAccelWindow(), Wallpaper::ImplGetApplicationGradient(), ImplHandleKey(), ImplHandleSalSettings(), TabPage::ImplInit(), ImageButton::ImplInitStyle(), ImplIsPatternChar(), ImplPatternChar(), vcl::Window::ImplUpdateGlobalSettings(), InitAccessBridge(), vcl::PrintDialog::initFromMultiPageSetup(), SvxIconChoiceCtrl_Impl::IsMnemonicChar(), BitmapEx::loadFromIconTheme(), vcl::bitmap::loadFromName(), vcl::ImageRepository::loadImage(), ImplImage::loadStockAtScale(), AllSettings::LocaleSettingsChanged(), vcl::PrintDialog::ShowNupOrderWindow::Paint(), vcl::PrintDialog::PrintPreviewWindow::Paint(), PopupMenu::Run(), ExtTextEngine::Search(), MenuItemList::SearchItem(), TextEngine::SeekCursor(), vcl::IconThemeSelector::SelectIconTheme(), SalInstanceTextView::set_monospace(), SvLBoxButtonData::SetDefaultImages(), SalFlashAttention::SetFlash(), vcl::PrintDialog::setPaperSizes(), vcl::PrintDialog::PrintPreviewWindow::setPreview(), Splitter::StartDrag(), SvImpLBox::UpdateStringSorter(), and VclPaned::VclPaned().

◆ GetSolarMutex()

comphelper::SolarMutex & Application::GetSolarMutex ( )
static

Get the Solar Mutex for this thread.

Get the Solar Mutex that prevents other threads from accessing VCL concurrently.

Returns
SolarMutex reference
See also
Execute, Quit, Reschedule, Yield, EndYield, IsMainThread, ReleaseSolarMutex, AcquireSolarMutex,

Definition at line 451 of file svapp.cxx.

References SalInstance::GetYieldMutex(), ImplGetSVData(), and ImplSVData::mpDefInst.

◆ GetSystemDependentDataManager()

basegfx::SystemDependentDataManager & Application::GetSystemDependentDataManager ( )
static

access the DataManager for buffering system-dependent data

Returns
the global instance of the SystemDependentDataManager

Definition at line 1056 of file svapp.cxx.

References ImplGetSystemDependentDataManager().

◆ GetSystemWindowMode()

SystemWindowFlags Application::GetSystemWindowMode ( )
static

Get the system window mode of dialogs.

Returns
SystemWindowFlags::NOAUTOMODE (0x0001) or SystemWindowFlags::DIALOG (0x0002)
See also
SetSystemWindowMode

Definition at line 1449 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::maAppData, and ImplSVAppData::mnSysWinMode.

Referenced by Dialog::ImplInitDialog(), and VCLExceptionSignal_impl().

◆ GetToolkitName()

OUString Application::GetToolkitName ( )
static

Get the toolkit's name.

e.g. gtk3

Returns
The toolkit name.

Definition at line 1357 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::maAppData, and ImplSVAppData::mxToolkitName.

Referenced by VclBox::getDefaultAccessibleRole(), and GetHWOSConfInfo().

◆ GetTopWindow()

vcl::Window * Application::GetTopWindow ( tools::Long  nIndex)
static

Get the nth top window.

Remarks
Top windows are actually implemented in a one-way linked list. This iterates through top level windows n times.
Parameters
nIndexThe index of the top-level window
Returns
The nth top-level window of the application
See also
GetFirstTopLevelWindow, GetNextTopLevelWindow, GetTopWindowCount, GetActiveTopWindow

Definition at line 1086 of file svapp.cxx.

References VclPtr< reference_type >::get(), ImplGetSVData(), vcl::Window::ImplGetWindow(), vcl::Window::IsTopWindow(), ImplSVData::maFrameData, ImplSVFrameData::mpFirstFrame, vcl::Window::mpWindowImpl, and nIndex.

Referenced by DebugEventInjector::ChooseWindow(), and DeInitVCL().

◆ GetTopWindowCount()

tools::Long Application::GetTopWindowCount ( )
static

◆ GetVCLToolkit()

css::uno::Reference< css::awt::XToolkit > Application::GetVCLToolkit ( )
static

Gets the VCL toolkit.

Attention: \n The global service manager has to be created before getting the toolkit!
Returns
UNO reference to VCL toolkit

Definition at line 1454 of file svapp.cxx.

References UnoWrapperBase::GetUnoWrapper(), and UnoWrapperBase::GetVCLToolkit().

◆ HandleKey()

bool Application::HandleKey ( VclEventId  nEvent,
vcl::Window pWin,
KeyEvent pKeyEvent 
)
static

Handle keypress event.

Parameters
nEventEvent ID for keypress
pWinPointer to window that receives the event
pKeyEventReceived key event
See also
PostKeyEvent

Definition at line 723 of file svapp.cxx.

References aEvent, ImplGetSVData(), ImplSVData::maAppData, and ImplSVAppData::maKeyListeners.

Referenced by ImplHandleKey().

◆ hasNativeFileSelection()

bool Application::hasNativeFileSelection ( )
static

Do we have a native / system file selector available?

Returns
True if native file selector is available, false otherwise.

Definition at line 1626 of file svapp.cxx.

References SalInstance::hasNativeFileSelection(), ImplGetSVData(), and ImplSVData::mpDefInst.

◆ ImplCallEventListeners()

void Application::ImplCallEventListeners ( VclSimpleEvent rEvent)
static

Send event to all VCL application event listeners.

Parameters
rEventReference to VclSimpleEvent
See also
ImplCallEventListeners(sal_uLong nEvent, Windows* pWin, void* pData);

Definition at line 692 of file svapp.cxx.

References VclEventListeners::Call(), ImplGetSVData(), ImplSVData::maAppData, and ImplSVAppData::maEventListeners.

Referenced by vcl::Window::CallEventListeners(), and Menu::ImplCallEventListeners().

◆ ImplCallEventListenersApplicationDataChanged()

void Application::ImplCallEventListenersApplicationDataChanged ( void *  pData)
static

Send event to all VCL application event listeners.

Parameters
pWinPointer to window to send event
pDataPointer to data to send with event
See also
ImplCallEventListeners(VclSimpleEvent* pEvent)

Definition at line 684 of file svapp.cxx.

References aEvent, ApplicationDataChanged, VclEventListeners::Call(), ImplGetSVData(), ImplSVData::maAppData, ImplSVAppData::maEventListeners, and pData.

Referenced by OutputDevice::EndFontSubstitution(), ImplHandleSalSettings(), SetSettings(), and Printer::updatePrinters().

◆ Init()

void Application::Init ( void  )
virtual

Initialize the application itself.

Attention: \n Note that the global data structures and platform specific
initialization is done in the constructor.
See also
InitFinished, DeInit

Definition at line 200 of file svapp.cxx.

Referenced by InitVCL().

◆ InitFinished()

void Application::InitFinished ( )
virtual

Finish initialization of the application.

See also
Init, DeInit

Definition at line 204 of file svapp.cxx.

◆ InsertAccel()

bool Application::InsertAccel ( Accelerator pAccel)
static

Insert accelerator.

Parameters
pAccelPointer to an Accelerator object to insert
Returns
true if successful, false if otherwise
See also
RemoveAccel

Definition at line 1323 of file svapp.cxx.

References ImplGetSVData(), ImplAccelManager::InsertAccel(), ImplSVData::maAppData, and ImplSVAppData::mpAccelMgr.

Referenced by ImplTBDragMgr::StartDragging(), and SvInplaceEdit2::SvInplaceEdit2().

◆ IsBitmapRendering()

bool Application::IsBitmapRendering ( )
static

Determines if bitmap rendering is enabled.

Returns
True if bitmap rendering is enabled.

Definition at line 1549 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::maAppData, and ImplSVAppData::mbRenderToBitmaps.

Referenced by CreateSalInstance().

◆ IsDialogCancelEnabled()

bool Application::IsDialogCancelEnabled ( )
static

Determines if dialog cancel mode is enabled.

Returns
True if dialog cancel mode is enabled, false if disabled.
See also
GetDialogCancelMode, SetDialogCancelMode

Definition at line 1439 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::maAppData, ImplSVAppData::meDialogCancel, and Off.

Referenced by IsHeadlessModeEnabled().

◆ IsHeadlessModeEnabled()

bool Application::IsHeadlessModeEnabled ( )
static

◆ IsInExecute()

bool Application::IsInExecute ( )
static

Queries whether the application is in the event loop.

Returns
true if in the event loop, false if not
See also
IsInMain, IsInModalMode

Definition at line 480 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::maAppData, and ImplSVAppData::mbInAppExecute.

◆ IsInMain()

bool Application::IsInMain ( )
static

Queries whether the application is in "main", i.e.

not yet in the event loop

Returns
true if in main, false if not in main
See also
IsInExecute, IsInModalMode

Definition at line 474 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::maAppData, and ImplSVAppData::mbInAppMain.

◆ IsInModalMode()

bool Application::IsInModalMode ( )
static

Queries whether application has a modal dialog active.

Returns
true if a modal dialog is active, false if not
See also
IsInMain, IsInExecute

Definition at line 490 of file svapp.cxx.

References ImplGetSVData().

◆ IsMainThread()

bool Application::IsMainThread ( )
static

Queries whether we are in main thread.

Returns
true if we are in main thread, false if not
See also
Execute, Quit, Reschedule, Yield, EndYield, GetSolarMutex, ReleaseSolarMutex, AcquireSolarMutex,

Definition at line 457 of file svapp.cxx.

References ImplGetSVData(), and ImplSVData::mnMainThreadId.

Referenced by vcl::SolarThreadExecutor::execute().

◆ IsOnSystemEventLoop()

bool Application::IsOnSystemEventLoop ( )
static

Returns true, if the VCL plugin runs on the system event loop.

AKA the VCL plugin can't handle nested event loops, like WASM or mobile.

Definition at line 374 of file svapp.cxx.

References ImplGetSVData(), ImplSVAppData::m_bUseSystemLoop, and ImplSVData::maAppData.

Referenced by SalInstance::DoExecute(), SalInstance::DoQuit(), Execute(), Reschedule(), and Yield().

◆ IsQuit()

bool Application::IsQuit ( )
static

◆ IsSafeModeEnabled()

bool Application::IsSafeModeEnabled ( )
static

Determines if safe mode is enabled.

Definition at line 1562 of file svapp.cxx.

References bSafeMode.

◆ IsUICaptured()

bool Application::IsUICaptured ( )
static

◆ libreOfficeKitViewCallback()

void Application::libreOfficeKitViewCallback ( int  nType,
const OString &  pPayload 
) const
overridevirtual

◆ LoadBrandBitmap()

bool Application::LoadBrandBitmap ( std::u16string_view  pName,
BitmapEx rBitmap 
)
static

Load a localized branding PNG file as a bitmap.

Parameters
pNameName of the bitmap to load.
rBitmapReference to BitmapEx object to load PNG into
Returns
true if the PNG could be loaded, otherwise returns false.

Definition at line 55 of file brand.cxx.

References LanguageTag::getFallbackStrings(), and pName.

◆ LOKHandleMouseEvent()

bool Application::LOKHandleMouseEvent ( VclEventId  nEvent,
vcl::Window pWin,
const MouseEvent pEvent 
)
static

◆ Main()

int Application::Main ( )
virtual

Pure virtual entrypoint to the application.

Main() is the pure virtual entrypoint to your application. You inherit your class from Application and subclass this function to implement an application.

The Main() function does not pass in command line parameters, you must use the functions GetCommandLineParamCount() and GetCommandLineParam() to get these values as these are platform independent ways of getting the command line (use GetAppFileName() to get the invoked executable filename).

Once in this function, you create windows, etc. then call on Execute() to start the application's main event loop.

An example code snippet follows (it won't compile, this just gives the general flavour of the framework and is adapted from an old HelloWorld example program that Star Division used to provide as part of their library).

class TheApplication : public Application
{
public:
virtual void Main();
};
class TheWindow : public WorkWindow
{
public:
TheWindow(vcl::Window *parent, WinBits windowStyle) :
WorkWindow(parent, windowStyle) {}
virtual void Paint(const Rectangle &);
};
void TheWindow::Paint(const Rectangle&)
{
DrawText(Point(100,100), String("Hello World!"));
}
void TheApplication::Main()
{
TheWindow aWindow(NULL, WB_APP | WB_STDWORK);
aWindow.Show();
}
TheApplication anApplication;
Base class used mainly for the LibreOffice Desktop class.
Definition: svapp.hxx:237
static void Execute()
Run the main event processing loop until it is quit by Quit().
Definition: svapp.cxx:315
virtual int Main()
Pure virtual entrypoint to the application.
Definition: svapp.cxx:179
sal_Int64 WinBits
Definition: wintypes.hxx:109
WinBits const WB_APP
Definition: wintypes.hxx:125
WinBits const WB_STDWORK
Definition: wintypes.hxx:213

Some examples in the source tree can be found here:

vcl/workben/svdem.cxx

This is an example of how to use the Application and WorkWindow. Unfortunately, it no longer compiles.

vcl/fpicker/test/svdem.cxx

Definition at line 179 of file svapp.cxx.

References SAL_WARN.

Referenced by ImplSVMain().

◆ MergeSystemSettings()

void Application::MergeSystemSettings ( AllSettings rSettings)
static

Set the settings object to the platform/desktop environment system settings.

Parameters
rSettingsReference to the settings object to change.
See also
OverrideSystemSettings, SetSettings, GetSettings

Definition at line 525 of file svapp.cxx.

References ImplGetDefaultWindow(), ImplGetSVData(), vcl::Window::ImplUpdateGlobalSettings(), ImplSVData::maAppData, ImplSVData::maFrameData, ImplSVAppData::mbSettingsInit, ImplSVFrameData::mpFirstFrame, and ImplSVAppData::mxSettings.

Referenced by ImplHandleSalSettings().

◆ NotifyAllWindows()

void Application::NotifyAllWindows ( DataChangedEvent rDCEvt)
static

Notify all windows that the application has changed data.

Parameters
rDCEvtReference to a DataChangedEvent object
See also
DataChanged

Definition at line 665 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::maFrameData, ImplSVFrameData::mpFirstFrame, vcl::Window::mpWindowImpl, and vcl::Window::NotifyAllChildren().

Referenced by OutputDevice::EndFontSubstitution(), ImplHandleSalSettings(), and Printer::updatePrinters().

◆ notifyInvalidation()

void Application::notifyInvalidation ( tools::Rectangle const *  ) const
overridevirtual

Emits a LOK_CALLBACK_INVALIDATE_TILES.

Implements vcl::ILibreOfficeKitNotifier.

Definition at line 311 of file svapp.cxx.

◆ notifyWindow()

void Application::notifyWindow ( vcl::LOKWindowId  nLOKWindowId,
const OUString &  rAction,
const std::vector< vcl::LOKPayloadItem > &  rPayload = std::vector< vcl::LOKPayloadItem >() 
) const
overridevirtual

Callbacks.

Implements vcl::ILibreOfficeKitNotifier.

Definition at line 293 of file svapp.cxx.

References SAL_WARN.

◆ OverrideSystemSettings()

void Application::OverrideSystemSettings ( AllSettings rSettings)
virtual

Sets user settings in settings object to override system settings.

The system settings that can be overridden are:

  • window dragging options (on or off, including live scrolling!)
  • style settings (e.g. checkbox color, border color, 3D colors, button rollover colors, etc.)
  • mouse settings
  • menu options, including the mouse follows the menu and whether menu icons are used
Parameters
rSettingsReference to the settings object to change.
See also
MergeSystemSettings, SetSettings, GetSettings

Definition at line 521 of file svapp.cxx.

Referenced by ImplHandleSalSettings(), and vcl::Window::ImplUpdateGlobalSettings().

◆ PostGestureEvent()

ImplSVEvent * Application::PostGestureEvent ( VclEventId  nEvent,
vcl::Window pWin,
GestureEventPan const *  pGestureEvent 
)
static

◆ PostKeyEvent()

ImplSVEvent * Application::PostKeyEvent ( VclEventId  nEvent,
vcl::Window pWin,
KeyEvent const *  pKeyEvent 
)
static

Send keypress event.

Parameters
nEventEvent ID for keypress
pWinPointer to window to which the event is sent
pKeyEventKey event to send
See also
HandleKey

Definition at line 747 of file svapp.cxx.

References ImplGetSVData(), LINK, ImplSVData::maAppData, ImplSVAppData::maPostedEventList, PostUserEvent(), and VclReferenceBase::release().

◆ PostMouseEvent()

ImplSVEvent * Application::PostMouseEvent ( VclEventId  nEvent,
vcl::Window pWin,
MouseEvent const *  pMouseEvent 
)
static

◆ PostUserEvent()

ImplSVEvent * Application::PostUserEvent ( const Link< void *, void > &  rLink,
void *  pCaller = nullptr,
bool  bReferenceLink = false 
)
static

Post a user event to the default window.

User events allow for the deferral of work to later in the main-loop - at idle.

Execution of the deferred work is thread-safe which means all the tasks are executed serially, so no thread-safety locks between tasks are necessary.

Parameters
rLinkLink to event callback function
pCallerPointer to data sent to the event by the caller. Optional.
bReferenceLinkIf true - hold a VclPtr<> reference on the Link's instance. Taking the reference is guarded by a SolarMutexGuard.
Returns
the event ID used to post the event.

Definition at line 999 of file svapp.cxx.

References Link< typename Arg, typename Ret >::GetInstance(), ImplGetDefaultWindow(), vcl::Window::ImplGetFrame(), and SalFrame::PostEvent().

Referenced by EndYield(), vcl::SolarThreadExecutor::execute(), IMPL_LINK_NOARG(), FloatingWindow::ImplCallPopupModeEnd(), vcl::Window::ImplGenerateMouseMove(), ImplHandleClose(), ImplHandleGetFocus(), ImplHandleLoseFocus(), ImplHandleMouseEvent(), Menu::ImplSelect(), ImplSysChildProc(), SvImpLBox::NotifyTabsChanged(), SvImpLBox::Paint(), IconViewImpl::Paint(), PostGestureEvent(), PostKeyEvent(), PostMouseEvent(), Printer::PrintJob(), Quit(), SvxIconChoiceCtrl_Impl::Resize(), MenuBarUpdateIconManager::SetShowBubble(), and MenuBarUpdateIconManager::SetShowMenuIcon().

◆ QueryExit()

bool Application::QueryExit ( )
virtual

Exit from the application.

Returns
true if exited successfully, false if not able to fully exit

Definition at line 185 of file svapp.cxx.

References WorkWindow::Close(), ImplGetSVData(), ImplSVData::maFrameData, and ImplSVFrameData::mpAppWin.

◆ Quit()

void Application::Quit ( )
static

◆ ReleaseSolarMutex()

sal_uInt32 Application::ReleaseSolarMutex ( )
static

Release Solar Mutex(es) for this thread.

Release the Solar Mutex(es) that prevents other threads from accessing VCL concurrently.

Returns
The number of mutexes that were acquired by this thread.
See also
Execute, Quit, Reschedule, Yield, EndYield, GetSolarMutex, IsMainThread, AcquireSolarMutex,

Definition at line 462 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::mpDefInst, and SalInstance::ReleaseYieldMutexAll().

◆ RemoveAccel()

void Application::RemoveAccel ( Accelerator const *  pAccel)
static

Remove accelerator.

Parameters
pAccelPointer to Accelerator object to remove
See also
InsertAccel

Definition at line 1332 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::maAppData, ImplSVAppData::mpAccelMgr, and ImplAccelManager::RemoveAccel().

Referenced by SvInplaceEdit2::CallCallBackHdl_Impl(), ImplTBDragMgr::EndDragging(), and SvInplaceEdit2::~SvInplaceEdit2().

◆ RemoveEventListener()

void Application::RemoveEventListener ( const Link< VclSimpleEvent &, void > &  rEventListener)
static

Remove a VCL event listener from the application.

Parameters
rEventListenerConst reference to the event listener to be removed
See also
AddEventListener, AddKeyListener, RemoveKeyListener

Definition at line 704 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::maAppData, ImplSVAppData::maEventListeners, and VclEventListeners::removeListener().

Referenced by MenuBarUpdateIconManager::~MenuBarUpdateIconManager().

◆ RemoveKeyListener()

void Application::RemoveKeyListener ( const Link< VclWindowEvent &, bool > &  rKeyListener)
static

Remove a keypress listener from the application.

Parameters
rKeyListenerConst reference to the keypress event listener to be removed
See also
AddEventListener, RemoveEventListener, AddKeyListener

Definition at line 716 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::maAppData, and ImplSVAppData::maKeyListeners.

Referenced by SalInstanceWidget::~SalInstanceWidget().

◆ RemoveMouseAndKeyEvents()

void Application::RemoveMouseAndKeyEvents ( vcl::Window pWin)
static

Remove mouse and keypress events from a window... any also zoom and scroll events if the platform supports it.

Parameters
pWinWindow to remove events from
See also
HandleKey, PostKeyEvent, PostMouseEvent

Definition at line 976 of file svapp.cxx.

References ImplGetSVData(), and RemoveUserEvent().

Referenced by vcl::Window::dispose().

◆ RemoveUserEvent()

void Application::RemoveUserEvent ( ImplSVEvent nUserEvent)
static

◆ Reschedule()

bool Application::Reschedule ( bool  bHandleAllCurrentEvents = false)
static

Attempt to process current pending event(s)

It doesn't sleep if no events are available for processing. This doesn't process any events generated after invoking the function. So in contrast to Scheduler::ProcessEventsToIdle, this cannot become busy-locked by an event-generating event in the event queue.

Parameters
bHandleAllCurrentEventsIf set to true, then try to process all the current events. If set to false, then only process one event. Defaults to false.
Returns
true if any event was processed.
See also
Yield, Scheduler::ProcessEventsToIdle

Definition at line 363 of file svapp.cxx.

References ImplYield(), IsOnSystemEventLoop(), and SAL_WARN.

Referenced by vcl::PrinterController::getPageFile(), and OutputDevice::RemoveTransparenciesFromMetaFile().

◆ SetAppName()

void Application::SetAppName ( const OUString &  rUniqueName)
static

Set the application's name.

Parameters
rUniqueNameWhat to set the application name to
See also
GetAppName

Definition at line 1117 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::maAppData, and ImplSVAppData::mxAppName.

◆ setDeInitHook()

void Application::setDeInitHook ( Link< LinkParamNone *, void > const &  hook)
static

◆ SetDialogCancelMode()

void Application::SetDialogCancelMode ( DialogCancelMode  mode)
static

Sets the dialog cancel mode for headless environments.

This should be private, but XFrameImpl needs to access it and current baseline gcc doesn't support forward definition of anonymous classes. You probably should use EnableHeadlessMode instead.

Parameters
modeDialogCancel mode value
See also
GetDialogCancelMode, IsDialogCancelEnabled, EnableHeadlessMode

Definition at line 1434 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::maAppData, ImplSVAppData::meDialogCancel, and mode.

Referenced by EnableHeadlessMode().

◆ SetDisplayName()

void Application::SetDisplayName ( const OUString &  rDisplayName)
static

Set the default name of the application for message dialogs and printing.

Parameters
rDisplayNameconst reference to string to set the Display name to.
See also
GetDisplayName

Definition at line 1202 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::maAppData, and ImplSVAppData::mxDisplayName.

◆ SetFilterHdl()

void Application::SetFilterHdl ( const Link< ConvertData &, bool > &  rLink)
static

Setup a new graphics filter.

Parameters
rLinkConst reference to a Link object, which the filter calls upon.
See also
GetFilterHdl

Definition at line 1520 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::maGDIData, and ImplSVGDIData::mxGrfConverter.

◆ SetHelp()

void Application::SetHelp ( Help pHelp = nullptr)
static

Sets up help.

Parameters
pHelpPointer to a Help object (optional, can by NULL)
See also
GetHelp

Definition at line 1340 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::maAppData, and ImplSVAppData::mpHelp.

◆ SetSettings()

void Application::SetSettings ( const AllSettings rSettings)
static

◆ SetSystemWindowMode()

void Application::SetSystemWindowMode ( SystemWindowFlags  nMode)
static

Make a dialog box a system window or not.

Parameters
nModeCan be either: SystemWindowFlags::NOAUTOMODE (0x0001) or SystemWindowFlags::DIALOG (0x0002)
See also
GetSystemWindowMode

Definition at line 1444 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::maAppData, and ImplSVAppData::mnSysWinMode.

Referenced by VCLExceptionSignal_impl().

◆ ShowNativeErrorBox()

void Application::ShowNativeErrorBox ( const OUString &  sTitle,
const OUString &  sMessage 
)
static

◆ Shutdown()

void Application::Shutdown ( )
virtual

Definition at line 196 of file svapp.cxx.

Referenced by Execute().

◆ UpdateMainThread()

void Application::UpdateMainThread ( )
static

Update main thread identifier.

Definition at line 1345 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::mpDefInst, and SalInstance::updateMainThread().

◆ Yield()

void Application::Yield ( )
static

Process the next event.

It sleeps if no event is available for processing and just returns if an event was processed.

See also
Execute, Quit, Reschedule, EndYield, GetSolarMutex, IsMainThread, ReleaseSolarMutex, AcquireSolarMutex,

Definition at line 428 of file svapp.cxx.

References ImplYield(), IsOnSystemEventLoop(), and SAL_WARN.

Referenced by SystemWindow::ensureRepaint(), Execute(), Dialog::Execute(), MenuFloatingWindow::Execute(), and ImplHandleExtTextInput().

Member Data Documentation

◆ m_pCallback

LibreOfficeKitCallback Application::m_pCallback

Definition at line 1322 of file svapp.hxx.

Referenced by Application(), and libreOfficeKitViewCallback().

◆ m_pCallbackData

void* Application::m_pCallbackData

Definition at line 1321 of file svapp.hxx.

Referenced by Application(), and libreOfficeKitViewCallback().


The documentation for this class was generated from the following files: