source: SMSSender/src/business/BCAccountLoadManager.h @ 71:415b45c71663

3.0
Last change on this file since 71:415b45c71663 was 71:415b45c71663, checked in by Sämy Zehnder <saemy.zehnder@…>, 12 years ago
  • Reorganized all the libraries. libinterfaces and libgateways are removed now and libdatatypes contains now all these files.
File size: 1.6 KB
Line 
1/*
2 * BCAccountLoadManager.h
3 *
4 *  Created on: Aug 30, 2009
5 *      Author: saemy
6 */
7
8#ifndef BCACCOUNTLOADMANAGER_H_
9#define BCACCOUNTLOADMANAGER_H_
10
11#include <QMap>
12#include <QSet>
13
14#include <iaccount.h>
15#include <stdexceptions.h>
16
17#include "BCAccountLoadThread.h"
18
19class BCAccountLoadManager : public QObject {
20    Q_OBJECT
21
22public:
23    static BCAccountLoadManager* instance();
24
25    virtual void             loadAccount(IAccount* account);
26    virtual bool             isAccountLoading(IAccount* account);
27    virtual void             cancelAccountLoading(IAccount* account);
28    virtual AccountLoadState getLoadStateOfAccount(IAccount* account);
29
30    virtual void loadAccounts(const QSet<IAccount*>& accounts);
31
32signals:
33    void accountLoadStateChanged(IAccount* account, AccountLoadState state);
34    void accountLoaded(IAccount* account);
35    void accountLoadingFinished(IAccount* account, AccountLoadState state);
36    void accountLoadingFailed(IAccount* account, EException* exception);
37
38protected:
39    BCAccountLoadManager(){}
40    virtual ~BCAccountLoadManager();
41
42    virtual BCAccountLoadThread* getAccountLoadThread(IAccount* account);
43
44protected slots:
45    void accountLoadThreadLoadStateChanged(IAccount* account, AccountLoadState state);
46    void accountLoadThreadLoaded(IAccount* account);
47    void accountLoadThreadLoadingFinished(IAccount* account, AccountLoadState state);
48    void accountLoadThreadLoadingFailed(IAccount* account, EException* exception);
49
50
51private:
52    static BCAccountLoadManager* instance_;
53
54    QMap<IAccount*, BCAccountLoadThread*> accountLoadThreads_;
55};
56//Q_DECLARE_METATYPE(BCAccountLoadManager);
57
58#endif /* BCACCOUNTLOADMANAGER_H_ */
Note: See TracBrowser for help on using the repository browser.