blob: a7cf83e83143a8b1a4570901d1e4d2bb914b2c66 [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SRC_DEVELOPER_DEBUG_ZXDB_CLIENT_SESSION_OBSERVER_H_
#define SRC_DEVELOPER_DEBUG_ZXDB_CLIENT_SESSION_OBSERVER_H_
#include <string>
namespace zxdb {
class SessionObserver {
public:
// The session can send notifications over to whatever UI is controlling it.
// This is similar to what the System does, but permits sending more generic
// messages and let the UI decide how to handle, instead of just logging
// to stdout/stderr.
//
// This is specially important when receiving arbitrary messages from the
// debug agent and the fact the the cli console has special states for the
// terminal state.
enum class NotificationType {
kNone, // Meant to signal a no-op.
kError,
kProcessStderr,
kProcessStdout,
kWarning,
};
static const char* NotificationTypeToString(NotificationType);
virtual void HandleNotification(NotificationType, const std::string&) {}
};
} // namespace zxdb
#endif // SRC_DEVELOPER_DEBUG_ZXDB_CLIENT_SESSION_OBSERVER_H_