Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CProfileManager Class Reference

#include <ProfileManager.h>

Inheritance diagram for CProfileManager:
ISettingsHandler ISettingCallback

Public Member Functions

 CProfileManager ()
 
 CProfileManager (const CProfileManager &)=delete
 
CProfileManageroperator= (CProfileManager const &)=delete
 
 ~CProfileManager () override
 
void Initialize (const std::shared_ptr< CSettings > &settings)
 
void Uninitialize ()
 
void OnSettingsLoaded () override
 Settings have been loaded.
 
void OnSettingsSaved () const override
 Settings have been saved.
 
void OnSettingsCleared () override
 Settings have been cleared.
 
bool Load ()
 
bool Save () const
 Load the user profile information from disk Loads the profiles.xml file and creates the list of profiles. If no profiles exist, a master user is created. Should be called after special://masterprofile/ has been defined.
 
void Clear ()
 Save the user profile information to disk Saves the list of profiles to the profiles.xml file.
 
bool LoadProfile (unsigned int index)
 
void LogOff ()
 
bool DeleteProfile (unsigned int index)
 
void CreateProfileFolders ()
 
const CProfileGetMasterProfile () const
 Retrieve the master profile.
 
const CProfileGetCurrentProfile () const
 Retrieve the current profile.
 
const CProfileGetProfile (unsigned int index) const
 Retrieve the profile from an index.
 
CProfileGetProfile (unsigned int index)
 Retrieve the profile from an index.
 
int GetProfileIndex (const std::string &name) const
 Retrieve index of a particular profile by name.
 
size_t GetNumberOfProfiles () const
 Retrieve the number of profiles.
 
void AddProfile (const CProfile &profile)
 Add a new profile.
 
bool UsingLoginScreen () const
 Are we using the login screen?
 
void ToggleLoginScreen ()
 Toggle login screen use on and off Toggles the login screen state.
 
bool IsMasterProfile () const
 Are we the master user?
 
void UpdateCurrentProfileDate ()
 Update the date of the current profile.
 
void LoadMasterProfileForLogin ()
 Load the master user for the purposes of logging in Loads the master user. Identical to LoadProfile(0) but doesn't update the last logged in details.
 
uint32_t GetLastUsedProfileIndex () const
 Retrieve the last used profile index.
 
uint32_t GetCurrentProfileIndex () const
 Retrieve the current profile index.
 
int GetNextProfileId () const
 Retrieve the next id to use for a new profile.
 
int GetCurrentProfileId () const
 
int GetAutoLoginProfileId () const
 Retrieve the autologin profile id Retrieves the autologin profile id. When set to -1, then the last used profile will be loaded.
 
void SetAutoLoginProfileId (const int profileId)
 Retrieve the autologin profile id Retrieves the autologin profile id. When set to -1, then the last used profile will be loaded.
 
bool GetProfileName (const unsigned int profileId, std::string &name) const
 Retrieve the name of a particular profile by index.
 
std::string GetUserDataFolder () const
 
std::string GetProfileUserDataFolder () const
 
std::string GetDatabaseFolder () const
 
std::string GetCDDBFolder () const
 
std::string GetThumbnailsFolder () const
 
std::string GetVideoThumbFolder () const
 
std::string GetBookmarksThumbFolder () const
 
std::string GetLibraryFolder () const
 
std::string GetSavestatesFolder () const
 
std::string GetSettingsFile () const
 
std::string GetUserDataItem (const std::string &strFile) const
 
CEventLogGetEventLog ()
 

Protected Member Functions

void OnSettingAction (const std::shared_ptr< const CSetting > &setting) override
 The given setting has been activated.
 
- Protected Member Functions inherited from ISettingsHandler
virtual ~ISettingsHandler ()=default
 
virtual bool OnSettingsLoading ()
 Settings loading has been initiated.
 
virtual bool OnSettingsSaving () const
 Settings saving has been initiated.
 
virtual void OnSettingsUnloaded ()
 Setting values have been unloaded.
 
- Protected Member Functions inherited from ISettingCallback
virtual ~ISettingCallback ()=default
 
