00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef QGSMESSAGEOUTPUT_H
00018 #define QGSMESSAGEOUTPUT_H
00019
00020 #include <QString>
00021 #include <QObject>
00022
00023 class QgsMessageOutput;
00024 typedef QgsMessageOutput*( *MESSAGE_OUTPUT_CREATOR )();
00025
00026
00038 class CORE_EXPORT QgsMessageOutput
00039 {
00040 public:
00041
00043 enum MessageType { MessageText, MessageHtml };
00044
00046 virtual ~QgsMessageOutput();
00047
00049 virtual void setMessage( const QString& message, MessageType msgType ) = 0;
00050
00052 virtual void appendMessage( const QString& message ) = 0;
00053
00055 virtual void setTitle( const QString& title ) = 0;
00056
00058 virtual void showMessage( bool blocking = true ) = 0;
00059
00061 static void setMessageOutputCreator( MESSAGE_OUTPUT_CREATOR f );
00062
00065 static QgsMessageOutput* createMessageOutput();
00066
00067 private:
00068
00070 static MESSAGE_OUTPUT_CREATOR mMessageOutputCreator;
00071 };
00072
00073
00080 class CORE_EXPORT QgsMessageOutputConsole : public QObject, public QgsMessageOutput
00081 {
00082 Q_OBJECT
00083
00084 public:
00085
00086 QgsMessageOutputConsole();
00087
00088 virtual void setMessage( const QString& message, MessageType msgType );
00089
00090 virtual void appendMessage( const QString& message );
00091
00092 virtual void setTitle( const QString& title );
00093
00095 virtual void showMessage( bool blocking = true );
00096
00097 signals:
00098
00100 void destroyed();
00101
00102 private:
00103
00105 QString mMessage;
00106
00108 QString mTitle;
00109
00110 };
00111
00112 #endif