Changeset View
Changeset View
Standalone View
Standalone View
src/core/accountmanager.h
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | 38 | public: | |||
---|---|---|---|---|---|
43 | Q_INVOKABLE void addAccount(const QString &accountName, const QString &username, const QString &url, bool enabled = true); | 43 | Q_INVOKABLE void addAccount(const QString &accountName, const QString &username, const QString &url, bool enabled = true); | ||
44 | 44 | | |||
45 | RocketChatAccount *account() const; | 45 | RocketChatAccount *account() const; | ||
46 | RocketChatAccountModel *rocketChatAccountModel() const; | 46 | RocketChatAccountModel *rocketChatAccountModel() const; | ||
47 | 47 | | |||
48 | RocketChatAccountFilterProxyModel *rocketChatAccountProxyModel() const; | 48 | RocketChatAccountFilterProxyModel *rocketChatAccountProxyModel() const; | ||
49 | 49 | | |||
50 | void addAccount(RocketChatAccount *account); | 50 | void addAccount(RocketChatAccount *account); | ||
51 | 51 | void setCurrentAccount(const QString &accountName, bool showLastRoom = true); | |||
52 | void setCurrentAccount(const QString &accountName); | | |||
53 | Q_REQUIRED_RESULT QString currentAccount() const; | 52 | Q_REQUIRED_RESULT QString currentAccount() const; | ||
54 | void selectAccount(const QString &accountName); | 53 | void selectAccount(const QString &accountName); | ||
55 | 54 | | |||
56 | void modifyAccount(const QString &accountName, const QString &username, const QString &url, bool enabled); | 55 | void modifyAccount(const QString &accountName, const QString &username, const QString &url, bool enabled); | ||
57 | Q_REQUIRED_RESULT QStringList accountsName() const; | 56 | Q_REQUIRED_RESULT QStringList accountsName() const; | ||
58 | 57 | | |||
59 | Q_REQUIRED_RESULT int accountNumber() const; | 58 | Q_REQUIRED_RESULT int accountNumber() const; | ||
60 | Q_SIGNALS: | 59 | Q_SIGNALS: | ||
61 | void logoutAccountDone(const QString &accountName); | 60 | void logoutAccountDone(const QString &accountName); | ||
62 | void updateNotification(bool hasAlert, int nbUnread, const QString &accountName); | 61 | void updateNotification(bool hasAlert, int nbUnread, const QString &accountName); | ||
63 | void currentAccountChanged(); | 62 | void currentAccountChanged(bool showLastRoom); | ||
64 | 63 | | |||
65 | private: | 64 | private: | ||
66 | Q_DISABLE_COPY(AccountManager) | 65 | Q_DISABLE_COPY(AccountManager) | ||
67 | 66 | | |||
68 | void loadAccount(); | 67 | void loadAccount(); | ||
69 | void connectToAccount(RocketChatAccount *account); | 68 | void connectToAccount(RocketChatAccount *account); | ||
70 | void slotSwitchToAccountAndRoomName(const QString &accountName, const QString &roomName, const QString &channelType); | 69 | void slotSwitchToAccountAndRoomName(const QString &accountName, const QString &roomName, const QString &channelType); | ||
71 | RocketChatAccount *mCurrentAccount = nullptr; | 70 | RocketChatAccount *mCurrentAccount = nullptr; | ||
72 | RocketChatAccountModel *mRocketChatAccountModel = nullptr; | 71 | RocketChatAccountModel *mRocketChatAccountModel = nullptr; | ||
73 | RocketChatAccountFilterProxyModel *mRocketChatAccountProxyModel = nullptr; | 72 | RocketChatAccountFilterProxyModel *mRocketChatAccountProxyModel = nullptr; | ||
74 | }; | 73 | }; | ||
75 | 74 | | |||
76 | #endif // ACCOUNTMANAGER_H | 75 | #endif // ACCOUNTMANAGER_H |