Sayonara Player
Public Member Functions | Friends | List of all members
Library::Container Class Referenceabstract
Inheritance diagram for Library::Container:
EmptyLibraryContainer Library::DirectoryContainer LocalLibraryContainer SC::LibraryContainer SomaFM::LibraryContainer

Public Member Functions

 Container (QObject *parent=nullptr)
 
virtual QString name () const =0
 Should return an untranslated name used for identifying this widget. More...
 
virtual void set_name (const QString &name)
 
virtual QString display_name () const
 Should return the translated name displayed in the library view combobox. More...
 
virtual QWidget * widget () const =0
 Should return the UI for the library view. More...
 
virtual QFrame * header () const =0
 this is a frame at the top left of the container where the combo box will be located More...
 
virtual QPixmap icon () const =0
 Every library should show a icon in the combo box. More...
 
virtual QMenu * menu ()
 return actions menu (may be nullptr). The title does not have to be set More...
 
void set_menu_action (QAction *action)
 sets the action member field used in the player menu bar. This is called by the player if the language has changed More...
 
QAction * menu_action () const
 get the action in the player menubar. More...
 
virtual void init_ui ()=0
 Should initialize the ui. The ui constructor should be called within this function.
 
bool is_initialized () const
 tests, if the ui already has been initialized More...
 
virtual bool is_local () const
 a local library is a library which writes to the library field of the database. This should be false for every new plugin More...
 
virtual void show ()
 
virtual void hide ()
 
void retranslate ()
 

Friends

class PluginHandler
 

Member Function Documentation

◆ display_name()

virtual QString Library::Container::display_name ( ) const
virtual

Should return the translated name displayed in the library view combobox.

Returns
display name

Reimplemented in SomaFM::LibraryContainer, SC::LibraryContainer, Library::DirectoryContainer, LocalLibraryContainer, and EmptyLibraryContainer.

◆ header()

virtual QFrame* Library::Container::header ( ) const
pure virtual

this is a frame at the top left of the container where the combo box will be located

Returns

Implemented in SomaFM::LibraryContainer, SC::LibraryContainer, Library::DirectoryContainer, LocalLibraryContainer, and EmptyLibraryContainer.

◆ icon()

virtual QPixmap Library::Container::icon ( ) const
pure virtual

Every library should show a icon in the combo box.

Returns

Implemented in SC::LibraryContainer, Library::DirectoryContainer, LocalLibraryContainer, SomaFM::LibraryContainer, and EmptyLibraryContainer.

◆ is_initialized()

bool Library::Container::is_initialized ( ) const

tests, if the ui already has been initialized

Returns
true if ui has been initialized, false else

◆ is_local()

virtual bool Library::Container::is_local ( ) const
virtual

a local library is a library which writes to the library field of the database. This should be false for every new plugin

Returns

Reimplemented in LocalLibraryContainer.

◆ menu()

virtual QMenu* Library::Container::menu ( )
virtual

return actions menu (may be nullptr). The title does not have to be set

Returns
the translated menu relevant for the corresponding library

Reimplemented in SomaFM::LibraryContainer, SC::LibraryContainer, LocalLibraryContainer, and EmptyLibraryContainer.

◆ menu_action()

QAction* Library::Container::menu_action ( ) const

get the action in the player menubar.

Returns
pointer to action field

◆ name()

virtual QString Library::Container::name ( ) const
pure virtual

Should return an untranslated name used for identifying this widget.

Returns
name

Implemented in Library::DirectoryContainer, SomaFM::LibraryContainer, SC::LibraryContainer, LocalLibraryContainer, and EmptyLibraryContainer.

◆ set_menu_action()

void Library::Container::set_menu_action ( QAction *  action)

sets the action member field used in the player menu bar. This is called by the player if the language has changed

Parameters
actionthe new translated action

◆ widget()

virtual QWidget* Library::Container::widget ( ) const
pure virtual

Should return the UI for the library view.

Returns
pointer to the ui

Implemented in Library::DirectoryContainer, SomaFM::LibraryContainer, SC::LibraryContainer, LocalLibraryContainer, and EmptyLibraryContainer.