Branch libreoffice-5-0-4
[LibreOffice.git] / include / vcl / svapp.hxx
blob78f758c6058f1dbfbf55f82ffdfb2b01db0c2b4a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_VCL_SVAPP_HXX
21 #define INCLUDED_VCL_SVAPP_HXX
23 #include <sal/config.h>
24 #include <sal/types.h>
26 #include <cassert>
27 #include <stdexcept>
28 #include <vector>
30 #include <comphelper/solarmutex.hxx>
31 #include <rtl/ustring.hxx>
32 #include <osl/thread.hxx>
33 #include <tools/gen.hxx>
34 #include <tools/link.hxx>
35 #include <tools/solar.h>
36 #include <vcl/dllapi.h>
37 #include <vcl/apptypes.hxx>
38 #include <vcl/keycod.hxx>
39 #include <vcl/vclevent.hxx>
40 #include <vcl/metric.hxx>
41 #include <unotools/localedatawrapper.hxx>
42 #include <o3tl/typed_flags_set.hxx>
44 class BitmapEx;
45 class AllSettings;
46 class DataChangedEvent;
47 class Accelerator;
48 class Help;
49 class OutputDevice;
50 namespace vcl { class Window; }
51 class WorkWindow;
52 class MenuBar;
53 class UnoWrapperBase;
54 class Reflection;
55 class NotifyEvent;
56 class KeyEvent;
57 class MouseEvent;
58 class ZoomEvent;
59 class ScrollEvent;
60 struct ImplSVEvent;
62 #include <com/sun/star/uno/Reference.h>
63 #include <com/sun/star/connection/XConnection.hpp>
65 namespace com {
66 namespace sun {
67 namespace star {
68 namespace uno {
69 class XComponentContext;
71 namespace ui {
72 namespace dialogs {
73 class XFilePicker2;
74 class XFolderPicker2;
77 namespace awt {
78 class XToolkit;
79 class XDisplayConnection;
81 } } }
83 // helper needed by SalLayout implementations as well as svx/source/dialog/svxbmpnumbalueset.cxx
84 VCL_DLLPUBLIC sal_UCS4 GetMirroredChar( sal_UCS4 );
85 VCL_DLLPUBLIC sal_UCS4 GetLocalizedChar( sal_UCS4, LanguageType );
87 enum class SystemWindowFlags {
88 NOAUTOMODE = 0x0001,
89 DIALOG = 0x0002
91 namespace o3tl
93 template<> struct typed_flags<SystemWindowFlags> : is_typed_flags<SystemWindowFlags, 0x03> {};
96 typedef long (*VCLEventHookProc)( NotifyEvent& rEvt, void* pData );
98 /** An application can be notified of a number of different events:
99 - TYPE_ACCEPT - listen for connection to the application (a connection
100 string is passed via the event)
101 - TYPE_UNACCEPT - stops listening for a connection to the app (determined by
102 a connection string passed via the event)
103 - TYPE_APPEAR - brings the app to the front (i.e. makes it "appear")
104 - TYPE_VERSION - display the app version
105 - TYPE_HELP - opens a help topic (help topic passed as string)
106 - TYPE_OPENHELP_URL - opens a help URL (URL passed as a string)
107 - TYPE_SHOWDIALOG - shows a dialog (dialog passed as a string)
108 - TYPE_OPEN - opens a document or group of documents (documents passed
109 as an array of strings)
110 - TYPE_PRINT - print a document or group of documents (documents passed
111 as an array of strings
112 - TYPE_PRIVATE_DOSHUTDOWN - shutdown the app
115 class VCL_DLLPUBLIC ApplicationEvent
117 public:
118 enum Type {
119 TYPE_ACCEPT, ///< Listen for connections
120 TYPE_APPEAR, ///< Make application appear
121 TYPE_HELP, ///< Bring up help options (command-line help)
122 TYPE_VERSION, ///< Display product version
123 TYPE_OPEN, ///< Open a document
124 TYPE_OPENHELPURL, ///< Open a help URL
125 TYPE_PRINT, ///< Print document
126 TYPE_PRIVATE_DOSHUTDOWN, ///< Shutdown application
127 TYPE_QUICKSTART, ///< Start QuickStart
128 TYPE_SHOWDIALOG, ///< Show a dialog
129 TYPE_UNACCEPT ///< Stop listening for connections
132 /** Explicit constructor for ApplicationEvent.
134 @attention TYPE_APPEAR, TYPE_VERSION, TYPE_PRIVATE_DOSHUTDOWN and
135 TYPE_QUICKSTART are the \em only events that don't need to include
136 a data string with the event. No other events should use this
137 constructor!
139 explicit ApplicationEvent(Type type): aEvent(type)
141 assert(
142 type == TYPE_APPEAR || type == TYPE_VERSION
143 || type == TYPE_PRIVATE_DOSHUTDOWN || type == TYPE_QUICKSTART);
146 /** Constructor for ApplicationEvent, accepts a string for the data
147 associated with the event.
149 @attention TYPE_ACCEPT, TYPE_HELP, TYPE_OPENHELPURL, TYPE_SHOWDIALOG
150 and TYPE_UNACCEPT are the \em only events that accept a single
151 string as event data. No other events should use this constructor!
153 ApplicationEvent(Type type, OUString const & data): aEvent(type)
155 assert(
156 type == TYPE_ACCEPT || type == TYPE_HELP || type == TYPE_OPENHELPURL
157 || type == TYPE_SHOWDIALOG || type == TYPE_UNACCEPT);
158 aData.push_back(data);
161 /** Constructor for ApplicationEvnet, accepts an array of strings for
162 the data associated with the event.
164 @attention TYPE_OPEN and TYPE_PRINT can apply to multiple documents,
165 and are the \em only events that accept an array of strings. No other
166 events should use this constructor.
168 ApplicationEvent(Type type, std::vector<OUString> const & data):
169 aEvent(type), aData(data)
171 assert(type == TYPE_OPEN || type == TYPE_PRINT);
174 /** Get the type of event.
176 @returns The type of event.
178 Type GetEvent() const
180 return aEvent;
183 /** Gets the application event's data string.
185 @attention The \em only events that need a single string TYPE_ACCEPT,
186 TYPE_HELP, TYPE_OPENHELPURL, TYPE_SHOWDIALOG and TYPE_UNACCEPT
188 @returns The event's data string.
190 OUString GetStringData() const
192 assert(
193 aEvent == TYPE_ACCEPT || aEvent == TYPE_HELP
194 || aEvent == TYPE_OPENHELPURL || aEvent == TYPE_SHOWDIALOG
195 || aEvent == TYPE_UNACCEPT);
196 assert(aData.size() == 1);
197 return aData[0];
200 /** Gets the event's array of strings.
202 @attention The \em only events that need an array of strings
203 are TYPE_OPEN and TYPE_PRINT.
205 std::vector<OUString> const & GetStringsData() const
207 assert(aEvent == TYPE_OPEN || aEvent == TYPE_PRINT);
208 return aData;
211 private:
212 Type aEvent;
213 std::vector<OUString> aData;
217 @brief Base class used mainly for the LibreOffice Desktop class.
219 The Application class is a base class mainly used by the Desktop
220 class. It is really meant to be subclassed, and the Main() function
221 should be overridden. Many of the ImplSVData members should be
222 moved to this class.
224 The reason Application exists is because the VCL used to be a
225 standalone framework, long since abandoned by anything other than
226 our application.
228 @see Desktop, ImplSVData
230 class VCL_DLLPUBLIC Application
232 public:
233 enum DialogCancelMode {
234 DIALOG_CANCEL_OFF, ///< do not automatically cancel dialogs
235 DIALOG_CANCEL_SILENT, ///< silently cancel any dialogs
236 DIALOG_CANCEL_FATAL ///< cancel any dialogs by std::abort
239 /** @name Initialization
240 The following functions perform initialization and deinitialization
241 of the application.
243 ///@{
245 /** Default constructor for Application class.
247 Initializes the LibreOffice global instance data structure if needed,
248 and then sets itself to be the Application class. Also initializes any
249 platform specific data structures.
251 @attention The initialization of the application itself is done in Init()
253 @see InitSalData is implemented by platform specific code.
255 Application();
257 /** Virtual destructor for Application class.
259 Deinitializes the LibreOffice global instance data structure, then
260 deinitializes any platform specific data structures.
262 @see ImplDeInitSVData deinitializes the global instance data,
263 DeInitSalData is implemented by platform specific code
265 virtual ~Application();
267 /** Initialize the application itself.
269 @attention Note that the global data structures and platform specific
270 initialization is done in the constructor.
272 @see InitFinished, DeInit
274 virtual void Init();
276 /** Finish initialization of the application.
278 @see Init, DeInit
280 virtual void InitFinished();
282 /** Deinitialized the application itself.
284 @attention Note that the global data structures and platform specific
285 deinitialization is done in the destructor.
287 @see Init, InitFinished
289 virtual void DeInit();
291 ///@}
293 /** @brief Pure virtual entrypoint to the application.
295 Main() is the pure virtual entrypoint to your application. You
296 inherit your class from Application and subclass this function to
297 implement an application.
299 The Main() function does not pass in command line parameters,
300 you must use the functions GetCommandLineParamCount() and
301 GetCommandLineParam() to get these values as these are platform
302 independent ways of getting the command line (use GetAppFileName()
303 to get the invoked executable filename).
305 Once in this function, you create windows, etc. then call on
306 Execute() to start the application's main event loop.
308 An example code snippet follows (it won't compile, this just gives the
309 general flavour of the framework and is adapted from an old HelloWorld
310 example program that Star Division used to provide as part of their
311 library).
313 \code{.cpp}
314 class TheApplication : public Application
316 public:
317 virtual void Main();
320 class TheWindow : public WorkWindow
322 public:
323 TheWindow(vcl::Window *parent, WinBits windowStyle) :
324 WorkWindow(parent, windowStyle) {}
326 virtual void Paint(const Rectangle &);
329 void TheWindow::Paint(const Rectangle&)
331 DrawText(Point(100,100), String("Hello World!"));
334 void TheApplication::Main()
336 TheWindow aWindow(NULL, WB_APP | WB_STDWORK);
337 aWindow.Show();
338 Execute();
341 TheApplication anApplication;
342 \endcode
344 Some examples in the source tree can be found here:
346 vcl/workben/svdem.cxx
348 This is an example of how to use the Application and WorkWindow. Unfortunately, it
349 no longer compiles.
351 vcl/fpicker/test/svdem.cxx
353 virtual int Main();
355 /** Exit from the application
357 @returns true if exited successfully, false if not able to fully exit
359 virtual bool QueryExit();
361 /** @name Change Notification Functions
363 Functions that notify when changes occur in the application.
365 ///@{
367 /** Notify all windows that the application has changed data.
369 @param rDCEvt Reference to a DataChangedEvent object
371 @see DataChanged
373 static void NotifyAllWindows( DataChangedEvent& rDCEvt );
375 ///@}
377 /** @name Command Line Processing
379 Command line processing is done via the following functions. They
380 give the number of parameters, the parameters themselves and a way
381 to get the name of the invoking application.
384 ///@{
386 /** Gets the number of command line parameters passed to the application
388 @return sal_uInt16 - the number of parameters
390 @see GetCommandLineParam, GetAppFileName
392 static sal_uInt16 GetCommandLineParamCount();
394 /** Gets a particular command line parameter
396 @param nParam The index of the parameter to return.
398 @return The command line parameter as an OUString
400 @see GetCommandLineParamCount, GetAppFileName
402 static OUString GetCommandLineParam( sal_uInt16 nParam );
404 /** Get the name of the file used to start the application
406 @return The filename as an OUString
408 @see GetCommandLineParamCount, GetCommandLineParam
410 static OUString GetAppFileName();
412 ///@}
414 /** @name Error Handling
416 \em Very rudimentary error handling is done by these
417 functions.
422 /** Handles an error code.
424 @remark This is not actually an exception. It merely takes an
425 error code, then in most cases aborts. The list of exception
426 identifiers can be found at include/vcl/apptypes.hxx - each
427 one starts with EXC_*
429 @param nError The error code identifier
431 @returns sal_uInt16 value - if it is 0, then the error wasn't handled.
433 @see Abort
435 virtual sal_uInt16 Exception( sal_uInt16 nError );
437 /** Ends the program prematurely with an error message.
439 If the \code --norestore \endcode command line argument is given (assuming
440 this process is run by developers who are interested in cores,
441 vs. end users who are not) then it does a coredump.
443 @param rErrorText The error message to report.
445 @see Exception
447 static void Abort( const OUString& rErrorText );
449 ///@}
451 /** @name Event Loop Functions
453 Functions that handle the LibreOffice main event loop are here,
454 including a global lock called the Solar Mutex.
456 ///@{
458 /** Run the main event processing loop until it is quit by Quit().
460 @see Quit, Reschedule, Yield, EndYield, GetSolarMutex,
461 GetMainThreadIdentifier, ReleaseSolarMutex, AcquireSolarMutex,
462 EnableNoYieldMode, DisableNoYieldMode, AddPostYieldListener,
463 RemovePostYieldListener
465 static void Execute();
467 /** Quit the program
469 @see Execute, Reschedule, Yield, EndYield, GetSolarMutex,
470 GetMainThreadIdentifier, ReleaseSolarMutex, AcquireSolarMutex,
471 EnableNoYieldMode, DisableNoYieldMode, AddPostYieldListener,
472 RemovePostYieldListener
474 static void Quit();
476 /** Attempt to reschedule in processing of current event(s)
478 @param bAllEvents If set to true, then try to process all the
479 events. If set to false, then only process the current
480 event. Defaults to false.
482 @see Execute, Quit, Yield, EndYield, GetSolarMutex,
483 GetMainThreadIdentifier, ReleaseSolarMutex, AcquireSolarMutex,
484 EnableNoYieldMode, DisableNoYieldMode, AddPostYieldListener,
485 RemovePostYieldListener
487 static void Reschedule( bool bAllEvents = false );
489 /** Allow processing of the next event.
491 @see Execute, Quit, Reschedule, EndYield, GetSolarMutex,
492 GetMainThreadIdentifier, ReleaseSolarMutex, AcquireSolarMutex,
493 EnableNoYieldMode, DisableNoYieldMode, AddPostYieldListener,
494 RemovePostYieldListener
496 static void Yield();
500 @see Execute, Quit, Reschedule, Yield, GetSolarMutex,
501 GetMainThreadIdentifier, ReleaseSolarMutex, AcquireSolarMutex,
502 EnableNoYieldMode, DisableNoYieldMode, AddPostYieldListener,
503 RemovePostYieldListener
505 static void EndYield();
507 /** @brief Get the Solar Mutex for this thread.
509 Get the Solar Mutex that prevents other threads from accessing VCL
510 concurrently.
512 @returns SolarMutex reference
514 @see Execute, Quit, Reschedule, Yield, EndYield,
515 GetMainThreadIdentifier, ReleaseSolarMutex, AcquireSolarMutex,
516 EnableNoYieldMode, DisableNoYieldMode, AddPostYieldListener,
517 RemovePostYieldListener
519 static comphelper::SolarMutex& GetSolarMutex();
521 /** Get the main thread ID.
523 @returns oslThreadIdentifier that contains the thread ID
525 @see Execute, Quit, Reschedule, Yield, EndYield, GetSolarMutex,
526 ReleaseSolarMutex, AcquireSolarMutex,
527 EnableNoYieldMode, DisableNoYieldMode, AddPostYieldListener,
528 RemovePostYieldListener
530 static oslThreadIdentifier GetMainThreadIdentifier();
532 /** @brief Release Solar Mutex(es) for this thread
534 Release the Solar Mutex(es) that prevents other threads from accessing
535 VCL concurrently.
537 @returns The number of mutexes that were acquired by this thread.
539 @see Execute, Quit, Reschedule, Yield, EndYield, GetSolarMutex,
540 GetMainThreadIdentifier, AcquireSolarMutex,
541 EnableNoYieldMode, DisableNoYieldMode, AddPostYieldListener,
542 RemovePostYieldListener
544 static sal_uLong ReleaseSolarMutex();
546 /** @brief Acquire Solar Mutex(es) for this thread.
548 Acquire the Solar Mutex(es) that prevents other threads from accessing
549 VCL concurrently.
551 @see Execute, Quit, Reschedule, Yield, EndYield, GetSolarMutex,
552 GetMainThreadIdentifier, ReleaseSolarMutex,
553 EnableNoYieldMode, DisableNoYieldMode, AddPostYieldListener,
554 RemovePostYieldListener
556 static void AcquireSolarMutex( sal_uLong nCount );
558 /** @brief Enables "no yield" mode
560 "No yield" mode prevents Yield() from waiting for events.
562 @remarks This was originally implemented in OOo bug 98792 to improve
563 Impress slideshows.
565 @see DisableNoYieldMode, Execute, Quit, Reschedule, Yield, EndYield, GetSolarMutex,
566 GetMainThreadIdentifier, ReleaseSolarMutex, AcquireSolarMutex,
567 DisableNoYield, AddPostYieldListener, RemovePostYieldListener
569 static void EnableNoYieldMode();
571 /** @brief Disables "no yield" mode
573 "No yield" mode prevents Yield() from waiting for events.
575 @remarks This was originally implemented in OOo bug 98792 to improve
576 Impress slideshows.
578 @see EnableNoYieldMode, Execute, Quit, Reschedule, Yield, EndYield, GetSolarMutex,
579 GetMainThreadIdentifier, ReleaseSolarMutex, AcquireSolarMutex,
580 EnableNoYield, AddPostYieldListener, RemovePostYieldListener
583 static void DisableNoYieldMode();
585 /** Add a listener for yield events
587 @param i_rListener Listener to add
589 @see Execute, Quit, Reschedule, Yield, EndYield, GetSolarMutex,
590 GetMainThreadIdentifier, ReleaseSolarMutex, AcquireSolarMutex,
591 EnableNoYieldMode, DisableNoYieldMode, RemovePostYieldListener
593 static void AddPostYieldListener( const Link<>& i_rListener );
595 /** Remove listener for yield events
597 @param i_rListener Listener to remove
599 @see Execute, Quit, Reschedule, Yield, EndYield, GetSolarMutex,
600 GetMainThreadIdentifier, ReleaseSolarMutex, AcquireSolarMutex,
601 AddPostYieldListener, EnableNoYieldMode, DisableNoYieldMode
603 static void RemovePostYieldListener( const Link<>& i_rListener );
606 /** Queries whether the application is in "main", i.e. not yet in
607 the event loop
609 @returns true if in main, false if not in main
611 @see IsInExecute, IsInModalMode
613 static bool IsInMain();
615 /** Queries whether the application is in the event loop
617 @returns true if in the event loop, false if not
619 @see IsInMain, IsInModalMode
621 static bool IsInExecute();
623 /** Queries whether application has a modal dialog active.
625 @returns true if a modal dialog is active, false if not
627 @see IsInMain, IsInExecute
629 static bool IsInModalMode();
631 /** Return how many events are being dispatched.
633 @returns the number of events currently being dispatched
635 static sal_uInt16 GetDispatchLevel();
637 /** Determine if there are any pending input events.
639 @param nType input identifier, defined in include/vcl/apptypes.hxx
640 The default is VCL_INPUT_ANY.
642 @returns true if there are pending events, false if not.
644 @see GetLastInputInterval
646 static bool AnyInput( VclInputFlags nType = VCL_INPUT_ANY );
648 /** The interval from the last time that input was received.
650 @returns system ticks - last input time
652 @see AnyInput
654 static sal_uInt64 GetLastInputInterval();
656 ///@}
658 /* Determines if the UI is captured.
660 The UI is considered captured if a system dialog is open (e.g. printer setup),
661 a floating window, menu or toolbox dropdown is open, or a window has been
662 captured by the mouse.
664 @returns true if UI is captured, false if not
666 static bool IsUICaptured();
668 /** @name Settings
670 The following functions set system settings (e.g. tab color, etc.). There are functions
671 that set settings objects, and functions that set and get the actual system settings for
672 the application.
674 ///@{
676 /** Sets user settings in settings object to override system settings
678 The system settings that can be overridden are:
679 - window dragging options (on or off, including live scrolling!)
680 - style settings (e.g. checkbox color, border color, 3D colors,
681 button rollover colors, etc.)
682 - mouse settings
683 - menu options, including the mouse follows the menu and whether menu
684 icons are used
686 @param rSettings Reference to the settings object to change.
688 @see MergeSystemSettings, SetSettings, GetSettings
690 virtual void OverrideSystemSettings( AllSettings& rSettings );
692 /** Set the settings object to the platform/desktop environment system
693 settings.
695 @param rSettings Reference to the settings object to change.
697 @see OverrideSystemSettings, SetSettings, GetSettings
699 static void MergeSystemSettings( AllSettings& rSettings );
701 /** Sets the application's settings and notifies all windows of the
702 change.
704 @param rSettings const reference to settings object used to
705 change the application's settings.
707 @see OverrideSystemSettings, MergeSystemSettings, GetSettings
709 static void SetSettings( const AllSettings& rSettings );
711 /** Gets the application's settings. If the application hasn't initialized
712 it's settings, then it does so (lazy initialization).
714 @returns AllSettings instance that contains the current settings of the
715 application.
717 @see OverrideSystemSettings, MergeSystemSettings, SetSettings
719 static const AllSettings& GetSettings();
721 /** Get the application's locale data wrapper.
723 @returns reference to a LocaleDataWrapper object
725 static const LocaleDataWrapper& GetAppLocaleDataWrapper();
727 ///@}
729 /** @name Event Listeners/Handlers
731 A set of event listeners and callers. Note that in this code there is
732 platform specific functions - namely for zoom and scroll events.
734 ///@{
737 /** Call on all event hooks
739 @param rEvt Reference to the notification event to send
740 to the event hook.
742 @return If any of the event hooks called upon fail with a non-zero
743 status, then it stops processing any more event hooks and returns
744 the error code as a long.
747 static long CallEventHooks( NotifyEvent& rEvt );
749 /** Add a VCL event listener to the application. If no event listener exists,
750 then initialize the application's event listener with a new one, then add
751 the event listener.
753 @param rEventListener Const reference to the event listener to add.
755 @see RemoveEventListener, AddKeyListener, RemoveKeyListener
757 static void AddEventListener( const Link<>& rEventListener );
759 /** Remove a VCL event listener from the application.
761 @param rEventListener Const refernece to the event listener to be removed
763 @see AddEventListener, AddKeyListener, RemoveKeyListener
765 static void RemoveEventListener( const Link<>& rEventListener );
767 /** Add a keypress listener to the application. If keypress listener exists,
768 then initialize the application's keypress event listener with a new one, then
769 add the keypress listener.
771 @param rKeyListener Const reference to the keypress event listener to add
773 @see AddEventListener, RemoveEventListener, RemoveKeyListener
775 static void AddKeyListener( const Link<>& rKeyListener );
777 /** Remove a keypress listener from the application.
779 @param rKeyListener Const reference to the keypress event listener to be removed
781 @see AddEventListener, RemoveEventListener, AddKeyListener
783 static void RemoveKeyListener( const Link<>& rKeyListener );
785 /** Send event to all VCL application event listeners
787 @param nEvent Event ID
788 @param pWin Pointer to window to send event
789 @param pData Pointer to data to send with event
791 @see ImplCallEventListeners(VclSimpleEvent* pEvent)
793 static void ImplCallEventListeners( sal_uLong nEvent, vcl::Window* pWin, void* pData );
795 /** Send event to all VCL application event listeners
797 @param pEvent Pointer to VclSimpleEvent
799 @see ImplCallEventListeners(sal_uLong nEvent, Windows* pWin, void* pData);
801 static void ImplCallEventListeners( VclSimpleEvent* pEvent );
803 /** Handle keypress event
805 @param nEvent Event ID for keypress
806 @param pWin Pointer to window that receives the event
807 @param pKeyEvent Received key event
809 @see PostKeyEvent
811 static bool HandleKey( sal_uLong nEvent, vcl::Window *pWin, KeyEvent* pKeyEvent );
813 /** Send keypress event
815 @param nEvent Event ID for keypress
816 @param pWin Pointer to window to which the event is sent
817 @param pKeyEvent Key event to send
819 @see HandleKey
821 static ImplSVEvent * PostKeyEvent( sal_uLong nEvent, vcl::Window *pWin, KeyEvent* pKeyEvent );
823 /** Send mouse event
825 @param nEvent Event ID for mouse event
826 @param pWin Pointer to window to which the event is sent
827 @param pKeyEvent Mouse event to send
829 static ImplSVEvent * PostMouseEvent( sal_uLong nEvent, vcl::Window *pWin, MouseEvent* pMouseEvent );
831 /** Send zoom event
833 Experimental work in progress. Available only for iOS and Android, and unclear whether actually
834 is needed now with tiled rendering.
836 @param nEvent Event ID for zoom event
837 @param pWin Pointer to window to which the event is sent
838 @param pZoomEvent Zoom event to send
840 static ImplSVEvent * PostZoomEvent( sal_uLong nEvent, vcl::Window *pWin, ZoomEvent* pZoomEvent );
842 /* Send scroll event
844 Experimental work in progress. Available only for iOS and Android, and unclear whether actually
845 is needed now with tiled rendering.
847 @param nEvent Event ID for scroll event
848 @param pWin Pointer to window to which the event is sent
849 @param pScrollEvent Scroll event to send
851 static ImplSVEvent * PostScrollEvent( sal_uLong nEvent, vcl::Window *pWin, ScrollEvent* pScrollEvent );
853 /** Remove mouse and keypress events from a window... any also zoom and scroll events
854 if the platform supports it.
856 @param pWin Window to remove events from
858 @see HandleKey, PostKeyEvent, PostMouseEvent, PostZoomEvent, PostScrollEvent
860 static void RemoveMouseAndKeyEvents( vcl::Window *pWin );
862 /** Post a user event to the default window.
864 User events allow for the deferral of work to later in the main-loop - at idle.
866 @param rLink Link to event callback function
867 @param pCaller Pointer to data sent to the event by the caller. Optional.
868 @param bReferenceLink If true - hold a VclPtr<> reference on the Link's instance.
870 @return the event ID used to post the event.
872 static ImplSVEvent * PostUserEvent( const Link<>& rLink, void* pCaller = NULL,
873 bool bReferenceLink = false );
875 /** Remove user event based on event ID
877 @param nUserEvent User event to remove
879 static void RemoveUserEvent( ImplSVEvent * nUserEvent );
881 /** Insert an idle handler into the application.
883 If the idle event manager doesn't exist, then initialize it.
885 @param rLink const reference to the idle handler
886 @param nPrio The priority of the idle handler - idle handlers of a higher
887 priority will be processed before this handler.
889 @return true if the handler was inserted successfully, false if it couldn't be inserted.
891 static bool InsertIdleHdl( const Link<>& rLink, sal_uInt16 nPriority );
893 /** Remove an idle handler from the application.
895 @param rLink const reference to the idle handler to remove
897 static void RemoveIdleHdl( const Link<>& rLink );
899 /*** Get the DisplayConnection.
901 It is a reference to XDisplayConnection, which allows toolkits to send display
902 events to the application.
904 @returns UNO reference to an object that implements the css:awt:XDisplayConnection
905 interface.
907 static css::uno::Reference< css::awt::XDisplayConnection > GetDisplayConnection();
909 /** @deprecated AppEvent is used only in the Desktop class now. However, it is
910 intended to notify the application that an event has occurred. It was in oldsv.cxx,
911 but is still needed by a number of functions.
913 @param rAppEvent const reference to ApplicationEvent event
915 virtual void AppEvent( const ApplicationEvent& rAppEvent );
917 ///@}
919 /** @name Application Window Functions
921 Functions that deal with the application's windows
923 ///@{
925 /** Get the main application window.
927 @remark the main application window (or App window) has a style of WB_APP,
928 there can only be on WorkWindow with this style, if a dialog or floating
929 window cannot find a parent, then the parent becomes the app window.
931 It also becomes the "default window", is used for help, is a fallback if
932 the application has no name, and a number of other things.
934 returns Pointer to main application window.
936 @see GetFocusWindow, GetDefaultDevice
938 static WorkWindow* GetAppWindow();
940 /** Get the currently focussed window.
942 @returns Pointer to focused window.
944 @see GetAppWindow, GetDefaultDevice
946 static vcl::Window* GetFocusWindow();
948 /** Get the default "device" (in this case the default window).
950 @returns Pointer to an OutputDevice. However, it is a Window object -
951 Window class subclasses OutputDevice.
953 @see GetAppWindow, GetFocusWindow
955 static OutputDevice* GetDefaultDevice();
957 /** Get the first top-level window of the application.
959 @returns Pointer to top-level window (a Window object)
961 @see GetNextTopLevelWindow, GetTopWindowCount, GetTopWindow,
962 GetActiveTopWindow
964 static vcl::Window* GetFirstTopLevelWindow();
966 /** Get the next top level window.
968 @param pWindow Pointer to Window object you wish to get the next
969 window from.
971 @returns Pointer to next top window.
973 static vcl::Window* GetNextTopLevelWindow( vcl::Window* pWindow );
975 /** Return the number of top-level windows being used by the application
977 @returns the number of top-level windows
979 @see GetFirstTopLevelWindow, GetNextTopLevelWindow, GetTopWindow,
980 GetActiveTopWindow
983 static long GetTopWindowCount();
985 /** Get the nth top window.
987 @remark Top windows are actually implemented in a one-way linked list.
988 This iterates through top level windows n times.
990 @param nIndex The index of the top-level window
992 @returns The nth top-level window of the application
994 @see GetFirstTopLevelWindow, GetNextTopLevelWindow, GetTopWindowCount,
995 GetActiveTopWindow
997 static vcl::Window* GetTopWindow( long nIndex );
999 /** Get the "active" top window.
1001 An "active" top window is one that has a child window that has the
1002 application's focus.
1004 @returns the active top window
1006 @see GetFirstTopLevelWindow, GetNextTopLevelWindow, GetTopWindowCount,
1007 GetTopWindow
1009 static vcl::Window* GetActiveTopWindow();
1011 ///@}
1013 /** Set the application's name.
1015 @param rUniqueName What to set the application name to
1017 @see GetAppName
1019 static void SetAppName( const OUString& rUniqueName );
1022 /** @name Application Name, Branding
1024 ///@{
1026 /** Get the application's name.
1028 @returns The application name.
1030 static OUString GetAppName();
1032 /** Load a localized branding PNG file as a bitmap.
1034 @param pName Name of the bitmap to load.
1035 @param rBitmap Reference to BitmapEx object to load PNG into
1037 @returns true if the PNG could be loaded, otherwise returns false.
1039 static bool LoadBrandBitmap (const char* pName, BitmapEx &rBitmap);
1041 ///@}
1043 /** @name Display and Screen
1045 ///@{
1047 /** Set the default name of the application for message dialogs and printing.
1049 @param rDisplayName const reference to string to set the Display name to.
1051 @see GetDisplayName
1053 static void SetDisplayName( const OUString& rDisplayName );
1055 /** Get the default name of the application for messag dialogs and printing.
1057 @returns The display name of the application.
1059 static OUString GetDisplayName();
1061 /** Get the number of screens available for the display.
1063 @returns The number of screens available.
1065 @see GetScreenPosSizePixel
1067 static unsigned int GetScreenCount();
1069 /** Get a screen's rectangular area.
1071 @param nScreen The number of the screen requested.
1073 @returns The area of the screen in a Rectangle object.
1075 @see GetScreenCount
1077 static Rectangle GetScreenPosSizePixel( unsigned int nScreen );
1079 /** Determines if the screens that make up a display are separate or
1080 form one large display area.
1082 @returns true when screens form up one large display area windows can be
1083 moved between single screens (e.g. Xserver with Xinerama, Windows)
1084 and false when different screens are separate and windows cannot be moved
1085 between them (e.g. Xserver with multiple screens)
1087 @see GetBestScreen, GetDisplayBuiltInScreen
1089 static bool IsUnifiedDisplay();
1091 /** Get the "best" screen.
1093 @returns If IsUnifiedDisplay() == true the return value will be
1094 nearest screen of the target rectangle.
1096 In case of IsUnifiedDisplay() == false the return value
1097 will always be GetDisplayDefaultScreen().
1099 @see IsUnifiedDisplay, GetDisplayBuiltInScreen
1101 SAL_DLLPRIVATE static unsigned int GetBestScreen( const Rectangle& );
1103 /** Get the built-in screen.
1105 @return
1106 This returns the LCD screen number for a laptop, or the primary
1107 external VGA display for a desktop machine - it is where a presenter
1108 console should be rendered if there are other (non-built-in) screens
1109 present.
1111 @see IsUnifiedDisplay, GetBestScreen
1113 static unsigned int GetDisplayBuiltInScreen();
1115 /** Get the display's external screen.
1117 Practically, this means - Get the screen we should run a presentation on.
1119 @returns 0 or 1 currently, will fallback to the first available screen if
1120 there are more than one external screens. May be changed in the future.
1122 static unsigned int GetDisplayExternalScreen();
1124 ///@}
1126 /** @name Accelerators and Mnemonics
1128 Accelerators allow a user to hold down Ctrl+key (or CMD+key on OS X)
1129 combination to gain quick access to functionality.
1131 Mnemonics are underline letters in things like menus and dialog boxes
1132 that allow a user to type in the letter to activate the menu or option.
1134 ///@{
1136 /** Insert accelerator
1138 @param pAccel Pointer to an Accelerator object to insert
1140 @returns true if successful, false if otherwise
1142 @see RemoveAccel
1144 static bool InsertAccel( Accelerator* pAccel );
1146 /** Remove accelerator
1148 @param pAccel Pointer to Accelerator object to remove
1150 @see InsertAccel
1152 static void RemoveAccel( Accelerator* pAccel );
1154 /** Enable auto-mnemonics
1156 @param bEnabled True enables auto-mnemonics, and false disables it
1158 @see IsAutoMnemonicEnabled
1160 static void EnableAutoMnemonic( bool bEnabled = true );
1162 /** Determines if auto-mnemonics are enabled.
1164 @returns True if auto-mnemonics is enabled, false if not.
1166 @see EnableAutoMnemonic
1168 static bool IsAutoMnemonicEnabled();
1170 /** Get the number of reserved key codes used by the application.
1172 @returns number of reserved key codes
1174 @see GetReservedKeyCode
1176 static sal_uLong GetReservedKeyCodeCount();
1178 /** Get the reserved key code.
1180 @param i The keycode number to retrieve
1182 @returns Const pointer to a KeyCode object
1184 @see GetReservedKeyCodeCount
1186 static const vcl::KeyCode* GetReservedKeyCode( sal_uLong i );
1188 ///@}
1190 /** @name Application Help
1192 Deals with the help system, and "auto-help", where a user hovers a mouse above
1193 a UI element and a tooltip with an explanation pops up.
1195 ///@{
1197 /** Sets up help
1199 @param pHelp Pointer to a Help object (optional, can by NULL)
1201 @see GetHelp
1203 static void SetHelp( Help* pHelp = NULL );
1205 /** Gets the application's help
1207 @returns Pointer to application's help object. Note that the application may
1208 not have a help object, so it might return NULL.
1210 @see SetHelp
1212 static Help* GetHelp();
1214 /** Turns on "auto-help" (hover mouse above UI element and a tooltip with an
1215 explanation pops up.
1217 @param bEnabled Enables/disables auto-help.
1219 @see EnableAutoHelpId
1221 static void EnableAutoHelpId( bool bEnabled = true );
1223 /** Determines if auto-help is enabled or disabled.
1225 @return true if auto-help is enabled, false if it is disabled.
1227 @see EnableAutoHelpId
1229 static bool IsAutoHelpIdEnabled();
1231 ///@}
1233 /** @name Dialogs
1235 @remark "Dialog cancel mode" tells a headless install whether to
1236 cancel dialogs when they appear. See the DialogCancelMode
1237 enumerator.
1239 ///@{
1241 /** Set the default parent window for dialog boxes.
1243 @param pWindow Pointer to window that should be the default parent.
1245 @remark You can set pWindow to NULL, which means there \em is no default parent.
1247 @see GetDefDialogParent
1249 static void SetDefDialogParent( vcl::Window* pWindow );
1251 /** Get the default parent window for dialog boxes.
1253 @remark GetDefDialogParent does all sorts of things find a useful parent
1254 window for dialogs. If it can't find one (it wasn't set!) then it
1255 first uses the topmost parent of the active window to avoid using
1256 floating windows or other dialog boxes. If there are no active
1257 windows, then it will take a random stab and choose the first visible
1258 top window. Otherwise, it defaults to the desktop.
1260 @returns Pointer to the default window.
1262 static vcl::Window* GetDefDialogParent();
1265 /** Gets the dialog cancel mode for headless environments.
1267 @return DialogCancelMode value
1269 @see SetDialogCancelMode, IsDialogCancelEnabled
1271 static DialogCancelMode GetDialogCancelMode();
1273 /** Sets the dialog cancel mode for headless environments.
1275 @param mode DialogCancel mode value
1277 @see GetDialogCancelMode, IsDialogCancelEnabled
1279 static void SetDialogCancelMode( DialogCancelMode mode );
1281 /** Determines if dialog cancel mode is enabled.
1283 @returns True if dialog cancel mode is enabled, false if disabled.
1285 @see GetDialogCancelMode, SetDialogCancelMode
1287 static bool IsDialogCancelEnabled();
1290 /** Make a dialog box a system window or not.
1292 @param nMode Can be either: SystemWindowFlags::NOAUTOMODE (0x0001) or
1293 SystemWindowFlags::DIALOG (0x0002)
1295 @see GetSystemWindowMode
1297 static void SetSystemWindowMode( SystemWindowFlags nMode );
1299 /** Get the system window mode of dialogs.
1301 @returns SystemWindowFlags::NOAUTOMODE (0x0001) or SystemWindowFlags::DIALOG (0x0002)
1303 @see SetSystemWindowMode
1305 static SystemWindowFlags GetSystemWindowMode();
1308 /** Set a dialog scaling factor. Used for localization.
1310 @param nScale Scaling factor
1312 static void SetDialogScaleX( short nScale );
1314 ///@}
1316 /** @name VCL Toolkit and UNO Wrapper
1318 The VCL Toolkit implements the UNO XToolkit interface, which specifies a
1319 factory interface for the window toolkit. It is similar to the abstract window
1320 toolkit (AWT) in Java.
1323 ///@{
1325 /** Gets the VCL toolkit.
1327 @attention The global service manager has to be created before getting the toolkit!
1329 @returns UNO reference to VCL toolkit
1331 static css::uno::Reference< css::awt::XToolkit > GetVCLToolkit();
1333 /** Get the application's UNO wrapper object.
1335 Note that this static function will only ever try to create UNO wrapper object once, and
1336 if it fails then it will not ever try again, even if the function is called multiple times.
1338 @param bCreateIfNotExists Create the UNO wrapper object if it doesn't exist when true.
1340 @return UNO wrapper object.
1342 static UnoWrapperBase* GetUnoWrapper( bool bCreateIfNotExists = true );
1344 /** Sets the application's UNO Wrapper object.
1346 @param pWrapper Pointer to UNO wrapper object.
1348 static void SetUnoWrapper( UnoWrapperBase* pWrapper );
1350 ///@}
1353 /*** @name Graphic Filters
1355 ///@{
1357 /** Setup a new graphics filter
1359 @param rLink Const reference to a Link object, which the filter calls upon.
1361 @see GetFilterHdl
1363 static void SetFilterHdl( const Link<>& rLink );
1365 /*** Get a new graphics filter
1367 @return Const reference to the Link object (the filter)
1369 static const Link<>& GetFilterHdl();
1371 ///@}
1373 /** @name Headless Mode
1376 /** Enables headless mode.
1378 @param dialogsAreFatal Set to true if a dialog ends the session, false if not.
1380 static void EnableHeadlessMode( bool dialogsAreFatal );
1382 /** Determines if headless mode is enabled
1384 @return True if headless mode is enabled, false if not.
1386 static bool IsHeadlessModeEnabled();
1388 /** Enable Console Only mode
1390 Used to disable Mac specific app init that requires an app bundle.
1392 static void EnableConsoleOnly();
1394 /** Determines if console only mode is enabled.
1396 Used to see if Mac specific app init has been disabled.
1398 @returns True if console only mode is on, false if not.
1400 @see EnableConsoleOnly
1402 static bool IsConsoleOnly();
1404 ///@}
1406 /** @name IME Status Window Control
1408 ///@{
1410 /** Determine application can toggle the IME status window on and off.
1412 @attention Must only be called with the Solar mutex locked.
1414 @return true if any IME status window can be toggled on and off
1415 externally.
1417 @see ShowImeStatusWindow, GetShowImeStatusWindowDefault,
1418 GetShowImeStatusWindowDefault
1420 static bool CanToggleImeStatusWindow();
1422 /** Toggle any IME status window on and off.
1424 This only works if CanToggleImeStatusWindow returns true (otherwise,
1425 any calls of this method are ignored).
1427 @remark Can be called without the Solar mutex locked.
1429 @param bShow If true, then show the IME status window
1431 @see GetShowImeStatusWindowDefault, CanToggleImeStatusWindow,
1432 GetShowImeStatusWindow
1434 static void ShowImeStatusWindow(bool bShow);
1436 /** Determines if the IME status window should be turned of by default.
1438 @return true if any IME status window should be turned on by default
1439 (this decision can be locale dependent, for example).
1441 @see ShowImeStatusWindow, GetShowImeStatusWindowDefault,
1442 CanToggleImeStatusWindow
1444 static bool GetShowImeStatusWindowDefault();
1446 ///@}
1448 /** Get the desktop environment the process is currently running in
1450 @returns String representing the desktop environment
1452 static const OUString& GetDesktopEnvironment();
1454 /*** @name Platform Functionality
1456 ///@{
1458 /** Add a file to the system shells recent document list if there is any.
1459 This function may have no effect under Unix because there is no standard
1460 API among the different desktop managers.
1462 @param rFileUrl The file url of the document.
1464 @param rMimeType The mime content type of the document specified by aFileUrl.
1465 If an empty string will be provided "application/octet-stream"
1466 will be used.
1468 static void AddToRecentDocumentList(const OUString& rFileUrl, const OUString& rMimeType, const OUString& rDocumentService);
1470 /*** Show a native error messagebox
1472 @param sTitle Title of error messagebox
1474 @param sMessage Message displayed in messagebox
1476 static void ShowNativeErrorBox(const OUString& sTitle ,
1477 const OUString& sMessage);
1479 /** Do we have a native / system file selector available?
1481 @returns True if native file selector is available, false otherwise.
1483 static bool hasNativeFileSelection();
1485 /** Create a platform specific file picker, if one is available, otherwise return an
1486 empty reference.
1488 @param rServiceManager Const reference to a UNO component context (service manager).
1490 @returns File picker if available, otherwise an empty reference.
1492 static css::uno::Reference< css::ui::dialogs::XFilePicker2 >
1493 createFilePicker( const css::uno::Reference< css::uno::XComponentContext >& rServiceManager );
1495 /** Create a platform specific folder picker, if one is available, otherwise return an
1496 empty reference
1498 @param rServiceManager Const reference to a UNO component context (service manager).
1500 @returns Folder picker if available, otherwise an empty reference.
1502 static css::uno::Reference< css::ui::dialogs::XFolderPicker2 >
1503 createFolderPicker( const css::uno::Reference< css::uno::XComponentContext >& rServiceManager );
1505 ///@}
1507 // For vclbootstrapprotector:
1508 static void setDeInitHook(Link<> const & hook);
1510 private:
1512 static void InitSettings(ImplSVData* pSVData);
1514 DECL_STATIC_LINK( Application, PostEventHandler, void* );
1518 class VCL_DLLPUBLIC SolarMutexGuard
1520 private:
1521 SolarMutexGuard( const SolarMutexGuard& ) SAL_DELETED_FUNCTION;
1522 const SolarMutexGuard& operator = ( const SolarMutexGuard& ) SAL_DELETED_FUNCTION;
1523 comphelper::SolarMutex& m_solarMutex;
1525 public:
1526 /** Acquires the object specified as parameter.
1528 SolarMutexGuard() :
1529 m_solarMutex(Application::GetSolarMutex())
1531 m_solarMutex.acquire();
1534 /** Releases the mutex or interface. */
1535 ~SolarMutexGuard()
1537 m_solarMutex.release();
1541 class VCL_DLLPUBLIC SolarMutexClearableGuard SAL_FINAL
1543 SolarMutexClearableGuard( const SolarMutexClearableGuard& ) SAL_DELETED_FUNCTION;
1544 const SolarMutexClearableGuard& operator = ( const SolarMutexClearableGuard& ) SAL_DELETED_FUNCTION;
1545 bool m_bCleared;
1546 public:
1547 /** Acquires mutex
1549 SolarMutexClearableGuard()
1550 : m_bCleared(false)
1551 , m_solarMutex( Application::GetSolarMutex() )
1553 m_solarMutex.acquire();
1556 /** Releases mutex. */
1557 ~SolarMutexClearableGuard()
1559 if( !m_bCleared )
1561 m_solarMutex.release();
1565 /** Releases mutex. */
1566 void SAL_CALL clear()
1568 if( !m_bCleared )
1570 m_solarMutex.release();
1571 m_bCleared = true;
1575 protected:
1576 comphelper::SolarMutex& m_solarMutex;
1579 class VCL_DLLPUBLIC SolarMutexResettableGuard SAL_FINAL
1581 SolarMutexResettableGuard( const SolarMutexResettableGuard& ) SAL_DELETED_FUNCTION;
1582 const SolarMutexResettableGuard& operator = ( const SolarMutexResettableGuard& ) SAL_DELETED_FUNCTION;
1583 bool m_bCleared;
1584 public:
1585 /** Acquires mutex
1587 SolarMutexResettableGuard()
1588 : m_bCleared(false)
1589 , m_solarMutex( Application::GetSolarMutex() )
1591 m_solarMutex.acquire();
1594 /** Releases mutex. */
1595 ~SolarMutexResettableGuard()
1597 if( !m_bCleared )
1599 m_solarMutex.release();
1603 /** Releases mutex. */
1604 void SAL_CALL clear()
1606 if( !m_bCleared)
1608 m_solarMutex.release();
1609 m_bCleared = true;
1613 /** Releases mutex. */
1614 void SAL_CALL reset()
1616 if( m_bCleared)
1618 m_solarMutex.acquire();
1619 m_bCleared = false;
1623 protected:
1624 comphelper::SolarMutex& m_solarMutex;
1627 namespace vcl
1630 /** guard class that uses tryToAcquire() and has isAcquired() to check
1632 class SolarMutexTryAndBuyGuard
1634 private:
1635 bool m_isAcquired;
1636 #ifdef DBG_UTIL
1637 bool m_isChecked;
1638 #endif
1639 comphelper::SolarMutex& m_rSolarMutex;
1641 SolarMutexTryAndBuyGuard(const SolarMutexTryAndBuyGuard&) SAL_DELETED_FUNCTION;
1642 SolarMutexTryAndBuyGuard& operator=(const SolarMutexTryAndBuyGuard&) SAL_DELETED_FUNCTION;
1644 public:
1646 SolarMutexTryAndBuyGuard()
1647 : m_isAcquired(false)
1648 #ifdef DBG_UTIL
1649 , m_isChecked(false)
1650 #endif
1651 , m_rSolarMutex(Application::GetSolarMutex())
1654 m_isAcquired = m_rSolarMutex.tryToAcquire();
1657 ~SolarMutexTryAndBuyGuard()
1659 #ifdef DBG_UTIL
1660 assert(m_isChecked);
1661 #endif
1662 if (m_isAcquired)
1663 m_rSolarMutex.release();
1666 bool isAcquired()
1668 #ifdef DBG_UTIL
1669 m_isChecked = true;
1670 #endif
1671 return m_isAcquired;
1675 } // namespace vcl
1678 A helper class that calls Application::ReleaseSolarMutex() in its constructor
1679 and restores the mutex in its destructor.
1681 class SolarMutexReleaser
1683 sal_uLong mnReleased;
1685 public:
1686 SolarMutexReleaser(): mnReleased(Application::ReleaseSolarMutex()) {}
1688 ~SolarMutexReleaser()
1690 Application::AcquireSolarMutex( mnReleased );
1694 VCL_DLLPUBLIC Application* GetpApp();
1696 VCL_DLLPUBLIC bool InitVCL();
1697 VCL_DLLPUBLIC void DeInitVCL();
1699 VCL_DLLPUBLIC bool InitAccessBridge();
1701 // only allowed to call, if no thread is running. You must call JoinMainLoopThread to free all memory.
1702 VCL_DLLPUBLIC void CreateMainLoopThread( oslWorkerFunction pWorker, void * pThreadData );
1703 VCL_DLLPUBLIC void JoinMainLoopThread();
1705 inline void Application::EndYield()
1707 PostUserEvent( Link<>() );
1710 namespace vcl
1713 VCL_DLLPUBLIC bool IsWindowSystemAvailable();
1717 #endif // _APP_HXX
1719 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */