/usr/include/qgis/qgsmessageoutput.h is in libqgis-dev 1.7.4+1.7.5~20120320-1.1+b1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | /***************************************************************************
qgsmessageoutput.h - interface for showing messages
----------------------
begin : April 2006
copyright : (C) 2006 by Martin Dobias
email : wonder.sk at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
/* $Id$ */
#ifndef QGSMESSAGEOUTPUT_H
#define QGSMESSAGEOUTPUT_H
#include <QString>
#include <QObject>
class QgsMessageOutput;
typedef QgsMessageOutput*( *MESSAGE_OUTPUT_CREATOR )();
/** \ingroup core
* Interface for showing messages from QGIS in GUI independent way.
* This class provides abstraction of a dialog for showing output to the user.
* By default QgsMessageConsoleOutput will be used if not overridden with other
* message output creator function.
* QGIS application uses QgsMessageView class for displaying a dialog to the user.
* Object deletes itself when it's not needed anymore. Children should use
* signal destroyed() to notify the deletion
*/
class CORE_EXPORT QgsMessageOutput
{
public:
//! message can be in plain text or in html format
enum MessageType { MessageText, MessageHtml };
//! virtual destructor
virtual ~QgsMessageOutput();
//! set message, it won't be displayed until
virtual void setMessage( const QString& message, MessageType msgType ) = 0;
//! message to be appended to the current text
virtual void appendMessage( const QString& message ) = 0;
//! set title for the messages
virtual void setTitle( const QString& title ) = 0;
//! display the message to the user
virtual void showMessage( bool blocking = true ) = 0;
//! sets function that will be used to create message output
static void setMessageOutputCreator( MESSAGE_OUTPUT_CREATOR f );
//! function that returns new class derived from QgsMessageOutput
//! (don't forget to delete it then)
static QgsMessageOutput* createMessageOutput();
private:
//! Pointer to the function which creates the class for output
static MESSAGE_OUTPUT_CREATOR mMessageOutputCreator;
};
/**
\brief Default implementation of message output interface
This class outputs messages to the standard output. Therefore it might
be the right choice for apps without GUI.
*/
class CORE_EXPORT QgsMessageOutputConsole : public QObject, public QgsMessageOutput
{
Q_OBJECT
public:
QgsMessageOutputConsole();
virtual void setMessage( const QString& message, MessageType msgType );
virtual void appendMessage( const QString& message );
virtual void setTitle( const QString& title );
//! sends the message to the standard output
virtual void showMessage( bool blocking = true );
signals:
//! signals that object will be destroyed and shouldn't be used anymore
void destroyed();
private:
//! stores current message
QString mMessage;
//! stores current title
QString mTitle;
};
#endif
|