Quantum GIS API Documentation  1.7.4
src/core/qgsmessageoutput.h
Go to the documentation of this file.
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 /* $Id$ */
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
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines