LibreOffice Module vcl (master)  1
Public Member Functions | Static Public Member Functions | 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]

Public Member Functions

virtual int Main ()
 Pure virtual entrypoint to the application. More...
 
virtual bool QueryExit ()
 Exit from the application. 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...
 

Static Public Member Functions

static bool IsUICaptured ()
 
static void SetAppName (const OUString &rUniqueName)
 Set the application's name. More...
 
static const OUString & GetDesktopEnvironment ()
 Get the desktop environment the process is currently running in. More...
 
static void LockFontUpdates (bool bLock)
 Lock font updates for all output devices. More...
 
static void setDeInitHook (Link< LinkParamNone *, void > const &hook)
 
static weld::BuilderCreateBuilder (weld::Widget *pParent, const OUString &rUIFile)
 
static weld::BuilderCreateInterimBuilder (vcl::Window *pParent, const OUString &rUIFile)
 
static weld::BuilderCreateInterimBuilder (weld::Widget *pParent, const OUString &rUIFile)
 
static weld::MessageDialogCreateMessageDialog (weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage)
 
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 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 WorkWindowGetAppWindow ()
 Get the main application window. More...
 
static vcl::WindowGetFocusWindow ()
 Get the currently focused window. More...
 
static OutputDeviceGetDefaultDevice ()
 Get the default "device" (in this case the default window). 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 long GetTopWindowCount ()
 Return the number of top-level windows being used by the application. More...
 
