Jellyfin Qt
QML Library for interacting with the Jellyfin multimedia server
Loading...
Searching...
No Matches
Jellyfin::BaseModelLoader Class Reference

#include <apimodel.h>

Inheritance diagram for Jellyfin::BaseModelLoader:
Jellyfin::ModelLoader< Model::Item > Jellyfin::ModelLoader< Model::User > Jellyfin::ModelLoader< T > Jellyfin::LoaderModelLoader< T, D, R, P > Jellyfin::ViewModel::AbstractUserParameterLoader< T, D, R, P > Jellyfin::ViewModel::PublicUsersLoader Jellyfin::ViewModel::AlbumArtistLoader Jellyfin::ViewModel::LatestMediaLoader Jellyfin::ViewModel::LiveTvChannelsLoader Jellyfin::ViewModel::NextUpLoader Jellyfin::ViewModel::ResumeItemsLoader Jellyfin::ViewModel::ShowEpisodesLoader Jellyfin::ViewModel::ShowSeasonsLoader Jellyfin::ViewModel::UserItemsLoader Jellyfin::ViewModel::UserViewsLoader

Signals

void ready ()
 
void apiClientChanged (ApiClient *newApiClient)
 
void statusChanged ()
 
void limitChanged (int newLimit)
 
void autoReloadChanged (bool newAutoReload)
 
void modelShouldClear ()
 Emitted when the model should clear itself.
 
void itemsLoaded ()
 
void reloadWanted ()
 

Public Member Functions

 BaseModelLoader (QObject *parent=nullptr)
 
ApiClientapiClient () const
 
void setApiClient (ApiClient *newApiClient)
 
int limit () const
 
void setLimit (int newLimit)
 
bool autoReload () const
 
void setAutoReload (bool newAutoReload)
 
ViewModel::ModelStatus status () const
 
virtual Q_INVOKABLE void reload ()
 Clears and reloads the model.
 
virtual void classBegin () override
 
virtual void componentComplete () override
 
void autoReloadIfNeeded ()
 

Protected Member Functions

void emitModelShouldClear ()
 
void emitItemsLoaded ()
 
void setStatus (ViewModel::ModelStatus newStatus)
 
virtual bool canReload () const
 Determines if this model is able to reload.
 

Protected Attributes

bool m_isBeingParsed = false
 
ApiClientm_apiClient = nullptr
 
bool m_autoReload = true
 
bool m_needsAuthentication = true
 
bool m_manualLimitSet = false
 
int m_limit = -1
 
int m_startIndex = 0
 
int m_totalRecordCount = 0
 
bool m_explicitLimitSet = false
 
const int DEFAULT_LIMIT = 100
 
ViewModel::ModelStatus m_status = ViewModel::ModelStatus::Uninitialised
 

Properties

ApiClientapiClient
 
Jellyfin::ViewModel::ModelStatusClass::Value status
 
int limit
 
bool autoReload
 

Constructor & Destructor Documentation

◆ BaseModelLoader()

Jellyfin::BaseModelLoader::BaseModelLoader ( QObject * parent = nullptr)
explicit

Member Function Documentation

◆ apiClient()

ApiClient * Jellyfin::BaseModelLoader::apiClient ( ) const
inline

◆ apiClientChanged

void Jellyfin::BaseModelLoader::apiClientChanged ( ApiClient * newApiClient)
signal

◆ autoReload()

bool Jellyfin::BaseModelLoader::autoReload ( ) const
inline

◆ autoReloadChanged

void Jellyfin::BaseModelLoader::autoReloadChanged ( bool newAutoReload)
signal

◆ autoReloadIfNeeded()

void Jellyfin::BaseModelLoader::autoReloadIfNeeded ( )

◆ canReload()

bool Jellyfin::BaseModelLoader::canReload ( ) const
protectedvirtual

Determines if this model is able to reload.

The default implementation checks if the user is authenticated, and the model is not reloading. If overriding this method, please call this method as well in determining if the model should be reloadable.

