mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 00:16:51 +08:00
refs #199, featuring proxy to server side DBus signals.
So far we only could send server to proxy side signals, causing inconsistencies between remote and local contexts
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
#define BLACKCORE_CONTEXTAPPLICATION_H
|
||||
|
||||
#include "blackcore/context.h"
|
||||
#include "blackmisc/statusmessage.h"
|
||||
#include "blackmisc/statusmessagelist.h"
|
||||
#include <QObject>
|
||||
|
||||
#define BLACKCORE_CONTEXTAPPLICATION_INTERFACENAME "net.vatsim.PilotClient.BlackCore.ContextApplication"
|
||||
@@ -29,6 +29,15 @@ namespace BlackCore
|
||||
|
||||
public:
|
||||
|
||||
//! What output to redirect
|
||||
enum RedirectionLevel
|
||||
{
|
||||
RedirectNone,
|
||||
RedirectAllOutput,
|
||||
RedirectWarningAndAbove,
|
||||
RedirectError
|
||||
};
|
||||
|
||||
//! Service name
|
||||
static const QString &InterfaceName()
|
||||
{
|
||||
@@ -46,20 +55,51 @@ namespace BlackCore
|
||||
//! Destructor
|
||||
virtual ~IContextApplication() {}
|
||||
|
||||
//! Output redirection (redirect my output)
|
||||
virtual RedirectionLevel getOutputRedirectionLevel() const = 0;
|
||||
|
||||
//! Output redirection (redirect my output)
|
||||
virtual void setOutputRedirectionLevel(RedirectionLevel level) = 0;
|
||||
|
||||
//! Redirected output generated by others
|
||||
virtual RedirectionLevel getStreamingForRedirectedOutputLevel() const = 0;
|
||||
|
||||
//! Redirected output generated by others
|
||||
virtual void setStreamingForRedirectedOutputLevel(RedirectionLevel level) = 0;
|
||||
|
||||
signals:
|
||||
//! \brief Status message
|
||||
//! \remarks not to be called directly, use IContextApplication::sendStatusMessage
|
||||
void statusMessage(const BlackMisc::CStatusMessage &message);
|
||||
|
||||
//! Send status messages
|
||||
//! \remarks not to be called directly, use IContextApplication::sendStatusMessages
|
||||
void statusMessages(const BlackMisc::CStatusMessageList &messages);
|
||||
|
||||
//! Redirect output streams as by qDebug(), qWarning(), qCritical()
|
||||
//! \remarks context mode is an important means to avoid infinite redirect loops
|
||||
//! never output redirected stream messages from the same context again
|
||||
void redirectedOutput(const BlackMisc::CStatusMessage &message, qint64 contextId);
|
||||
|
||||
//! Widget GUI is about to start
|
||||
void widgetGuiStarting() const;
|
||||
void widgetGuiStarting();
|
||||
|
||||
//! Widget GUI is about to terminate
|
||||
void widgetGuiTerminating() const;
|
||||
void widgetGuiTerminating();
|
||||
|
||||
public slots:
|
||||
|
||||
//! \brief Ping a token, used to check if application is alive
|
||||
virtual qint64 ping(qint64 token) const = 0;
|
||||
|
||||
//! \copydoc CContext::reEmitSignalFromProxy
|
||||
virtual void signalFromProxy(const QString &signalName) = 0;
|
||||
|
||||
//! \brief Status message
|
||||
virtual void sendStatusMessage(const BlackMisc::CStatusMessage &message) = 0;
|
||||
|
||||
//! Send status messages
|
||||
virtual void sendStatusMessages(const BlackMisc::CStatusMessageList &messages) = 0;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user