synthclone  0.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
synthclone::FileSelectionView Class Reference

A utility view class that handles the selection of files and directories. More...

#include <synthclone/fileselectionview.h>

Inheritance diagram for synthclone::FileSelectionView:
Collaboration diagram for synthclone::FileSelectionView:

Public Types

enum  Operation { OPERATION_OPEN, OPERATION_SAVE }
 Specifies whether the view is being used to open or save a filesystem object. More...
 
enum  SelectionFilter { SELECTIONFILTER_ANY_FILE, SELECTIONFILTER_DIRECTORY, SELECTIONFILTER_EXISTING_FILE, SELECTIONFILTER_EXISTING_FILES }
 Specifies the types of filesystem objects the user may select. More...
 

Public Slots

void setDirectory (const QString &directory)
 Sets the directory to be displayed. More...
 
void setFilesVisible (bool visible)
 Sets a flag indicating whether or not to show files in the view. More...
 
void setOperation (Operation operation)
 Sets the FileSelectionView::Operation for the view. More...
 
void setSelectionFilter (SelectionFilter filter)
 Sets the FileSelectionView::SelectionFilter for this view. More...
 
void setTitle (const QString &title)
 Sets the window title. More...
 
- Public Slots inherited from synthclone::View
virtual void setCloseEnabled (bool enabled)
 Enables/disables closing for this view. More...
 
virtual void setVisible (bool visible)
 Sets the visibility of the root widget. More...
 

Signals

void pathsSelected (const QStringList &paths)
 Emitted when the user selects a path or path(s). More...
 
- Signals inherited from synthclone::View
void closeEnabledChanged (bool enabled)
 Emitted when closing is enabled/disabled. More...
 
void closeRequest ()
 Emitted when a root widget's close button is pressed. More...
 
void visibilityChanged (bool visible)
 Emitted when the visibility flag for the view changes. More...
 

Public Member Functions

 FileSelectionView (QObject *parent=0)
 Constructs a new FileSelectionView object. More...
 
 ~FileSelectionView ()
 Destroys a FileSelectionView object. More...
 
bool areFilesVisible () const
 Gets a flag indicating whether or not files are visible in the view. More...
 
QString getDirectory () const
 Gets the current displayed directory. More...
 
Operation getOperation () const
 Gets the current FileSelectionView::Operation. More...
 
SelectionFilter getSelectionFilter () const
 Gets the selection filter for this view. More...
 
QString getTitle () const
 Gets the window title. More...
 
- Public Member Functions inherited from synthclone::View
bool isCloseEnabled () const
 Gets a boolean indicating whether or not closing of this view is enabled. More...
 
bool isVisible () const
 Gets a boolean indicating whether or not the view is visible. More...
 

Additional Inherited Members

- Protected Member Functions inherited from synthclone::View
 View (QWidget *rootWidget, QObject *parent=0)
 Constructs a new View. More...
 
virtual ~View ()
 Destroys the View object. More...
 
const QWidget * getRootWidget () const
 Gets the root widget for this view. More...
 
QWidget * getRootWidget ()
 Gets the root widget for this view. More...
 

Detailed Description

A utility view class that handles the selection of files and directories.

Note
The current implementation is a thin wrapper around QFileDialog.

Member Enumeration Documentation

Specifies whether the view is being used to open or save a filesystem object.

Enumerator
OPERATION_OPEN 
OPERATION_SAVE 

Specifies the types of filesystem objects the user may select.

Enumerator
SELECTIONFILTER_ANY_FILE 
SELECTIONFILTER_DIRECTORY 
SELECTIONFILTER_EXISTING_FILE 
SELECTIONFILTER_EXISTING_FILES 

Constructor & Destructor Documentation

synthclone::FileSelectionView::FileSelectionView ( QObject *  parent = 0)
explicit

Constructs a new FileSelectionView object.

Parameters
parentThe parent object of the FileSelectionView object.
synthclone::FileSelectionView::~FileSelectionView ( )

Destroys a FileSelectionView object.

Member Function Documentation

bool synthclone::FileSelectionView::areFilesVisible ( ) const

Gets a flag indicating whether or not files are visible in the view.

Returns
The flag.
QString synthclone::FileSelectionView::getDirectory ( ) const

Gets the current displayed directory.

Returns
The current displayed directory.
Operation synthclone::FileSelectionView::getOperation ( ) const

Gets the current FileSelectionView::Operation.

Returns
The current FileSelectionView::Operation.
SelectionFilter synthclone::FileSelectionView::getSelectionFilter ( ) const

Gets the selection filter for this view.

Returns
The selection filter.
QString synthclone::FileSelectionView::getTitle ( ) const

Gets the window title.

Returns
The window title.
void synthclone::FileSelectionView::pathsSelected ( const QStringList &  paths)
signal

Emitted when the user selects a path or path(s).

Parameters
pathsThe selected paths.
void synthclone::FileSelectionView::setDirectory ( const QString &  directory)
slot

Sets the directory to be displayed.

Parameters
directoryThe directory.
void synthclone::FileSelectionView::setFilesVisible ( bool  visible)
slot

Sets a flag indicating whether or not to show files in the view.

If the 'visible' argument is set to false, then the selection filter will be set to FileSelectionView::SELECTIONFILTER_DIRECTORY when this method returns.

Parameters
visibleThe flag.
void synthclone::FileSelectionView::setOperation ( Operation  operation)
slot

Sets the FileSelectionView::Operation for the view.

Parameters
operationThe FileSelectionView::Operation.
void synthclone::FileSelectionView::setSelectionFilter ( SelectionFilter  filter)
slot

Sets the FileSelectionView::SelectionFilter for this view.

Parameters
filterThe FileSelectionView::SelectionFilter.
void synthclone::FileSelectionView::setTitle ( const QString &  title)
slot

Sets the window title.

Parameters
titleThe title.

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