2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
18 * \class IMessageTarget IMessageTarget.h "messaging/IMessageTarget.h"
19 * \brief A class wishing to receive messages should implement this
20 * and call \sa CApplicationMessenger::RegisterReceiver
21 * to start receiving messages
26 virtual ~IMessageTarget() = default;
28 * \brief Should return the message mask that it wishes to receive
31 * The message mask is defined in "messaging/ApplicationMessenger.h"
32 * pick the next one available when creating a new
34 virtual int GetMessageMask() = 0;
37 * \brief This gets called whenever a message matching the registered
38 * message mask is processed.
40 * There are no ordering guarantees here so implementations should never
41 * rely on a certain ordering of messages.
43 * Cleaning up any pointers stored in the message payload is not specified
44 * and is decided by the implementer of the message.
45 * In general prefer to delete any data in this method to keep the callsites cleaner
46 * and simpler but if data is to be passed back it's perfectly valid to handle it any way
47 * that fits the situation as long as it's documented along with the message.
49 * To return a simple value the result parameter of \sa ThreadMessage can be used
50 * as it will be used as the return value for \sa CApplicationMessenger::SendMsg.
51 * It is up to the implementer to decide if this is to be used and it should be documented
52 * along with any new message implemented.
54 virtual void OnApplicationMessage(ThreadMessage
* msg
) = 0;