From c04dcc2e7d834218ef2d4194331e383402495ae1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 10 Apr 2024 20:07:22 +0200 Subject: Adding upstream version 2:20.4+dfsg. Signed-off-by: Daniel Baumann --- xbmc/favourites/FavouritesURL.h | 66 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 xbmc/favourites/FavouritesURL.h (limited to 'xbmc/favourites/FavouritesURL.h') diff --git a/xbmc/favourites/FavouritesURL.h b/xbmc/favourites/FavouritesURL.h new file mode 100644 index 0000000..7261484 --- /dev/null +++ b/xbmc/favourites/FavouritesURL.h @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2012-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +#include "utils/ExecString.h" + +#include +#include + +class CFileItem; + +class CFavouritesURL +{ +public: + enum class Action + { + UNKNOWN, + ACTIVATE_WINDOW, + PLAY_MEDIA, + SHOW_PICTURE, + RUN_SCRIPT, + RUN_ADDON, + START_ANDROID_ACTIVITY, + }; + + explicit CFavouritesURL(const std::string& favouritesURL); + explicit CFavouritesURL(const CExecString& execString); + CFavouritesURL(Action action, const std::vector& params); + CFavouritesURL(const CFileItem& item, int contextWindow); + + virtual ~CFavouritesURL() = default; + + std::string GetURL() const { return m_path; } + + bool IsValid() const { return m_valid && m_exec.IsValid(); } + + bool IsDir() const { return m_isDir; } + + std::string GetExecString() const { return m_exec.GetExecString(); } + Action GetAction() const { return m_action; } + std::vector GetParams() const { return m_exec.GetParams(); } + std::string GetTarget() const { return m_target; } + int GetWindowID() const { return m_windowId; } + std::string GetActionLabel() const { return m_actionLabel; } + std::string GetProviderLabel() const { return m_providerLabel; } + +private: + bool Parse(CFavouritesURL::Action action, const std::vector& params); + + CExecString m_exec; + + bool m_valid{false}; + std::string m_path; + Action m_action{Action::UNKNOWN}; + std::string m_target; + int m_windowId{-1}; + bool m_isDir{false}; + std::string m_actionLabel; + std::string m_providerLabel; +}; -- cgit v1.2.3