/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file GUIEvent_Message.h14/// @author Daniel Krajzewicz15/// @date Wed 18 Jun 200316///17// Event send when a message (message, warning, error) has to be submitted18/****************************************************************************/19#pragma once20#include <config.h>2122#include "GUIEvent.h"23#include <string>24#include <utils/common/MsgHandler.h>252627// ===========================================================================28// class definitions29// ===========================================================================30/**31* GUIEvent_Message32* Throw from GUIRunThread to GUIApplicationWindow and then further to all33* displays after a step has been performed34*/35class GUIEvent_Message : public GUIEvent {36public:37/// constructor38GUIEvent_Message(const std::string& msg)39: GUIEvent(GUIEventType::STATUS_OCCURRED), myMsg(msg) {40}4142GUIEvent_Message(GUIEventType type, const std::string& msg):43GUIEvent(type), myMsg(msg) {}4445/// constructor46GUIEvent_Message(MsgHandler::MsgType type, const std::string& msg)47: GUIEvent(GUIEventType::MESSAGE_OCCURRED), myMsg(msg) {48switch (type) {49case MsgHandler::MsgType::MT_MESSAGE:50myType = GUIEventType::MESSAGE_OCCURRED;51break;52case MsgHandler::MsgType::MT_WARNING:53myType = GUIEventType::WARNING_OCCURRED;54break;55case MsgHandler::MsgType::MT_ERROR:56myType = GUIEventType::ERROR_OCCURRED;57break;58case MsgHandler::MsgType::MT_DEBUG:59myType = GUIEventType::DEBUG_OCCURRED;60break;61case MsgHandler::MsgType::MT_GLDEBUG:62myType = GUIEventType::GLDEBUG_OCCURRED;63break;64default:65throw 1;66}67}6869/// destructor70~GUIEvent_Message() { }7172/// Returns the message73const std::string& getMsg() const {74return myMsg;75}7677protected:7879/// The message80std::string myMsg;8182};838485