diff options
Diffstat (limited to 'vcl/inc')
-rw-r--r-- | vcl/inc/svdata.hxx | 3 | ||||
-rw-r--r-- | vcl/inc/vcl/svapp.hxx | 29 |
2 files changed, 29 insertions, 3 deletions
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx index 6cb48900c386..82a5aae7980f 100644 --- a/vcl/inc/svdata.hxx +++ b/vcl/inc/svdata.hxx @@ -42,6 +42,7 @@ #include "vcl/vclevent.hxx" #include "vcl/sv.h" +#include "vcl/svapp.hxx" #include "vcl/dllapi.h" #include "unotools/options.hxx" @@ -167,9 +168,9 @@ struct ImplSVAppData sal_Bool mbInAppExecute; // is Application::Execute() on stack sal_Bool mbAppQuit; // is Application::Quit() called sal_Bool mbSettingsInit; // sal_True: Settings are initialized - sal_Bool mbDialogCancel; // sal_True: Alle Dialog::Execute()-Aufrufe werden mit return sal_False sofort beendet sal_Bool mbNoYield; // Application::Yield will not wait for events if the queue is empty // essentially that makes it the same as Application::Reschedule + Application::DialogCancelMode meDialogCancel; // sal_True: Alle Dialog::Execute()-Aufrufe werden mit return sal_False sofort beendet long mnDefaultLayoutBorder; // default value in pixel for layout distances used // in window arrangers diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx index 0350ee5f3c63..cfd46eddac6a 100644 --- a/vcl/inc/vcl/svapp.hxx +++ b/vcl/inc/vcl/svapp.hxx @@ -29,6 +29,10 @@ #ifndef _SV_SVAPP_HXX #define _SV_SVAPP_HXX +#include <sal/config.h> + +#include <stdexcept> + #include <osl/thread.hxx> #include <osl/mutex.hxx> #include <tools/string.hxx> @@ -140,6 +144,23 @@ public: class VCL_DLLPUBLIC Application { public: + enum DialogCancelMode { + DIALOG_CANCEL_OFF, ///< do not automatically cancel dialogs + DIALOG_CANCEL_SILENT, ///< silently cancel any dialogs + DIALOG_CANCEL_FATAL + ///< cancel any dialogs by throwing a DialogCancelledException + }; + + class VCL_DLLPUBLIC DialogCancelledException: + virtual public std::runtime_error + { + public: + explicit DialogCancelledException(char const * what_arg): + runtime_error(what_arg) {} + + virtual ~DialogCancelledException() throw (); + }; + Application(); virtual ~Application(); @@ -302,7 +323,8 @@ public: static void SetDefDialogParent( Window* pWindow ); static Window* GetDefDialogParent(); - static void EnableDialogCancel( sal_Bool bDialogCancel = sal_True ); + static DialogCancelMode GetDialogCancelMode(); + static void SetDialogCancelMode( DialogCancelMode mode ); static sal_Bool IsDialogCancelEnabled(); static void SetSystemWindowMode( sal_uInt16 nMode ); @@ -320,9 +342,12 @@ public: static void SetFilterHdl( const Link& rLink ); static const Link& GetFilterHdl(); - static void EnableHeadlessMode( sal_Bool bEnable = sal_True ); + static void EnableHeadlessMode( bool dialogsAreFatal ); static sal_Bool IsHeadlessModeEnabled(); + static bool IsHeadlessModeRequested(); + ///< check command line arguments for --headless + static void ShowNativeErrorBox(const String& sTitle , const String& sMessage); |