source: SMSSender/frontend/business/accountinitmanager.h @ 316:16f8e7f93ca4

separation-frontend-backend
Last change on this file since 316:16f8e7f93ca4 was 316:16f8e7f93ca4, checked in by Sämy Zehnder <saemy.zehnder@…>, 8 years ago
  • Adds the copyright header to each file and updates the development period.
File size: 2.0 KB
Line 
1/*
2 smssender - A frontend for fast and easy SMS sending over different gateways.
3 Copyright (C) 2007-2014, gorrión. See http://smssender.gorrion.ch
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 */
18#ifndef ACCOUNTINITMANAGER_H_
19#define ACCOUNTINITMANAGER_H_
20
21#include <QList>
22
23#include "common/business/iaccount.h"
24#include "common/exceptions/stdexceptions.h"
25
26class AccountInitManager : public QObject {
27    Q_OBJECT
28
29public:
30    /**
31     * Starts the initialization process of the given account and connects
32     * the signals to it.
33     * If the account is already initialized, nothing happens.
34     * If the account is already initializing, we only connect to the signals, if not already done.
35     *
36     * @param account The to be initialized account
37     */
38    virtual void initAccount(IAccount* account);
39
40    /**
41     * Starts the initialization process of the given accounts.
42     *
43     * @param accounts The to be initialized accounts
44     */
45    virtual void initAccounts(const QSet<IAccount*> &accounts);
46
47signals:
48    void accountInitStateChanged(IAccount* account); // Called when a account gets initialized or un-initialized
49    void accountInitFinished(IAccount* account, STask::Result result);
50    void accountInitFailed(IAccount* account, const EException &exception);
51
52private slots:
53    void onAccountInitFinished(STask* task);
54    void onAccountInitFailed(STask* task);
55
56private:
57    QSet<IAccount*> m_initializingAccounts;
58};
59
60#endif /* ACCOUNTINITMANAGER_H_ */
Note: See TracBrowser for help on using the repository browser.