Returns
True if the model can reload, false otherwise.

Reimplemented in Jellyfin::ViewModel::AbstractUserParameterLoader< T, D, R, P >, and Jellyfin::ViewModel::PublicUsersLoader.

◆ classBegin()

void Jellyfin::BaseModelLoader::classBegin ( )
overridevirtual

◆ componentComplete()

void Jellyfin::BaseModelLoader::componentComplete ( )
overridevirtual

◆ emitItemsLoaded()

void Jellyfin::BaseModelLoader::emitItemsLoaded ( )
inlineprotected

◆ emitModelShouldClear()

void Jellyfin::BaseModelLoader::emitModelShouldClear ( )
inlineprotected

◆ itemsLoaded

void Jellyfin::BaseModelLoader::itemsLoaded ( )
signal

Emitted when new items are loaded.

◆ limit()

int Jellyfin::BaseModelLoader::limit ( ) const
inline

◆ limitChanged

void Jellyfin::BaseModelLoader::limitChanged ( int newLimit)
signal

◆ modelShouldClear

void Jellyfin::BaseModelLoader::modelShouldClear ( )
signal

Emitted when the model should clear itself.

◆ ready

void Jellyfin::BaseModelLoader::ready ( )
signal

◆ reload()

virtual Q_INVOKABLE void Jellyfin::BaseModelLoader::reload ( )
inlinevirtual

◆ reloadWanted

void Jellyfin::BaseModelLoader::reloadWanted ( )
signal

◆ setApiClient()

void Jellyfin::BaseModelLoader::setApiClient ( ApiClient * newApiClient)

◆ setAutoReload()

void Jellyfin::BaseModelLoader::setAutoReload ( bool newAutoReload)

◆ setLimit()

void Jellyfin::BaseModelLoader::setLimit ( int newLimit)

◆ setStatus()

void Jellyfin::BaseModelLoader::setStatus ( ViewModel::ModelStatus newStatus)
inlineprotected

◆ status()

ViewModel::ModelStatus Jellyfin::BaseModelLoader::status ( ) const
inline

◆ statusChanged

void Jellyfin::BaseModelLoader::statusChanged ( )
signal

Member Data Documentation

◆ DEFAULT_LIMIT

const int Jellyfin::BaseModelLoader::DEFAULT_LIMIT = 100
protected

◆ m_apiClient

ApiClient* Jellyfin::BaseModelLoader::m_apiClient = nullptr
protected

◆ m_autoReload

bool Jellyfin::BaseModelLoader::m_autoReload = true
protected

◆ m_explicitLimitSet

bool Jellyfin::BaseModelLoader::m_explicitLimitSet = false
protected

◆ m_isBeingParsed

bool Jellyfin::BaseModelLoader::m_isBeingParsed = false
protected

◆ m_limit

int Jellyfin::BaseModelLoader::m_limit = -1
protected

◆ m_manualLimitSet

bool Jellyfin::BaseModelLoader::m_manualLimitSet = false
protected

◆ m_needsAuthentication

bool Jellyfin::BaseModelLoader::m_needsAuthentication = true
protected

◆ m_startIndex

int Jellyfin::BaseModelLoader::m_startIndex = 0
protected

◆ m_status

ViewModel::ModelStatus Jellyfin::BaseModelLoader::m_status = ViewModel::ModelStatus::Uninitialised
protected

◆ m_totalRecordCount

int Jellyfin::BaseModelLoader::m_totalRecordCount = 0
protected

Property Documentation

◆ apiClient

ApiClient * Jellyfin::BaseModelLoader::apiClient
readwrite

◆ autoReload

bool Jellyfin::BaseModelLoader::autoReload
readwrite

◆ limit

int Jellyfin::BaseModelLoader::limit
readwrite

◆ status

Jellyfin::ViewModel::ModelStatusClass::Value Jellyfin::BaseModelLoader::status
read

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