|
QGIS API Documentation
master-6227475
|
00001 /*************************************************************************** 00002 qgsmessageoutput.h - interface for showing messages 00003 ---------------------- 00004 begin : April 2006 00005 copyright : (C) 2006 by Martin Dobias 00006 email : wonder.sk at gmail dot com 00007 *************************************************************************** 00008 * * 00009 * This program is free software; you can redistribute it and/or modify * 00010 * it under the terms of the GNU General Public License as published by * 00011 * the Free Software Foundation; either version 2 of the License, or * 00012 * (at your option) any later version. * 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 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 MessageType mMsgType; 00112 }; 00113 00114 #endif