JUCE  v5.1.1-3-g1a0b28c73
JUCE API
DirectoryContentsDisplayComponent Class Referenceabstract

A base class for components that display a list of the files in a directory. More...

#include <juce_DirectoryContentsDisplayComponent.h>

Inheritance diagram for DirectoryContentsDisplayComponent:
Collaboration diagram for DirectoryContentsDisplayComponent:

Public Types

enum  ColourIds {
  highlightColourId = 0x1000540,
  textColourId = 0x1000541
}
 A set of colour IDs to use to change the colour of various aspects of the list. More...
 

Public Member Functions

 DirectoryContentsDisplayComponent (DirectoryContentsList &listToShow)
 Creates a DirectoryContentsDisplayComponent for a given list of files. More...
 
virtual ~DirectoryContentsDisplayComponent ()
 Destructor. More...
 
void addListener (FileBrowserListener *listener)
 Adds a listener to be told when files are selected or clicked. More...
 
virtual void deselectAllFiles ()=0
 Deselects any selected files. More...
 
virtual int getNumSelectedFiles () const =0
 Returns the number of files the user has got selected. More...
 
virtual File getSelectedFile (int index) const =0
 Returns one of the files that the user has currently selected. More...
 
void removeListener (FileBrowserListener *listener)
 Removes a listener. More...
 
virtual void scrollToTop ()=0
 Scrolls this view to the top. More...
 
void sendDoubleClickMessage (const File &)
 
void sendMouseClickMessage (const File &, const MouseEvent &)
 
void sendSelectionChangeMessage ()
 
virtual void setSelectedFile (const File &)=0
 If the specified file is in the list, it will become the only selected item (and if the file isn't in the list, all other items will be deselected). More...
 

Public Attributes

DirectoryContentsListdirectoryContentsList
 The list that this component is displaying. More...
 

Protected Attributes

ListenerList< FileBrowserListenerlisteners
 

Detailed Description

A base class for components that display a list of the files in a directory.

See also
DirectoryContentsList

Member Enumeration Documentation

◆ ColourIds

A set of colour IDs to use to change the colour of various aspects of the list.

These constants can be used either via the Component::setColour(), or LookAndFeel::setColour() methods.

See also
Component::setColour, Component::findColour, LookAndFeel::setColour, LookAndFeel::findColour
Enumerator
highlightColourId 

The colour to use to fill a highlighted row of the list.

textColourId 

The colour for the text.

Constructor & Destructor Documentation

◆ DirectoryContentsDisplayComponent()

DirectoryContentsDisplayComponent::DirectoryContentsDisplayComponent ( DirectoryContentsList listToShow)

Creates a DirectoryContentsDisplayComponent for a given list of files.

◆ ~DirectoryContentsDisplayComponent()

virtual DirectoryContentsDisplayComponent::~DirectoryContentsDisplayComponent ( )
virtual

Destructor.

Member Function Documentation

◆ addListener()

void DirectoryContentsDisplayComponent::addListener ( FileBrowserListener listener)

Adds a listener to be told when files are selected or clicked.

See also
removeListener

◆ deselectAllFiles()

virtual void DirectoryContentsDisplayComponent::deselectAllFiles ( )
pure virtual

Deselects any selected files.

Implemented in FileListComponent, and FileTreeComponent.

Referenced by FileTreeComponent::getNumSelectedFiles().

◆ getNumSelectedFiles()

virtual int DirectoryContentsDisplayComponent::getNumSelectedFiles ( ) const
pure virtual

Returns the number of files the user has got selected.

See also
getSelectedFile

Implemented in FileListComponent, and FileTreeComponent.

◆ getSelectedFile()

virtual File DirectoryContentsDisplayComponent::getSelectedFile ( int  index) const
pure virtual

Returns one of the files that the user has currently selected.

The index should be in the range 0 to (getNumSelectedFiles() - 1).

See also
getNumSelectedFiles

Implemented in FileListComponent, and FileTreeComponent.

Referenced by FileTreeComponent::getNumSelectedFiles().

◆ removeListener()

void DirectoryContentsDisplayComponent::removeListener ( FileBrowserListener listener)

Removes a listener.

See also
addListener

◆ scrollToTop()

virtual void DirectoryContentsDisplayComponent::scrollToTop ( )
pure virtual

Scrolls this view to the top.

Implemented in FileListComponent, and FileTreeComponent.

Referenced by FileTreeComponent::getNumSelectedFiles().

◆ sendDoubleClickMessage()

void DirectoryContentsDisplayComponent::sendDoubleClickMessage ( const File )

◆ sendMouseClickMessage()

void DirectoryContentsDisplayComponent::sendMouseClickMessage ( const File ,
const MouseEvent  
)

◆ sendSelectionChangeMessage()

void DirectoryContentsDisplayComponent::sendSelectionChangeMessage ( )

◆ setSelectedFile()

virtual void DirectoryContentsDisplayComponent::setSelectedFile ( const File )
pure virtual

If the specified file is in the list, it will become the only selected item (and if the file isn't in the list, all other items will be deselected).

Implemented in FileListComponent, and FileTreeComponent.

Referenced by FileTreeComponent::getNumSelectedFiles().

Member Data Documentation

◆ directoryContentsList

DirectoryContentsList& DirectoryContentsDisplayComponent::directoryContentsList

The list that this component is displaying.

◆ listeners

ListenerList<FileBrowserListener> DirectoryContentsDisplayComponent::listeners
protected

The documentation for this class was generated from the following file: