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 sig_all_selected ()
 
void sig_delete_clicked ()
 
void sig_play_clicked ()
 
void sig_play_next_clicked ()
 
void sig_play_new_tab_clicked ()
 
void sig_append_clicked ()
 
void sig_refresh_clicked ()
 
void sig_reload_clicked ()
 
void sig_import_files (const QStringList &files)
 
void sig_sel_changed (const IndexSet &indexes)
 
void sig_merge (const Util::Set< Id > &ids, int target_id)
 

Public Member Functions

 ItemView (QWidget *parent=nullptr)
 
void set_item_model (ItemModel *model)
 
virtual Gui::LibraryContextMenu::Entries context_menu_entries () const
 
QMimeData * dragable_mimedata () const override
 
QPixmap drag_pixmap () const override
 
void set_selection_type (SelectionViewInterface::SelectionType type) override
 
bool is_valid_drag_position (const QPoint &p) const override
 
void show_clear_button (bool visible)
 
void use_clear_button (bool yesno)
 
void resize_rows_to_contents ()
 
void resize_rows_to_contents (int first_row, int count)
 
virtual void showEvent (QShowEvent *e) override
 
void info_dialog_closed ()
 this function should not be called from outside. This function is triggered when the info dialog was closed.
 

Protected Types

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

Protected Slots

virtual void show_context_menu (const QPoint &)
 
virtual void merge_action_triggered ()
 
virtual void play_clicked ()
 
virtual void play_new_tab_clicked ()
 
virtual void play_next_clicked ()
 
virtual void delete_clicked ()
 
virtual void append_clicked ()
 
virtual void refresh_clicked ()
 
virtual void reload_clicked ()
 
virtual void cover_view_toggled ()
 
virtual void album_artists_toggled ()
 
virtual void filter_extensions_triggered (const QString &extension, bool b)
 
virtual void fill ()
 

Protected Member Functions

virtual void mousePressEvent (QMouseEvent *event) override
 
virtual void mouseMoveEvent (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 changeEvent (QEvent *event) override
 
virtual void keyPressEvent (QKeyEvent *event) override
 
virtual void resizeEvent (QResizeEvent *event) override
 
virtual void selected_items_changed (const QItemSelection &selected, const QItemSelection &deselected)
 
virtual void init_context_menu ()
 
virtual void init_custom_context_menu (Gui::LibraryContextMenu *menu)
 
Gui::LibraryContextMenucontext_menu () const
 
ItemModelitem_model () const
 
virtual AbstractLibrarylibrary () const
 
virtual bool is_mergeable () 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 info_dialog_data () const override
 get the metadata that should be used for the info dialog So for lists, the selected tracks are used here More...
 
virtual void selection_changed (const IndexSet &indexes)
 
virtual void import_requested (const QStringList &files)
 
virtual void run_merge_operation (const Library::MergeData &md)
 
int viewport_height () const override
 
virtual void language_changed ()
 
virtual void skin_changed ()
 
virtual MD::Interpretation metadata_interpretation () 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 void show_info ()
 Show the Info dialogs' info tab.
 
virtual void show_lyrics ()
 Show the Info dialogs' lyrics tab.
 
virtual void show_edit ()
 Show the tag editor.
 
virtual void show_cover_edit ()
 
virtual void drag_pressed (const QPoint &p) final
 
virtual QDrag * drag_moving (const QPoint &p) final
 
virtual void drag_released (ReleaseReason reason)
 
virtual bool has_drag_label () const
 
virtual QString drag_label () 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

◆ dragable_mimedata()

QMimeData* Library::ItemView::dragable_mimedata ( ) const
overridevirtual

Dragable

Implements Gui::Dragable.

◆ info_dialog_data()

MetaDataList Library::ItemView::info_dialog_data ( ) 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.

◆ is_mergeable()

virtual bool Library::ItemView::is_mergeable ( ) 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, and Library::ArtistView.

◆ metadata_interpretation()

virtual MD::Interpretation InfoDialogContainer::metadata_interpretation ( ) 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 GUI_ControlsBase, GUI_DirectoryWidget, Library::CoverView, and Library::ArtistView.