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 "utils/JobManager.h"
13 #include "video/VideoDatabase.h"
14 #include "view/GUIViewControl.h"
18 class CGUIDialogVideoBookmarks
: public CGUIDialog
, public CJobQueue
20 typedef std::map
<CJob
*, unsigned int> MAPJOBSCHAPS
;
23 CGUIDialogVideoBookmarks(void);
24 ~CGUIDialogVideoBookmarks(void) override
;
25 bool OnMessage(CGUIMessage
& message
) override
;
26 void OnWindowLoaded() override
;
27 void OnWindowUnload() override
;
28 bool OnAction(const CAction
&action
) override
;
31 \brief Creates a bookmark of the currently playing video file.
33 NOTE: sends a GUI_MSG_REFRESH_LIST message to DialogVideoBookmark on success
34 \return True if creation of bookmark was successful
35 \sa OnAddEpisodeBookmark
37 static bool OnAddBookmark();
40 \brief Creates an episode bookmark of the currently playing file
42 An episode bookmark specifies the end/beginning of episodes on files like: S01E01E02
43 Fails if the current video isn't a multi-episode file
44 NOTE: sends a GUI_MSG_REFRESH_LIST message to DialogVideoBookmark on success
45 \return True, if bookmark was successfully created
48 static bool OnAddEpisodeBookmark();
53 void GotoBookmark(int iItem
);
54 void ClearBookmarks();
55 static bool AddEpisodeBookmark();
56 static bool AddBookmark(CVideoInfoTag
*tag
=NULL
);
57 void Delete(int item
);
60 void OnPopupMenu(int item
);
61 CGUIControl
*GetFirstFocusableControl(int id
) override
;
63 void OnJobComplete(unsigned int jobID
, bool success
, CJob
* job
) override
;
65 CFileItemList
* m_vecItems
;
66 CGUIViewControl m_viewControl
;
67 VECBOOKMARKS m_bookmarks
;
70 void UpdateItem(unsigned int chapterIdx
);
73 std::string m_filePath
;
74 CCriticalSection m_refreshSection
;
75 MAPJOBSCHAPS m_mapJobsChapter
;