squawk/core/account.h

48 lines
896 B
C
Raw Normal View History

2019-03-29 14:54:34 +00:00
#ifndef CORE_ACCOUNT_H
#define CORE_ACCOUNT_H
#include <QtCore/QObject>
#include <qxmpp/QXmppClient.h>
#include "../global.h"
2019-03-29 14:54:34 +00:00
namespace Core
{
class Account : public QObject
{
Q_OBJECT
2019-03-29 14:54:34 +00:00
public:
2019-03-30 20:13:13 +00:00
Account(const QString& p_login, const QString& p_server, const QString& p_password, const QString& p_name, QObject* parent = 0);
2019-03-29 14:54:34 +00:00
~Account();
void connect();
void disconnect();
Shared::ConnectionState getState() const;
QString getName() const;
QString getLogin() const;
QString getServer() const;
QString getPassword() const;
signals:
void connectionStateChanged(int);
2019-03-29 14:54:34 +00:00
private:
2019-03-30 20:13:13 +00:00
QString name;
QString login;
QString server;
2019-03-29 14:54:34 +00:00
QString password;
QXmppClient client;
Shared::ConnectionState state;
private slots:
void onClientConnected();
2019-04-02 15:46:18 +00:00
void onClientDisconnected();
2019-03-29 14:54:34 +00:00
};
}
#endif // CORE_ACCOUNT_H