virtual bool OnSettingChanging (const std::shared_ptr< const CSetting > &setting)
 The value of the given setting is being changed.
 
virtual void OnSettingChanged (const std::shared_ptr< const CSetting > &setting)
 The value of the given setting has changed.
 
virtual bool OnSettingUpdate (const std::shared_ptr< CSetting > &setting, const char *oldSettingId, const TiXmlNode *oldSettingNode)
 The given setting needs to be updated.
 
virtual void OnSettingPropertyChanged (const std::shared_ptr< const CSetting > &setting, const char *propertyName)
 The given property of the given setting has changed.
 

Constructor & Destructor Documentation

◆ CProfileManager() [1/2]

CProfileManager::CProfileManager ( )

◆ CProfileManager() [2/2]

CProfileManager::CProfileManager ( const CProfileManager & )
delete

◆ ~CProfileManager()

CProfileManager::~CProfileManager ( )
overridedefault

Member Function Documentation

◆ AddProfile()

void CProfileManager::AddProfile ( const CProfile & profile)

Add a new profile.

Parameters
profileCProfile to add

◆ Clear()

void CProfileManager::Clear ( )

Save the user profile information to disk Saves the list of profiles to the profiles.xml file.

Parameters
fileXML file to save.
Returns
true on success, false on failure to save

◆ CreateProfileFolders()

void CProfileManager::CreateProfileFolders ( )

◆ DeleteProfile()

bool CProfileManager::DeleteProfile ( unsigned int index)

◆ GetAutoLoginProfileId()

int CProfileManager::GetAutoLoginProfileId ( ) const
inline

Retrieve the autologin profile id Retrieves the autologin profile id. When set to -1, then the last used profile will be loaded.

Returns
the id to the autologin profile

◆ GetBookmarksThumbFolder()

std::string CProfileManager::GetBookmarksThumbFolder ( ) const

◆ GetCDDBFolder()

std::string CProfileManager::GetCDDBFolder ( ) const

◆ GetCurrentProfile()

const CProfile & CProfileManager::GetCurrentProfile ( ) const

Retrieve the current profile.

Returns
const reference to the current profile

◆ GetCurrentProfileId()

int CProfileManager::GetCurrentProfileId ( ) const
inline

◆ GetCurrentProfileIndex()

uint32_t CProfileManager::GetCurrentProfileIndex ( ) const
inline

Retrieve the current profile index.

Returns
the index of the currently logged in profile.

◆ GetDatabaseFolder()

std::string CProfileManager::GetDatabaseFolder ( ) const

◆ GetEventLog()

CEventLog & CProfileManager::GetEventLog ( )

◆ GetLastUsedProfileIndex()

uint32_t CProfileManager::GetLastUsedProfileIndex ( ) const
inline

Retrieve the last used profile index.

Returns
the last used profile that logged in. Does not count the master user during login.

◆ GetLibraryFolder()

std::string CProfileManager::GetLibraryFolder ( ) const

◆ GetMasterProfile()

const CProfile & CProfileManager::GetMasterProfile ( ) const

Retrieve the master profile.

Returns
const reference to the master profile

◆ GetNextProfileId()

int CProfileManager::GetNextProfileId ( ) const
inline

Retrieve the next id to use for a new profile.

Returns
the unique <id> to be used when creating a new profile

◆ GetNumberOfProfiles()

size_t CProfileManager::GetNumberOfProfiles ( ) const
inline

Retrieve the number of profiles.

Returns
number of profiles

◆ GetProfile() [1/2]

CProfile * CProfileManager::GetProfile ( unsigned int index)

Retrieve the profile from an index.

Parameters
unsignedindex of the profile to retrieve
Returns
pointer to the profile, NULL if the index is invalid

◆ GetProfile() [2/2]

const CProfile * CProfileManager::GetProfile ( unsigned int index) const

Retrieve the profile from an index.

Parameters
unsignedindex of the profile to retrieve
Returns
const pointer to the profile, NULL if the index is invalid

◆ GetProfileIndex()

int CProfileManager::GetProfileIndex ( const std::string & name) const

Retrieve index of a particular profile by name.

