Class sh::ui::FileView

class sh::ui::FileView : public QObject

Abstract base class for a file view implementation (i.e. which shows the content of a directory somehow).

Subclassed by sh::ui::qt::QtFileViewControl, sh::ui::web::WebFileView

Public Functions

FileView()
~FileView()
sh::ui::ColumnDimensions *columndimensions() = 0

Returns the column dimensions handler. .

sh::tools::HistoryTracker<std::shared_ptr<const sh::filesystem::Eurl>> *historyTracker() = 0

Returns the history tracker. .

FileViewMode viewmode() = 0

Returns the view mode (icons, list, … ?). .

void setViewmode(FileViewMode m) = 0

Sets the view mode. .

int index() = 0

Returns the position of this file view within the panel. .

std::shared_ptr<sh::filesystem::FilesystemNode> node()

Returns the current directory.

void gotoDir(std::shared_ptr<sh::filesystem::FilesystemNode> node)

Jumps to a new current directory.

Implementations have to call the base class implementation inside.

sh::filesystem::SizeFormatting getSizeFormattingMode() = 0

Returns the mode how file sizes are formatted for displaying. .

void setSizeFormattingMode(sh::filesystem::SizeFormatting mode) = 0

Sets the mode how file sizes are formatted for displaying. .

bool hiddenFilesVisible() = 0

Returns if hidden files are visible. .

void setHiddenFilesVisible(bool v) = 0

Sets the visibility of hidden files. .

int iconDimension() = 0

Returns the icon size (in pixels). .

void setIconDimension(int v) = 0

Sets the icon size (in pixels). .

void setSort(int column, Qt::SortOrder order) = 0

Sets how to sort this view. .

int sortColumn() = 0

Returns the index of the current sort column. .

Qt::SortOrder sortOrder() = 0

Returns the current sort order. .

QList<std::shared_ptr<sh::filesystem::FilesystemNode>> selectedNodes() = 0

Returns the nodes which the user has selected in this fileview. .

void setSelection(const QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes) = 0

Sets the node selection of this fileview. .

QList<std::shared_ptr<sh::filesystem::FilesystemNode>> getAllVisibleNodes() = 0

Returns a list of all nodes currently listed in this file view. .

void reload(bool skipModel = false)

Reloads the data inside this file view.

sh::filesystem::FilesystemModelFileviewProxy *filemodel()

Returns the filesystem model for this view. .

void setFilemodel(sh::filesystem::FilesystemModelFileviewProxy *model)

Sets the filesystem model for this view. .

Signals

void selectionChanged()

Triggered when the selection have changed.

void viewOptionChanged()

Triggered when some view options have changed.

Private Members

sh::filesystem::FilesystemModelFileviewProxy *_model = nullptr
std::shared_ptr<QObject> _visibleviewslifetimecanary = nullptr
std::shared_ptr<sh::filesystem::FilesystemNode> _node = nullptr