1 | /* $Id: UIFileManagerHostTable.h 104228 2024-04-08 12:40:22Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIFileManagerHostTable class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2016-2023 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef FEQT_INCLUDED_SRC_guestctrl_UIFileManagerHostTable_h
|
---|
29 | #define FEQT_INCLUDED_SRC_guestctrl_UIFileManagerHostTable_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* Qt includes: */
|
---|
35 | #include <QFileDevice>
|
---|
36 |
|
---|
37 | /* GUI includes: */
|
---|
38 | #include "UIFileManagerTable.h"
|
---|
39 |
|
---|
40 | /* Forward declarations: */
|
---|
41 | class UIActionPool;
|
---|
42 | class UIFileSystemItem;
|
---|
43 |
|
---|
44 | /** This class scans the host file system by using the Qt API
|
---|
45 | and connects to the UIFileSystemModel*/
|
---|
46 | class UIFileManagerHostTable : public UIFileManagerTable
|
---|
47 | {
|
---|
48 | Q_OBJECT;
|
---|
49 |
|
---|
50 | public:
|
---|
51 |
|
---|
52 | UIFileManagerHostTable(UIActionPool *pActionPool, QWidget *pParent = 0);
|
---|
53 |
|
---|
54 | static KFsObjType fileType(const QFileInfo &fsInfo);
|
---|
55 | static KFsObjType fileType(const QString &strPath);
|
---|
56 | virtual bool isWindowsFileSystem() const override final;
|
---|
57 |
|
---|
58 | protected:
|
---|
59 |
|
---|
60 | /** Scans the directory with the path @strPath and inserts items to the
|
---|
61 | * tree under the @p parent. */
|
---|
62 | static bool scanDirectory(const QString& strPath, UIFileSystemItem *parent,
|
---|
63 | QMap<QString, UIFileSystemItem*> &fileObjects);
|
---|
64 | virtual bool readDirectory(const QString& strPath, UIFileSystemItem *parent, bool isStartDir = false) override final;
|
---|
65 | virtual void deleteByItem(UIFileSystemItem *item) override final;
|
---|
66 | virtual void goToHomeDirectory() override final;
|
---|
67 | virtual bool renameItem(UIFileSystemItem *item, const QString &strOldPath) override final;
|
---|
68 | virtual bool createDirectory(const QString &path, const QString &directoryName) override final;
|
---|
69 | virtual QString fsObjectPropertyString() override final;
|
---|
70 | virtual void showProperties() override final;
|
---|
71 | virtual void determineDriveLetters() override final;
|
---|
72 | virtual void determinePathSeparator() override final;
|
---|
73 | virtual void prepareToolbar() override final;
|
---|
74 | virtual void createFileViewContextMenu(const QWidget *pWidget, const QPoint &point) override;
|
---|
75 | virtual void toggleForwardBackwardActions() override final;
|
---|
76 |
|
---|
77 | /** @name Copy/Cut host-to-host stuff. Currently not implemented.
|
---|
78 | * @{ */
|
---|
79 | /** Disable/enable paste action depending on the m_eFileOperationType. */
|
---|
80 | virtual void setPasteActionEnabled(bool) override final {}
|
---|
81 | virtual void pasteCutCopiedObjects() override final {}
|
---|
82 | /** @} */
|
---|
83 |
|
---|
84 | protected slots:
|
---|
85 |
|
---|
86 | virtual void sltRetranslateUI() RT_OVERRIDE;
|
---|
87 |
|
---|
88 | private:
|
---|
89 |
|
---|
90 | static QString permissionString(QFileDevice::Permissions permissions);
|
---|
91 | void prepareActionConnections();
|
---|
92 |
|
---|
93 | QAction *m_pModifierActionSeparator;
|
---|
94 | };
|
---|
95 |
|
---|
96 | #endif /* !FEQT_INCLUDED_SRC_guestctrl_UIFileManagerHostTable_h */
|
---|