static vcl::WindowGetTopWindow (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 GetHWOSConfInfo ()
 Get useful OS, Hardware and configuration information, cf. More...
 
static bool LoadBrandBitmap (const char *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 bool IsUnifiedDisplay ()
 Determines if the screens that make up a display are separate or form one large display 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 sal_uLong GetReservedKeyCodeCount ()
 Get the number of reserved key codes used by the application. More...
 
static const vcl::KeyCodeGetReservedKeyCode (sal_uLong 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 vcl::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...
 
Event Testing Mode
static void EnableEventTestingMode ()
 Enables event testing mode. More...
 
static bool IsEventTestingModeEnabled ()
 Determines if event testing mode is enabled. More...
 
static void EnableSafeMode ()
 Set safe mode to enabled. More...
 
static bool IsSafeModeEnabled ()
 Determines if safe mode is enabled. More...
 
IME Status Window Control
static bool CanToggleImeStatusWindow ()
 Determine application can toggle the IME status window on and off. More...
 
static void ShowImeStatusWindow (bool bShow)
 Toggle any IME status window on and off. More...
 
static bool GetShowImeStatusWindowDefault ()
 Determines if the IME status window should be turned of by default. 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 void EndAllDialogs ()
 Cancel all open dialogs. More...
 
static void EndAllPopups ()
 Cancel all open popups. More...
 

Private Member Functions

 DECL_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 ImplSVEventPostMouseEvent (VclEventId nEvent, vcl::Window *pWin, MouseEvent const *pMouseEvent)
 Send mouse event. More...
 
static ImplSVEventPostGestureEvent (VclEventId nEvent, vcl::Window *pWin, GestureEvent const *pGestureEvent)
 
static void RemoveMouseAndKeyEvents (vcl::Window *pWin)
 Remove mouse and keypress events from a window... 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 238 of file svapp.hxx.

Constructor & Destructor Documentation

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:
The initialization of the application itself is done in Init()

Definition at line 157 of file svapp.cxx.

References ImplGetSVData(), and ImplSVData::mpApp.

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 166 of file svapp.cxx.

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

Member Function Documentation

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 258 of file svapp.cxx.

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

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

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 541 of file svapp.cxx.

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

Referenced by SolarMutexReleaser::~SolarMutexReleaser().

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 766 of file svapp.cxx.

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

Referenced by SalInstanceWidget::ensure_mouse_listener().

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 778 of file svapp.cxx.

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

Referenced by SalInstanceWidget::ensure_key_listener().

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 1595 of file svapp.cxx.

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

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 568 of file svapp.cxx.

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

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

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 1623 of file svapp.cxx.

bool Application::CanToggleImeStatusWindow ( )
static

Determine application can toggle the IME status window on and off.

Attention:
Must only be called with the Solar mutex locked.
Returns
true if any IME status window can be toggled on and off externally.
See also
ShowImeStatusWindow, GetShowImeStatusWindowDefault, GetShowImeStatusWindowDefault

Definition at line 1556 of file svapp.cxx.

References SalInstance::CreateI18NImeStatus(), ImplGetSVData(), ImplSVData::mpDefInst, and ImplSVData::mpImeStatus.

weld::Builder * Application::CreateBuilder ( weld::Widget pParent,
const OUString &  rUIFile 
)
static
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 1634 of file svapp.cxx.

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

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 1641 of file svapp.cxx.

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

weld::Builder * Application::CreateInterimBuilder ( vcl::Window pParent,
const OUString &  rUIFile 
)
static
weld::Builder * Application::CreateInterimBuilder ( weld::Widget pParent,
const OUString &  rUIFile 
)
static

Definition at line 5542 of file salvtables.cxx.

References CreateInterimBuilder(), and SalInstanceWidget::getWidget().

weld::MessageDialog * Application::CreateMessageDialog ( weld::Widget pParent,
VclMessageType  eMessageType,
VclButtonsType  eButtonType,
const OUString &  rPrimaryMessage 
)
static
Application::DECL_STATIC_LINK ( Application  ,
PostEventHandler  ,
void ,
void   
)
private
void Application::DeInit ( )
virtual

Deinitialized the application itself.

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

Definition at line 197 of file svapp.cxx.

Referenced by DeInitVCL().

void Application::EnableBitmapRendering ( )
static

Enable software-only bitmap rendering.

Definition at line 1505 of file svapp.cxx.

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

Referenced by CreateSalInstance(), and EnableConsoleOnly().

void Application::EnableConsoleOnly ( )
static

Enable Console Only mode.

Convenience function to enable headless and bitmap rendering.

Definition at line 1515 of file svapp.cxx.

References EnableBitmapRendering(), and EnableHeadlessMode().

void Application::EnableEventTestingMode ( )
static

Enables event testing mode.

Definition at line 1528 of file svapp.cxx.

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 1491 of file svapp.cxx.

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

Referenced by EnableConsoleOnly().

void Application::EnableSafeMode ( )
static

Set safe mode to enabled.

Definition at line 1540 of file svapp.cxx.

void Application::EndAllDialogs ( )
static

Cancel all open dialogs.

Definition at line 308 of file svapp.cxx.

References LINK, and PostUserEvent().

void Application::EndAllPopups ( )
static

Cancel all open popups.

Definition at line 313 of file svapp.cxx.

References LINK, and PostUserEvent().

void Application::EndYield ( )
inlinestatic
void Application::Exception ( ExceptionCategory  nCategory)
virtual

Handles an error.

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

Definition at line 234 of file svapp.cxx.

References Abort(), ResourceNotLoaded, System, and UserInterface.

Referenced by VCLExceptionSignal_impl().

void Application::Execute ( )
static
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(), ImplSVData::maWinData, ImplSVWinData::mpFocusWin, and vcl::Window::mpWindowImpl.

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

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 213 of file svapp.cxx.

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

const LocaleDataWrapper & Application::GetAppLocaleDataWrapper ( )
static

Get the application's locale data wrapper.

Returns
reference to a LocaleDataWrapper object

Definition at line 1486 of file svapp.cxx.

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

Referenced by Calendar::ImplInit().

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.

WorkWindow * Application::GetAppWindow ( )
static

Get the main application window.

Remarks
the main application window (or App window) has a style of WB_APP, there can only be on WorkWindow with this style, if a dialog or floating window cannot find a parent, then the parent becomes the app window.

It also becomes the "default window", is used for help, is a fallback if the application has no name, and a number of other things.

returns Pointer to main application window.

See also
GetFocusWindow, GetDefaultDevice

Definition at line 1046 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::maWinData, and ImplSVWinData::mpAppWin.

Referenced by DebugEventInjector::ChooseWindow().

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

Get the "best" screen.

Returns
If IsUnifiedDisplay() == true the return value will be nearest screen of the target rectangle.

In case of IsUnifiedDisplay() == false the return value will always be GetDisplayDefaultScreen().

See also
IsUnifiedDisplay, GetDisplayBuiltInScreen

Definition at line 1244 of file svapp.cxx.

References tools::Rectangle::Bottom(), GetDisplayBuiltInScreen(), tools::Rectangle::GetIntersection(), GetScreenCount(), GetScreenPosSizePixel(), i, tools::Rectangle::IsInside(), IsUnifiedDisplay(), tools::Rectangle::Left(), tools::Rectangle::Right(), and tools::Rectangle::Top().

Referenced by FloatingWindow::ImplCalcPos(), and PopupMenu::ImplExecute().

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 206 of file svapp.cxx.

Referenced by Abort().

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 201 of file svapp.cxx.

Referenced by Abort().

OutputDevice * Application::GetDefaultDevice ( )
static
vcl::Window * Application::GetDefDialogParent ( )
static

Get the default parent window for dialog boxes.

Remarks
GetDefDialogParent does all sorts of things 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 1333 of file svapp.cxx.

References ImplGetSVData(), vcl::Window::ImplGetWindow(), vcl::Window::IsMenuFloatingWindow(), vcl::Window::IsTopWindow(), ImplSVData::maWinData, ImplSVWinData::mpActiveApplicationFrame, ImplSVWinData::mpFirstFrame, ImplSVWinData::mpFocusWin, vcl::Window::mpWindowImpl, and WB_INTROWIN.

Referenced by VclContainer::Command(), and Dialog::GetDefaultParent().

const OUString & Application::GetDesktopEnvironment ( )
static

Get the desktop environment the process is currently running in.

Returns
String representing the desktop environment

Definition at line 1584 of file svapp.cxx.

References IsHeadlessModeEnabled(), and SalGetDesktopEnvironment().

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

DialogCancelMode Application::GetDialogCancelMode ( )
static

Gets the dialog cancel mode for headless environments.

Returns
DialogCancelMode value
See also
SetDialogCancelMode, IsDialogCancelEnabled

Definition at line 1390 of file svapp.cxx.

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

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

sal_uInt16 Application::GetDispatchLevel ( )
static

Return how many events are being dispatched.

Returns
the number of events currently being dispatched

Definition at line 563 of file svapp.cxx.

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

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 1198 of file svapp.cxx.

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

Referenced by GetBestScreen(), and GetDisplayExternalScreen().

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

Definition at line 1468 of file svapp.cxx.

References ImplGetSVData(), and ImplSVData::mxDisplayConnection.

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

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 1204 of file svapp.cxx.

References GetDisplayBuiltInScreen().

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 1175 of file svapp.cxx.

References SystemWindow::GetText(), ImplGetSVData(), ImplSVData::maAppData, ImplSVData::maWinData, ImplSVWinData::mpAppWin, and ImplSVAppData::mxDisplayName.

Referenced by Printer::StartJob().

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::maWinData, and ImplSVWinData::mpFirstFrame.

Referenced by IMPL_STATIC_LINK_NOARG(), GDIMetaFile::ImplPlayWithRenderer(), and TopLevelWindowLocker::incBusy().

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

Definition at line 162 of file builder.cxx.

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

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 1319 of file svapp.cxx.

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

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

OUString Application::GetHWOSConfInfo ( )
static

Get useful OS, Hardware and configuration information, cf.

Help->About, and User-Agent

Definition at line 1132 of file svapp.cxx.

References SalInstance::getOSVersion(), GetToolkitName(), ImplGetSVData(), OpenGLWrapper::isVCLOpenGLEnabled(), ImplSVData::mpDefInst, SV_APP_VCLBACKEND, and VclResId().

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 573 of file svapp.cxx.

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

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 IMPL_STATIC_LINK_NOARG(), and TopLevelWindowLocker::incBusy().

const vcl::KeyCode * Application::GetReservedKeyCode ( sal_uLong  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 283 of file svapp.cxx.

References GetReservedKeyCodeCount().

sal_uLong 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 278 of file svapp.cxx.

References SAL_N_ELEMENTS.

Referenced by GetReservedKeyCode().

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 1186 of file svapp.cxx.

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

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

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 1227 of file svapp.cxx.

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

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

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 706 of file svapp.cxx.

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

Referenced by ToolBox::ApplyBackgroundSettings(), MenuBarWindow::ApplySettings(), vcl::PDFWriterImpl::createDefaultCheckBoxAppearance(), vcl::PDFWriterImpl::createDefaultEditAppearance(), vcl::PDFWriterImpl::createDefaultListBoxAppearance(), vcl::PDFWriterImpl::createDefaultPushButtonAppearance(), vcl::PDFWriterImpl::createDefaultRadioButtonAppearance(), MnemonicGenerator::CreateMnemonic(), Edit::CreatePopupMenu(), Splitter::DataChanged(), ImplImageTree::doLoadImage(), ImplListBoxWindow::DrawEntry(), ImplWin::DrawEntry(), vcl::findMatchingEntry(), weld::MetricSpinButton::format_number(), weld::TimeSpinButton::format_number(), GetAppLocaleDataWrapper(), OutputDevice::GetDefaultFont(), ToolBox::GetDefaultImageSize(), OutputDevice::GetFontFeatures(), MenuItemList::GetItemCount(), FormatterBase::GetLanguageTag(), FormatterBase::GetLocale(), TextEngine::GetLocale(), MenuBarWindow::HighlightItem(), weld::IMPL_LINK(), weld::IMPL_LINK_NOARG(), ToolBox::ImplDrawBackground(), PushButton::ImplDrawPushButton(), PopupMenu::ImplExecute(), ImplFindAccelWindow(), Wallpaper::ImplGetApplicationGradient(), OutputDevice::ImplGetTextLines(), Button::ImplGetTextStyle(), ImplHandleKey(), ImplHandleSalSettings(), ImplIsPatternChar(), ImplPatternChar(), vcl::Window::ImplUpdateGlobalSettings(), InitAccessBridge(), FixedHyperlink::Initialize(), SvxIconChoiceCtrl_Impl::IsMnemonicChar(), BitmapEx::loadFromIconTheme(), vcl::bitmap::loadFromName(), vcl::ImageRepository::loadImage(), ImplImage::loadStockAtScale(), AllSettings::LocaleSettingsChanged(), ExtTextEngine::Search(), MenuItemList::SearchItem(), TextEngine::SeekCursor(), SalInstanceTextView::set_monospace(), SvLBoxButtonData::SetDefaultImages(), Splitter::StartDrag(), vcl::AboutDialog::StyleControls(), SvImpLBox::UpdateStringSorter(), and VclVPaned::VclVPaned().

bool Application::GetShowImeStatusWindowDefault ( )
static

Determines if the IME status window should be turned of by default.

Returns
true if any IME status window should be turned on by default (this decision can be locale dependent, for example).
See also
ShowImeStatusWindow, GetShowImeStatusWindowDefault, CanToggleImeStatusWindow

Definition at line 1576 of file svapp.cxx.

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 524 of file svapp.cxx.

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

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 1410 of file svapp.cxx.

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

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

OUString Application::GetToolkitName ( )
static

Get the toolkit's name.

e.g. gtk3

Returns
The toolkit name.

Definition at line 1324 of file svapp.cxx.

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

Referenced by GetHWOSConfInfo().

vcl::Window * Application::GetTopWindow ( 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::maWinData, ImplSVWinData::mpFirstFrame, and vcl::Window::mpWindowImpl.

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

long Application::GetTopWindowCount ( )
static

Return the number of top-level windows being used by the application.

Returns
the number of top-level windows
See also
GetFirstTopLevelWindow, GetNextTopLevelWindow, GetTopWindow, GetActiveTopWindow

Definition at line 1072 of file svapp.cxx.

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

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

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

Gets the VCL toolkit.

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

Definition at line 1415 of file svapp.cxx.

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

Referenced by vcl::unohelper::NotifyAccessibleStateEventGlobally().

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 791 of file svapp.cxx.

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

Referenced by ImplHandleKey().

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 1627 of file svapp.cxx.

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

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 760 of file svapp.cxx.

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

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

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 752 of file svapp.cxx.

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

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

void Application::Init ( void  )
virtual

Initialize the application itself.

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

Reimplemented in UIPreviewApp.

Definition at line 189 of file svapp.cxx.

Referenced by InitVCL().

void Application::InitFinished ( )
virtual

Finish initialization of the application.

See also
Init, DeInit

Definition at line 193 of file svapp.cxx.

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 1290 of file svapp.cxx.

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

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

bool Application::IsBitmapRendering ( )
static

Determines if bitmap rendering is enabled.

Returns
True if bitmap rendering is enabled.

Definition at line 1510 of file svapp.cxx.

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

Referenced by CreateSalInstance(), and OpenGLHelper::isVCLOpenGLEnabled().

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 1400 of file svapp.cxx.

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

Referenced by IsHeadlessModeEnabled().

bool Application::IsEventTestingModeEnabled ( )
static

Determines if event testing mode is enabled.

Returns
True if event testing mode is enabled, false if not.

Definition at line 1523 of file svapp.cxx.

References bEventTestingMode.

Referenced by Execute().

bool Application::IsHeadlessModeEnabled ( )
static

Determines if headless mode is enabled.

Returns
True if headless mode is enabled, false if not.

Definition at line 1500 of file svapp.cxx.

References comphelper::LibreOfficeKit::isActive(), and IsDialogCancelEnabled().

Referenced by Sound::Beep(), vcl::PrinterController::createProgressDialog(), GetDesktopEnvironment(), vcl::PrinterController::isShowDialogs(), setupPersonaHeaderFooter(), and vcl::Window::Show().

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 553 of file svapp.cxx.

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

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 547 of file svapp.cxx.

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

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 558 of file svapp.cxx.

References ImplGetSVData().

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 530 of file svapp.cxx.

References ImplGetSVData(), and ImplSVData::mnMainThreadId.

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

bool Application::IsSafeModeEnabled ( )
static

Determines if safe mode is enabled.

Definition at line 1535 of file svapp.cxx.

References bSafeMode.

Referenced by OpenGLHelper::isVCLOpenGLEnabled().

bool Application::IsUICaptured ( )
static
bool Application::IsUnifiedDisplay ( )
static

Determines if the screens that make up a display are separate or form one large display area.

Returns
true when screens form up one large display area windows can be moved between single screens (e.g. Xserver with Xinerama, Windows) and false when different screens are separate and windows cannot be moved between them (e.g. Xserver with multiple screens)
See also
GetBestScreen, GetDisplayBuiltInScreen

Definition at line 1192 of file svapp.cxx.

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

Referenced by GetBestScreen(), FloatingWindow::ImplCalcPos(), PopupMenu::ImplExecute(), and SystemWindow::ImplMoveToScreen().

bool Application::LoadBrandBitmap ( const char *  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 50 of file brand.cxx.

References LanguageTag::getFallbackStrings().

void Application::LockFontUpdates ( bool  bLock)
static

Lock font updates for all output devices.

Remarks
When performing operations that might involve multiple registration of fonts, such as opening/closing documents with multiple embedded fonts, then each font addition/removal might cause an event that initiates a rebuild of each OutputDevice's font lists.

Locking font updates disables processing such events, and unlocking causes a single such processing for all OutputDevices.

Definition at line 1041 of file svapp.cxx.

References OutputDevice::LockFontUpdates().

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;

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

Reimplemented in UIPreviewApp.

Definition at line 172 of file svapp.cxx.

References SAL_WARN.

Referenced by ImplSVMain().

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 593 of file svapp.cxx.

References ImplGetDefaultWindow(), ImplGetSVData(), vcl::Window::ImplUpdateGlobalSettings(), ImplSVData::maAppData, ImplSVData::maWinData, ImplSVAppData::mbSettingsInit, ImplSVWinData::mpFirstFrame, and ImplSVAppData::mpSettings.

Referenced by ImplHandleSalSettings().

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 733 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::maWinData, ImplSVWinData::mpFirstFrame, vcl::Window::mpWindowImpl, and vcl::Window::NotifyAllChildren().

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

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 589 of file svapp.cxx.

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

ImplSVEvent * Application::PostGestureEvent ( VclEventId  nEvent,
vcl::Window pWin,
GestureEvent const *  pGestureEvent 
)
static
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 815 of file svapp.cxx.

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

ImplSVEvent * Application::PostMouseEvent ( VclEventId  nEvent,
vcl::Window pWin,
MouseEvent const *  pMouseEvent 
)
static
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 998 of file svapp.cxx.

References ImplGetDefaultWindow(), vcl::Window::ImplGetFrame(), and SalFrame::PostEvent().

Referenced by EndAllDialogs(), EndAllPopups(), EndYield(), vcl::SolarThreadExecutor::execute(), IMPL_LINK_NOARG(), IMPL_STATIC_LINK_NOARG(), FloatingWindow::ImplCallPopupModeEnd(), vcl::Window::ImplGenerateMouseMove(), ImplHandleClose(), ImplHandleGetFocus(), ImplHandleLoseFocus(), ImplHandleMouseEvent(), Menu::ImplSelect(), ImplSysChildProc(), ImplDockFloatWin2::Move(), ImplDockFloatWin::Move(), SvImpLBox::NotifyTabsChanged(), SvImpLBox::Paint(), vcl::EventPoster::Post(), PostGestureEvent(), PostKeyEvent(), PostMouseEvent(), Printer::PrintJob(), Quit(), and SvxIconChoiceCtrl_Impl::Resize().

bool Application::QueryExit ( )
virtual

Exit from the application.

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

Definition at line 178 of file svapp.cxx.

References WorkWindow::Close(), ImplGetSVData(), ImplSVData::maWinData, and ImplSVWinData::mpAppWin.

Referenced by IMPL_STATIC_LINK_NOARG().

void Application::Quit ( )
static
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 535 of file svapp.cxx.

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

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

Remove accelerator.

Parameters
pAccelPointer to Accelerator object to remove
See also
InsertAccel

Definition at line 1299 of file svapp.cxx.

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

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

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 772 of file svapp.cxx.

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

Referenced by SalInstanceWidget::~SalInstanceWidget().

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 784 of file svapp.cxx.

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

Referenced by SalInstanceWidget::~SalInstanceWidget().

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 975 of file svapp.cxx.

References ImplGetSVData(), and RemoveUserEvent().

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

void Application::RemoveUserEvent ( ImplSVEvent nUserEvent)
static
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 458 of file svapp.cxx.

References ImplYield().

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

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.

void Application::setDeInitHook ( Link< LinkParamNone *, void > const &  hook)
static
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 1395 of file svapp.cxx.

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

Referenced by EnableHeadlessMode().

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 1169 of file svapp.cxx.

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

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 1481 of file svapp.cxx.

References ImplGetSVData(), ImplSVData::maGDIData, ImplSVGDIData::mpGrfConverter, and GraphicConverter::SetFilterHdl().

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 1307 of file svapp.cxx.

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

void Application::SetSettings ( const AllSettings rSettings)
static
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 1405 of file svapp.cxx.

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

Referenced by VCLExceptionSignal_impl().

void Application::ShowImeStatusWindow ( bool  bShow)
static

Toggle any IME status window on and off.

This only works if CanToggleImeStatusWindow returns true (otherwise, any calls of this method are ignored).

Remarks
Can be called without the Solar mutex locked.
Parameters
bShowIf true, then show the IME status window
See also
GetShowImeStatusWindowDefault, CanToggleImeStatusWindow, GetShowImeStatusWindow

Definition at line 1564 of file svapp.cxx.

References SalInstance::CreateI18NImeStatus(), ImplSVAppData::ImeStatusWindowMode_HIDE, ImplSVAppData::ImeStatusWindowMode_SHOW, ImplGetSVData(), ImplSVData::maAppData, ImplSVAppData::meShowImeStatusWindow, ImplSVData::mpDefInst, and ImplSVData::mpImeStatus.

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

Update main thread identifier.

Definition at line 1312 of file svapp.cxx.

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

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 509 of file svapp.cxx.

References ImplYield().

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


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