squawk/ui/models/account.h

58 lines
1.6 KiB
C
Raw Normal View History

2019-04-03 15:09:29 +00:00
#ifndef MODELS_ACCOUNT_H
#define MODELS_ACCOUNT_H
2019-04-03 18:15:36 +00:00
#include "../../global.h"
2019-04-03 15:09:29 +00:00
#include "item.h"
2019-04-03 18:15:36 +00:00
#include <QVariant>
#include <QIcon>
2019-04-03 15:09:29 +00:00
namespace Models {
class Account : public Item {
public:
explicit Account(const QMap<QString, QVariant> &data, Item *parentItem = 0);
~Account();
void setState(unsigned int p_state);
void setState(Shared::ConnectionState p_state);
Shared::ConnectionState getState() const;
2019-04-03 15:09:29 +00:00
void setLogin(const QString& p_login);
QString getLogin() const;
void setServer(const QString& p_server);
QString getServer() const;
void setPassword(const QString& p_password);
QString getPassword() const;
void setResource(const QString& p_resource);
QString getResource() const;
void setError(const QString& p_resource);
QString getError() const;
void setAvailability(Shared::Availability p_avail);
void setAvailability(unsigned int p_avail);
Shared::Availability getAvailability() const;
QIcon getStatusIcon() const;
2019-04-03 15:09:29 +00:00
QVariant data(int column) const override;
int columnCount() const override;
2019-04-03 18:15:36 +00:00
void update(const QString& field, const QVariant& value);
2019-04-03 15:09:29 +00:00
private:
QString login;
QString password;
QString server;
QString resource;
QString error;
Shared::ConnectionState state;
Shared::Availability availability;
2019-04-03 15:09:29 +00:00
};
}
#endif // MODELS_ACCOUNT_H