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.
11 #include "guilib/GUIDialog.h"
12 #include "media/MediaType.h"
22 class CGUIDialogVideoInfo
:
26 CGUIDialogVideoInfo(void);
27 ~CGUIDialogVideoInfo(void) override
;
28 bool OnMessage(CGUIMessage
& message
) override
;
29 bool OnAction(const CAction
&action
) override
;
30 void SetMovie(const CFileItem
*item
);
31 bool NeedRefresh() const;
32 bool RefreshAll() const;
33 bool HasUpdatedThumb() const { return m_hasUpdatedThumb
; }
34 bool HasUpdatedUserrating() const { return m_hasUpdatedUserrating
; }
35 bool HasUpdatedItems() const { return m_hasUpdatedItems
; }
37 std::string
GetThumbnail() const;
38 std::shared_ptr
<CFileItem
> GetCurrentListItem(int offset
= 0) override
{ return m_movieItem
; }
39 const CFileItemList
& CurrentDirectory() const { return *m_castList
; }
40 bool HasListItems() const override
{ return true; }
42 static void AddItemPathToFileBrowserSources(std::vector
<CMediaSource
>& sources
,
43 const CFileItem
& item
);
45 static int ManageVideoItem(const std::shared_ptr
<CFileItem
>& item
);
46 static bool UpdateVideoItemTitle(const std::shared_ptr
<CFileItem
>& pItem
);
47 static bool CanDeleteVideoItem(const std::shared_ptr
<CFileItem
>& item
);
48 static bool DeleteVideoItemFromDatabase(const std::shared_ptr
<CFileItem
>& item
,
49 bool unavailable
= false);
50 static bool DeleteVideoItem(const std::shared_ptr
<CFileItem
>& item
, bool unavailable
= false);
52 static bool ManageMovieSets(const std::shared_ptr
<CFileItem
>& item
);
53 static bool GetMoviesForSet(const CFileItem
*setItem
, CFileItemList
&originalMovies
, CFileItemList
&selectedMovies
);
54 static bool GetSetForMovie(const CFileItem
* movieItem
, std::shared_ptr
<CFileItem
>& selectedSet
);
55 static bool SetMovieSet(const CFileItem
*movieItem
, const CFileItem
*selectedSet
);
57 static void ManageVideoVersions(const std::shared_ptr
<CFileItem
>& item
);
59 static bool GetItemsForTag(const std::string
&strHeading
, const std::string
&type
, CFileItemList
&items
, int idTag
= -1, bool showAll
= true);
60 static bool AddItemsToTag(const std::shared_ptr
<CFileItem
>& tagItem
);
61 static bool RemoveItemsFromTag(const std::shared_ptr
<CFileItem
>& tagItem
);
63 static bool ChooseAndManageVideoItemArtwork(const std::shared_ptr
<CFileItem
>& item
);
64 static bool ManageVideoItemArtwork(const std::shared_ptr
<CFileItem
>& item
, const MediaType
& type
);
66 static std::string
GetLocalizedVideoType(const std::string
&strType
);
68 static void ShowFor(const CFileItem
& item
);
71 void OnInitWindow() override
;
73 void SetLabel(int iControl
, const std::string
& strLabel
);
74 void SetUserrating(int userrating
) const;
76 // link cast to movies
79 * \brief Search the current directory for a string got from the virtual keyboard
80 * \param strSearch The search string
82 void OnSearch(std::string
& strSearch
);
84 * \brief Make the actual search for the OnSearch function.
85 * \param strSearch The search string
86 * \param items Items Found
88 void DoSearch(std::string
& strSearch
, CFileItemList
& items
) const;
90 * \brief React on the selected search item
91 * \param pItem Search result item
93 void OnSearchItemFound(const CFileItem
* pItem
);
94 bool OnManageVideoVersions();
95 bool OnManageVideoExtras();
96 void Play(bool resume
= false);
99 void OnSetUserrating() const;
102 static bool UpdateVideoItemSortTitle(const std::shared_ptr
<CFileItem
>& pItem
);
103 static bool LinkMovieToTvShow(const std::shared_ptr
<CFileItem
>& item
,
105 CVideoDatabase
& database
);
107 std::shared_ptr
<CFileItem
> m_movieItem
;
108 CFileItemList
*m_castList
;
109 bool m_bViewReview
= false;
110 bool m_bRefresh
= false;
111 bool m_bRefreshAll
= true;
112 bool m_hasUpdatedThumb
= false;
113 bool m_hasUpdatedUserrating
= false;
114 int m_startUserrating
= -1;
115 bool m_hasUpdatedItems
{false};
118 static bool ManageVideoItemArtwork(const std::shared_ptr
<CFileItem
>& item
,
119 const MediaType
& mediaType
,
120 const std::string
& artType
);
121 bool ChooseVideoVersion();