diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2011-12-06 20:27:29 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2011-12-06 20:28:56 +0100 |
commit | 2a9c1d1a75b7d4e79dfbc6be3dada1a1e959e58e (patch) | |
tree | a1f99c2b4ab4806bc117d8552fbd2e8472bf4e90 /vcl/inc/vcl | |
parent | f547b2c4788439380c3202407c251153be0c5b8e (diff) |
Make dialogs fail with an exception in headless tests.
Diffstat (limited to 'vcl/inc/vcl')
-rw-r--r-- | vcl/inc/vcl/svapp.hxx | 29 |
1 files changed, 27 insertions, 2 deletions
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); |