ListModel

public protocol ListModel : class, Disposable

Represents the file list model.

Note that this API is not thread-safe. Call all methods and properties only from the UI thread.

  • True if the hidden files are shown.

    Declaration

    Swift

    var showHiddenFiles: Bool
  • The text filter for the Quick Select.

    Declaration

    Swift

    var quickSelect: String
  • The file filter.

    Declaration

    Swift

    var filter: (VirtualFile) -> Bool
  • The global file filter.

    Declaration

    Swift

    var globalFilter: (VirtualFile) -> Bool
  • The ordering strategy.

    Declaration

    Swift

    var ordering: ListOrdering
  • The index of the current item (item on a cursor).

    Returns the index of the current item, or a negative number if the list does not have a current item.

    Declaration

    Swift

    var currentIndex: Int
  • Returns a number of selected items.

    Declaration

    Swift

    var selectedCount: Int
  • Returns true if self[index] is selected.

    Declaration

    Swift

    func isSelected(index: Int) -> Bool
  • Returns the selected indices.

    Declaration

    Swift

    var selectedIndices: [Int]
  • Count of the list items.

    Declaration

    Swift

    var count: Int
  • Returns the list item at index, or nil if the index is out of bounds or directory data is empty.

    Declaration

    Swift

    subscript(index: Int) -> VirtualFile
  • isAnythingSelected Extension method

    True if selectedItemIndices is not empty.

    Declaration

    Swift

    public var isAnythingSelected: Bool
  • hasCurrent Extension method

    True if the list has a current item.

    Declaration

    Swift

    public var hasCurrent: Bool
  • currentFile Extension method

    The current item, or nil if the list does not have a current item.

    Declaration

    Swift

    public var currentFile: VirtualFile?
  • selectedFiles Extension method

    Selected items.

    Declaration

    Swift

    public var selectedFiles: [VirtualFile]
  • activeFiles Extension method

    Selected items if anything is selected or the current item if the selection is empty. Returns the empty array if both selection is empty and the current item are not set.

    Note that only selectable items are returned (and `GoUpVirtualFile` is not a selectable item).
    

    Declaration

    Swift

    public var activeFiles: [VirtualFile]
  • isEmpty Extension method

    Returns true if the list contains zero elements, false otherwise.

    Declaration

    Swift

    public var isEmpty: Bool
  • isNotEmpty Extension method

    Returns true if the list contains at least one element, false otherwise.

    Declaration

    Swift

    public var isNotEmpty: Bool