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

The TableView class. More...

#include <TableView.h>

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

Signals

void sigSortorderChanged (SortOrder)
 
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

 TableView (QWidget *parent=nullptr)
 
virtual void init (AbstractLibrary *library)
 
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

void headerColumnsChanged (int oldCount, int newCount)
 
void sortorderChanged (int index, Qt::SortOrder sortorder)
 
void sectionResized (int logicalIndex, int oldSize, int newSize)
 
void sectionMoved (int logicalIndex, int old_visualIndex, int newVisualIndex)
 
void autoResizeTriggered (bool b)
 
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

void setupColumnNames ()
 the column names are reloaded and updated with their corresponding texts
 
virtual void initView (AbstractLibrary *library)=0
 here, the model and delegate should be instantiated as well as connections and setting listeners More...
 
virtual ColumnHeaderList columnHeaders () const =0
 returns a list of ColumnHeader objects containing name, sortorder. Everytime when the language is changed, this method is fetched as well when the UI is instantiated More...
 
virtual QByteArray columnHeaderState () const =0
 This method returns the SAVED column header sizes as they were remembered since the last time sayonara was running. Also see save_column_header_sizes() More...
 
virtual void saveColumnHeaderState (const QByteArray &state)=0
 Here, the column headers sizes should be saved somewhere. More...
 
virtual SortOrder sortorder () const =0
 returns the current sortorder for the table view More...
 
virtual void applySortorder (SortOrder s)=0
 saves the current sortorder More...
 
virtual bool autoResizeState () const =0
 
virtual void saveAutoResizeState (bool b)=0
 
void languageChanged () override
 
int mapModelIndexToIndex (const QModelIndex &idx) const override
 
ModelIndexRange mapIndexToModelIndexes (int idx) const override
 
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 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 TableView class.

Member Function Documentation

◆ applySortorder()

virtual void Library::TableView::applySortorder ( SortOrder  s)
protectedpure virtual

saves the current sortorder

Implemented in Library::ArtistView.

◆ columnHeaders()

virtual ColumnHeaderList Library::TableView::columnHeaders ( ) const
protectedpure virtual

returns a list of ColumnHeader objects containing name, sortorder. Everytime when the language is changed, this method is fetched as well when the UI is instantiated

Returns

Implemented in Library::AlbumView, and Library::ArtistView.

◆ columnHeaderState()

virtual QByteArray Library::TableView::columnHeaderState ( ) const
protectedpure virtual

This method returns the SAVED column header sizes as they were remembered since the last time sayonara was running. Also see save_column_header_sizes()

Returns
a list of widths in pixels

Implemented in Library::AlbumView, and Library::ArtistView.

◆ getParentWidget()

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

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
overrideprotectedvirtualinherited

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

Returns
MetaDataList

Implements InfoDialogContainer.

◆ initView()

virtual void Library::TableView::initView ( AbstractLibrary library)
protectedpure virtual

here, the model and delegate should be instantiated as well as connections and setting listeners

Parameters
library

Implemented in Library::ArtistView.

◆ isMergeable()

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

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
overridevirtualinherited

Dragable

Reimplemented from Gui::Dragable.

◆ languageChanged()

void Library::TableView::languageChanged ( )
overrideprotectedvirtual

Reimplemented from Gui::WidgetTemplateParent.

◆ 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.

◆ saveColumnHeaderState()

virtual void Library::TableView::saveColumnHeaderState ( const QByteArray &  state)
protectedpure virtual

Here, the column headers sizes should be saved somewhere.

Parameters
alist of widths in pixels. The list should be as big as there are columns (even if they are not visible)

Implemented in Library::AlbumView, and Library::ArtistView.

◆ sortorder()

virtual SortOrder Library::TableView::sortorder ( ) const
protectedpure virtual

returns the current sortorder for the table view

Implemented in Library::ArtistView.