00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef QGSMESSAGEOUTPUT_H
00019 #define QGSMESSAGEOUTPUT_H
00020
00021 #include <QString>
00022 #include <QObject>
00023
00024 class QgsMessageOutput;
00025 typedef QgsMessageOutput*( *MESSAGE_OUTPUT_CREATOR )();
00026
00027
00039 class CORE_EXPORT QgsMessageOutput
00040 {
00041 public:
00042
00044 enum MessageType { MessageText, MessageHtml };
00045
00047 virtual ~QgsMessageOutput();
00048
00050 virtual void setMessage( const QString& message, MessageType msgType ) = 0;
00051
00053 virtual void appendMessage( const QString& message ) = 0;
00054
00056 virtual void setTitle( const QString& title ) = 0;
00057
00059 virtual void showMessage( bool blocking = true ) = 0;
00060
00062 static void setMessageOutputCreator( MESSAGE_OUTPUT_CREATOR f );
00063
00066 static QgsMessageOutput* createMessageOutput();
00067
00068 private:
00069
00071 static MESSAGE_OUTPUT_CREATOR mMessageOutputCreator;
00072 };
00073
00074
00081 class CORE_EXPORT QgsMessageOutputConsole : public QObject, public QgsMessageOutput
00082 {
00083 Q_OBJECT
00084
00085 public:
00086
00087 QgsMessageOutputConsole();
00088
00089 virtual void setMessage( const QString& message, MessageType msgType );
00090
00091 virtual void appendMessage( const QString& message );
00092
00093 virtual void setTitle( const QString& title );
00094
00096 virtual void showMessage( bool blocking = true );
00097
00098 signals:
00099
00101 void destroyed();
00102
00103 private:
00104
00106 QString mMessage;
00107
00109 QString mTitle;
00110
00111 };
00112
00113 #endif