Sayonara Player
Signals | Public Member Functions | Protected Types | Protected Slots | Protected Member Functions | List of all members
Library::ItemView Class Referenceabstract

The main task of the ItemView is to display a context menu for various selections. It also handles drag and drop events with a cover. It supports merging and imports. More...

#include <ItemView.h>

Inheritance diagram for Library::ItemView:
Gui::WidgetTemplate< T > InfoDialogContainer Gui::Dragable Gui::WidgetTemplateParent Library::CoverView Library::TableView Library::AlbumView Library::ArtistView Library::TrackView SC::AlbumView SC::ArtistView SC::TrackView

Signals

void sigDeleteClicked ()
 
void sigPlayClicked ()
 
void sigPlayNextClicked ()
 
void sigPlayNewTabClicked ()
 
void sigAppendClicked ()
 
void sigRefreshClicked ()
 
void sigReloadClicked ()
 
void sigImportFiles (const QStringList &files)
 
void sigSelectionChanged (const IndexSet &indexes)
 

Public Member Functions

 ItemView (QWidget *parent=nullptr)
 
void setItemModel (ItemModel *model)
 
void showClearButton (bool visible)
 
void useClearButton (bool yesno)
 
virtual Library::ContextMenu::Entries contextMenuEntries () const
 
bool isValidDragPosition (const QPoint &p) const override
 
virtual void showEvent (QShowEvent *e) override
 

Protected Types

enum  EditTab {
  TabText ,
  TabCover ,
  TabTagsFromPath
}
 
enum class  ReleaseReason : char {
  Dropped ,
  Destroyed
}
 

Protected Slots

virtual void showContextMenu (const QPoint &)
 
virtual void mergeActionTriggered ()
 
virtual void playClicked ()
 
virtual void playNewTabClicked ()
 
virtual void playNextClicked ()
 
virtual void deleteClicked ()
 
virtual void appendClicked ()
 
virtual void refreshClicked ()
 
virtual void reloadClicked ()
 
virtual void albumArtistsToggled ()
 
virtual void filterExtensionsTriggered (const QString &extension, bool b)
 
virtual void fill ()
 

Protected Member Functions

virtual void mousePressEvent (QMouseEvent *event) override
 
virtual void contextMenuEvent (QContextMenuEvent *event) override
 
virtual void dragEnterEvent (QDragEnterEvent *event) override
 
virtual void dragMoveEvent (QDragMoveEvent *event) override
 
virtual void dropEvent (QDropEvent *event) override
 
virtual void resizeEvent (QResizeEvent *event) override
 
virtual void selectionChanged (const QItemSelection &selected, const QItemSelection &deselected) override
 
Library::ContextMenucontextMenu () const
 
virtual void initContextMenu ()
 
virtual void initCustomContextMenu (Library::ContextMenu *menu)
 
ItemModelitemModel () const
 
virtual AbstractLibrarylibrary () const
 
virtual bool isMergeable () const =0
 indicates if multiple ids can be merged into one. For example if the same artist is written in three different ways, they can be merged to one. On the other hand, for tracks that does not make sense More...
 
MetaDataList infoDialogData () const override
 get the metadata that should be used for the info dialog So for lists, the selected tracks are used here More...
 
QWidget * getParentWidget () override
 
virtual void selectedItemsChanged (const IndexSet &indexes)
 
virtual void importRequested (const QStringList &files)
 
virtual void runMergeOperation (const Library::MergeData &md)
 
int viewportHeight () const override
 
virtual void languageChanged ()
 
virtual void skinChanged ()
 
virtual MD::Interpretation metadataInterpretation () const =0
 get the interpretation for the metadata. Maybe a list of metadata should be intrepeted as albums while others should be considered as tracks More...
 
virtual bool hasMetadata () const
 returns, if the widget can provide metadata instantly If false, the info dialog will the pathlist More...
 
virtual QStringList pathlist () const
 Returns a list of paths. This is only used if has_metadata() returns false. More...
 
virtual void showInfo ()
 Show the Info dialogs' info tab.
 
virtual void showLyrics ()
 Show the Info dialogs' lyrics tab.
 
virtual void showEdit ()
 Show the tag editor.
 
virtual void showCoverEdit ()
 Show the cover tab withing the tag editor.
 
virtual bool hasDragLabel () const
 
virtual QString dragLabel () const
 

Detailed Description

The main task of the ItemView is to display a context menu for various selections. It also handles drag and drop events with a cover. It supports merging and imports.

Member Function Documentation

◆ getParentWidget()

QWidget * Library::ItemView::getParentWidget ( )
overrideprotectedvirtual

Implements InfoDialogContainer.

◆ hasMetadata()

virtual bool InfoDialogContainer::hasMetadata ( ) const
protectedvirtualinherited

returns, if the widget can provide metadata instantly If false, the info dialog will the pathlist

Returns
true in the basic implementation

Reimplemented in Directory::TreeView, and Directory::FileListView.

◆ infoDialogData()

MetaDataList Library::ItemView::infoDialogData ( ) const
overrideprotectedvirtual

get the metadata that should be used for the info dialog So for lists, the selected tracks are used here

Returns
MetaDataList

Implements InfoDialogContainer.

◆ isMergeable()

virtual bool Library::ItemView::isMergeable ( ) const
protectedpure virtual

indicates if multiple ids can be merged into one. For example if the same artist is written in three different ways, they can be merged to one. On the other hand, for tracks that does not make sense

Returns

Implemented in Library::CoverView, Library::ArtistView, SC::TrackView, SC::AlbumView, and SC::ArtistView.

◆ isValidDragPosition()

bool Library::ItemView::isValidDragPosition ( const QPoint &  p) const
overridevirtual

Dragable

Reimplemented from Gui::Dragable.

◆ metadataInterpretation()

virtual MD::Interpretation InfoDialogContainer::metadataInterpretation ( ) const
protectedpure virtualinherited

get the interpretation for the metadata. Maybe a list of metadata should be intrepeted as albums while others should be considered as tracks

Returns
interpretation of metadata

Implemented in Library::CoverView, Directory::TreeView, Directory::FileListView, Library::ArtistView, GUI_ControlsBase, and Playlist::View.

◆ pathlist()

virtual QStringList InfoDialogContainer::pathlist ( ) const
protectedvirtualinherited

Returns a list of paths. This is only used if has_metadata() returns false.

Returns

Reimplemented in Directory::TreeView, and Directory::FileListView.