Parameters
namename of the profile index to retrieve
Returns
index of this profile, -1 if invalid.

◆ GetProfileName()

bool CProfileManager::GetProfileName ( const unsigned int profileId,
std::string & name ) const

Retrieve the name of a particular profile by index.

Parameters
profileIdprofile index for which to retrieve the name
namewill hold the name of the profile when a valid profile index has been provided
Returns
false if profileId is an invalid index, true if the name parameter is set

◆ GetProfileUserDataFolder()

std::string CProfileManager::GetProfileUserDataFolder ( ) const

◆ GetSavestatesFolder()

std::string CProfileManager::GetSavestatesFolder ( ) const

◆ GetSettingsFile()

std::string CProfileManager::GetSettingsFile ( ) const

◆ GetThumbnailsFolder()

std::string CProfileManager::GetThumbnailsFolder ( ) const

◆ GetUserDataFolder()

std::string CProfileManager::GetUserDataFolder ( ) const

◆ GetUserDataItem()

std::string CProfileManager::GetUserDataItem ( const std::string & strFile) const

◆ GetVideoThumbFolder()

std::string CProfileManager::GetVideoThumbFolder ( ) const

◆ Initialize()

void CProfileManager::Initialize ( const std::shared_ptr< CSettings > & settings)

◆ IsMasterProfile()

bool CProfileManager::IsMasterProfile ( ) const
inline

Are we the master user?

Returns
true if the current profile is the master user, false otherwise

◆ Load()

bool CProfileManager::Load ( )

◆ LoadMasterProfileForLogin()

void CProfileManager::LoadMasterProfileForLogin ( )

Load the master user for the purposes of logging in Loads the master user. Identical to LoadProfile(0) but doesn't update the last logged in details.

◆ LoadProfile()

bool CProfileManager::LoadProfile ( unsigned int index)

◆ LogOff()

void CProfileManager::LogOff ( )

◆ OnSettingAction()

void CProfileManager::OnSettingAction ( const std::shared_ptr< const CSetting > & setting)
overrideprotectedvirtual

The given setting has been activated.

This callback is triggered whenever the given setting has been activated. This callback is only fired for CSettingAction settings.

Parameters
settingThe setting which has been activated.

Reimplemented from ISettingCallback.

◆ OnSettingsCleared()

void CProfileManager::OnSettingsCleared ( )
overridevirtual

Settings have been cleared.

This callback can be used to trigger clearing any state variables.

Reimplemented from ISettingsHandler.

◆ OnSettingsLoaded()

void CProfileManager::OnSettingsLoaded ( )
overridevirtual

Settings have been loaded.

This callback can be used to trigger loading other settings.

Reimplemented from ISettingsHandler.

◆ OnSettingsSaved()

void CProfileManager::OnSettingsSaved ( ) const
overridevirtual

Settings have been saved.

This callback can be used to trigger saving other settings.

Reimplemented from ISettingsHandler.

◆ operator=()

CProfileManager & CProfileManager::operator= ( CProfileManager const & )
delete

◆ Save()

bool CProfileManager::Save ( ) const

Load the user profile information from disk Loads the profiles.xml file and creates the list of profiles. If no profiles exist, a master user is created. Should be called after special://masterprofile/ has been defined.

Parameters
fileXML file to load.

◆ SetAutoLoginProfileId()

void CProfileManager::SetAutoLoginProfileId ( const int profileId)
inline

Retrieve the autologin profile id Retrieves the autologin profile id. When set to -1, then the last used profile will be loaded.

Returns
the id to the autologin profile

◆ ToggleLoginScreen()

void CProfileManager::ToggleLoginScreen ( )
inline

Toggle login screen use on and off Toggles the login screen state.

◆ Uninitialize()

void CProfileManager::Uninitialize ( )

◆ UpdateCurrentProfileDate()

void CProfileManager::UpdateCurrentProfileDate ( )

Update the date of the current profile.

◆ UsingLoginScreen()

bool CProfileManager::UsingLoginScreen ( ) const
inline

Are we using the login screen?

Returns
true if we're using the login screen, false otherwise

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