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 "filesystem/DirectoryHistory.h"
12 #include "filesystem/VirtualDirectory.h"
13 #include "guilib/GUIWindow.h"
14 #include "utils/JobManager.h"
22 class CGUIDialogProgress
;
24 class CGUIWindowFileManager
:
30 CGUIWindowFileManager(void);
31 ~CGUIWindowFileManager(void) override
;
32 bool OnMessage(CGUIMessage
& message
) override
;
33 bool OnAction(const CAction
&action
) override
;
34 bool OnBack(int actionID
) override
;
35 const CFileItem
&CurrentDirectory(int indx
) const;
37 static int64_t CalculateFolderSize(const std::string
&strDirectory
, CGUIDialogProgress
*pProgress
= NULL
);
39 void OnJobComplete(unsigned int jobID
, bool success
, CJob
*job
) override
;
41 void OnInitWindow() override
;
42 void SetInitialPath(const std::string
&path
);
43 void GoParentFolder(int iList
);
44 void UpdateControl(int iList
, int item
);
45 bool Update(int iList
, const std::string
&strDirectory
); //???
46 void OnStart(CFileItem
*pItem
, const std::string
&player
);
47 bool SelectItem(int iList
, int &item
);
48 void ClearFileItems(int iList
);
49 void OnClick(int iList
, int iItem
);
50 void OnMark(int iList
, int iItem
);
51 void OnSort(int iList
);
53 void OnCopy(int iList
);
54 void OnMove(int iList
);
55 void OnDelete(int iList
);
56 void OnRename(int iList
);
57 void OnSelectAll(int iList
);
58 void OnNewFolder(int iList
);
60 void Refresh(int iList
);
61 int GetSelectedItem(int iList
);
62 bool HaveDiscOrConnection( std::string
& strPath
, int iDriveType
);
63 void GetDirectoryHistoryString(const CFileItem
* pItem
, std::string
& strHistoryString
);
64 bool GetDirectory(int iList
, const std::string
&strDirectory
, CFileItemList
&items
);
65 int NumSelected(int iList
);
66 int GetFocusedList() const;
67 // functions to check for actions that we can perform
68 bool CanRename(int iList
);
69 bool CanCopy(int iList
);
70 bool CanMove(int iList
);
71 bool CanDelete(int iList
);
72 bool CanNewFolder(int iList
);
73 void OnPopupMenu(int iList
, int iItem
, bool bContextDriven
= true);
74 void ShowShareErrorMessage(CFileItem
* pItem
);
75 void UpdateItemCounts();
78 bool bCheckShareConnectivity
;
79 std::string strCheckSharePath
;
81 XFILE::CVirtualDirectory m_rootDir
;
82 CFileItemList
* m_vecItems
[2];
83 typedef std::vector
<CFileItem
*> ::iterator ivecItems
;
84 CFileItem
* m_Directory
[2];
85 std::string m_strParentPath
[2];
86 CDirectoryHistory m_history
[2];
88 int m_errorHeading
, m_errorLine
;
90 std::atomic_bool m_updating
= {false};
94 CUpdateGuard(std::atomic_bool
&update
) : m_update(update
)
103 std::atomic_bool
&m_update
;