1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxMessageOutput class. Shows a message to the user
4 // Author: Mattia Barbon
8 // Copyright: (c) wxWindows team
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 #if defined(__GNUG__) && !defined(__APPLE__)
20 #pragma interface "msgout.h"
24 #include "wx/wxchar.h"
26 // ----------------------------------------------------------------------------
27 // wxMessageOutput is a class abstracting formatted output target, i.e.
28 // something you can printf() to
29 // ----------------------------------------------------------------------------
31 class WXDLLEXPORT wxMessageOutput
34 virtual ~wxMessageOutput() { }
36 // show a message to the user
37 virtual void Printf(const wxChar
* format
, ...) ATTRIBUTE_PRINTF_2
= 0;
39 // gets the current wxMessageOutput object
40 static wxMessageOutput
* Get();
42 // sets the global wxMessageOutput instance; returns the previous one
43 static wxMessageOutput
* Set(wxMessageOutput
* msgout
);
46 static wxMessageOutput
* ms_msgOut
;
49 // ----------------------------------------------------------------------------
50 // implementation which sends output to stderr
51 // ----------------------------------------------------------------------------
53 class WXDLLEXPORT wxMessageOutputStderr
: public wxMessageOutput
56 wxMessageOutputStderr() { }
58 virtual void Printf(const wxChar
* format
, ...) ATTRIBUTE_PRINTF_2
;
61 // ----------------------------------------------------------------------------
62 // implementation which shows output in a message box
63 // ----------------------------------------------------------------------------
67 class WXDLLEXPORT wxMessageOutputMessageBox
: public wxMessageOutput
70 wxMessageOutputMessageBox() { }
72 virtual void Printf(const wxChar
* format
, ...) ATTRIBUTE_PRINTF_2
;
77 // ----------------------------------------------------------------------------
78 // implementation using the native way of outputting debug messages
79 // ----------------------------------------------------------------------------
81 class WXDLLEXPORT wxMessageOutputDebug
: public wxMessageOutput
84 wxMessageOutputDebug() { }
86 virtual void Printf(const wxChar
* format
, ...) ATTRIBUTE_PRINTF_2
;
89 // ----------------------------------------------------------------------------
90 // implementation using wxLog (mainly for backwards compatibility)
91 // ----------------------------------------------------------------------------
93 class WXDLLEXPORT wxMessageOutputLog
: public wxMessageOutput
96 wxMessageOutputLog() { }
98 virtual void Printf(const wxChar
* format
, ...) ATTRIBUTE_PRINTF_2
;