emitter.h 3.33 KB
Newer Older
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
/*
 * Copyright (C) 2014-2017 CZ.NIC
 *
 * 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 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 * In addition, as a special exception, the copyright holders give
 * permission to link the code of portions of this program with the
 * OpenSSL library under certain conditions as described in each
 * individual source file, and distribute linked combinations including
 * the two.
 */

#ifndef _MESSAGE_EMITTER_H_
#define _MESSAGE_EMITTER_H_

#include <QObject>

/*!
 * @brief Message processing status emitter.
 */
class MessageProcessingEmitter : public QObject {
	Q_OBJECT

signals:

37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
	/*!
	 * @brief Do some actions when download account info finished.
	 *
	 * @param[in] userName Account username string.
	 * @param[in] success True if success.
	 * @param[in] errTxt Errot description.
	 */
	void downloadAccountInfoFinishedSignal(const QString &userName,
	    bool success, const QString &errTxt);

	/*!
	 * @brief Do some actions when download delivery info finished.
	 *
	 * @param[in] userName Account username string.
	 * @param[in] msgId Message ID.
	 * @param[in] success True if success.
	 * @param[in] errTxt Errot description.
	 */
	void downloadDeliveryInfoFinishedSignal(const QString &userName,
	    qint64 msgId, bool success, const QString &errTxt);

58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
	/*!
	 * @brief Do some actions when download message finished.
	 *
	 * @param[in] userName Account username string.
	 * @param[in] msgId Message ID.
	 * @param[in] success True if success.
	 * @param[in] errTxt Errot description.
	 */
	void downloadMessageFinishedSignal(const QString &userName, qint64 msgId,
	    bool success, const QString &errTxt);

	/*!
	 * @brief Do some actions when download message list finished.
	 *
	 * @param[in] userName Account username string.
	 * @param[in] success True if success.
	 * @param[in] statusBarText Text for statusBar.
	 * @param[in] errTxt Errot description.
	 * @param[in] isMsgReceived True if message type is received.
	 */
	void downloadMessageListFinishedSignal(const QString &userName,
	    bool success, const QString &statusBarText, const QString &errTxt,
	    bool isMsgReceived);
81 82 83 84 85 86 87 88 89 90 91 92 93 94

	/*!
	 * @brief Do some actions when send message finished.
	 *
	 * @param[in] userName Account username string.
	 * @param[in] dbIDRecipient Message recipient databox ID string.
	 * @param[in] dmRecipient Recipient full name.
	 * @param[in] msgId Send message ID.
	 * @param[in] success True if success.
	 * @param[in] errTxt Errot description.
	 */
	void sendMessageFinishedSignal(const QString &userName,
	    const QString &dbIDRecipient, const QString &dmRecipient,
	    qint64 msgId, bool success, const QString &errTxt);
95 96 97 98 99 100 101 102
};

/*!
 * @brief This object is used to emit signals from message processing workers.
 */
extern MessageProcessingEmitter globMsgProcEmitter;

#endif /* _MESSAGE_EMITTER_H_ */