libQuotient
A Qt library for building matrix clients
Quotient::AccountRegistry Class Reference

#include <accountregistry.h>

Inheritance diagram for Quotient::AccountRegistry:
Collaboration diagram for Quotient::AccountRegistry:

Public Types

enum  EventRoles { AccountRole = Qt::UserRole + 1 , ConnectionRole = AccountRole , UserIdRole = Qt::DisplayRole }
 
using vector_t = QVector< Connection * >
 
using const_iterator = vector_t::const_iterator
 
using const_reference = vector_t::const_reference
 

Signals

void accountCountChanged ()
 
void accountsLoadingChanged ()
 
void keychainError (QKeychain::Error error)
 
void loginError (Connection *connection, QString message, QString details)
 
void resolveError (Connection *connection, QString error)
 

Public Member Functions

 AccountRegistry (QObject *parent=nullptr)
 
const vector_taccounts () const
 
void add (Connection *a)
 
void drop (Connection *a)
 
const_iterator begin () const
 
const_iterator end () const
 
const_reference front () const
 
const_reference back () const
 
bool isLoggedIn (const QString &userId) const
 
Connectionget (const QString &userId) const
 
QVariant data (const QModelIndex &index, int role) const override
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
QHash< int, QByteArray > roleNames () const override
 
QStringList accountsLoading () const
 
void invokeLogin ()
 

Properties

int accountCount
 Number of accounts that are currently fully loaded. More...
 
QStringList accountsLoading
 

Detailed Description

Definition at line 16 of file accountregistry.h.

Member Typedef Documentation

◆ const_iterator

using Quotient::AccountRegistry::const_iterator = vector_t::const_iterator

Definition at line 26 of file accountregistry.h.

◆ const_reference

using Quotient::AccountRegistry::const_reference = vector_t::const_reference

Definition at line 27 of file accountregistry.h.

◆ vector_t

Definition at line 25 of file accountregistry.h.

Member Enumeration Documentation

◆ EventRoles

Enumerator
AccountRole 
ConnectionRole 
UserIdRole 

Definition at line 29 of file accountregistry.h.

Constructor & Destructor Documentation

◆ AccountRegistry()

Quotient::AccountRegistry::AccountRegistry ( QObject *  parent = nullptr)
explicit

Member Function Documentation

◆ accountCountChanged

void Quotient::AccountRegistry::accountCountChanged ( )
signal

◆ accounts()

const vector_t& Quotient::AccountRegistry::accounts ( ) const
inline

Definition at line 42 of file accountregistry.h.

◆ accountsLoading()

QStringList Quotient::AccountRegistry::accountsLoading ( ) const

◆ accountsLoadingChanged

void Quotient::AccountRegistry::accountsLoadingChanged ( )
signal

◆ add()

void Quotient::AccountRegistry::add ( Connection a)

◆ back()

const_reference Quotient::AccountRegistry::back ( ) const
inline

Definition at line 48 of file accountregistry.h.

◆ begin()

const_iterator Quotient::AccountRegistry::begin ( ) const
inline

Definition at line 45 of file accountregistry.h.

◆ data()

QVariant Quotient::AccountRegistry::data ( const QModelIndex &  index,
int  role 
) const
override

◆ drop()

void Quotient::AccountRegistry::drop ( Connection a)

◆ end()

const_iterator Quotient::AccountRegistry::end ( ) const
inline

Definition at line 46 of file accountregistry.h.

◆ front()

const_reference Quotient::AccountRegistry::front ( ) const
inline

Definition at line 47 of file accountregistry.h.

◆ get()

Connection* Quotient::AccountRegistry::get ( const QString &  userId) const

◆ invokeLogin()

void Quotient::AccountRegistry::invokeLogin ( )

◆ isLoggedIn()

bool Quotient::AccountRegistry::isLoggedIn ( const QString &  userId) const

◆ keychainError

void Quotient::AccountRegistry::keychainError ( QKeychain::Error  error)
signal

◆ loginError

void Quotient::AccountRegistry::loginError ( Connection connection,
QString  message,
QString  details 
)
signal

◆ resolveError

void Quotient::AccountRegistry::resolveError ( Connection connection,
QString  error 
)
signal

◆ roleNames()

QHash<int, QByteArray> Quotient::AccountRegistry::roleNames ( ) const
override

◆ rowCount()

int Quotient::AccountRegistry::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

Property Documentation

◆ accountCount

int Quotient::AccountRegistry::accountCount
read

Number of accounts that are currently fully loaded.

Definition at line 1 of file accountregistry.h.

◆ accountsLoading

QStringList Quotient::AccountRegistry::accountsLoading
read

List of accounts that are currently in some stage of being loaded (Reading token from keychain, trying to contact server, etc). Can be used to inform the user or to show a login screen if size() == 0 and no accounts are loaded

Definition at line 1 of file accountregistry.h.


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