[ExecString] combine SplitParameters with identical function of CUtil
[xbmc.git] / xbmc / application / ApplicationActionListeners.h
blob504a79d47efc61fb574b41dcc633d0b6f7e7fc08
1 /*
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.
7 */
9 #pragma once
11 #include "application/IApplicationComponent.h"
13 #include <vector>
15 class CAction;
16 class CApplication;
17 class CCriticalSection;
19 namespace KODI
21 namespace ACTION
23 class IActionListener;
24 } // namespace ACTION
25 } // namespace KODI
27 /*!
28 * \brief Class handling application support for action listeners.
30 class CApplicationActionListeners : public IApplicationComponent
32 friend class CApplication;
34 public:
35 CApplicationActionListeners(CCriticalSection& sect);
37 /*!
38 \brief Register an action listener.
39 \param listener The listener to register
41 void RegisterActionListener(KODI::ACTION::IActionListener* listener);
42 /*!
43 \brief Unregister an action listener.
44 \param listener The listener to unregister
46 void UnregisterActionListener(KODI::ACTION::IActionListener* listener);
48 protected:
49 /*!
50 \brief Delegates the action to all registered action handlers.
51 \param action The action
52 \return true, if the action was taken by one of the action listener.
54 bool NotifyActionListeners(const CAction& action) const;
56 std::vector<KODI::ACTION::IActionListener*> m_actionListeners;
58 CCriticalSection& m_critSection;