source: SMSSender/src/business/BCAccountLoadManager.h @ 36:514d2b57d7bd

3.0
Last change on this file since 36:514d2b57d7bd was 36:514d2b57d7bd, checked in by Sämy Zehnder <saemy.zehnder@…>, 13 years ago
  • Started implementing VCEditAccount and VCAccountList. But this version is for backup purpose only! It's not running correctly in the moment.
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
16#include "BCAccountLoadThread.h"
17
18class BCAccountLoadManager : public QObject {
19    Q_OBJECT
20
21public:
22    static BCAccountLoadManager* instance();
23
24    virtual void             loadAccount(IAccount* account);
25    virtual bool             isAccountLoading(IAccount* account);
26    virtual void             cancelAccountLoading(IAccount* account);
27    virtual AccountLoadState getLoadStateOfAccount(IAccount* account);
28
29    virtual void loadAccounts(const QSet<IAccount*>& accounts);
30
31signals:
32    void accountLoadStateChanged(IAccount* account, AccountLoadState state);
33    void accountLoaded(IAccount* account);
34    void accountLoadingFinished(IAccount* account, AccountLoadState state);
35    void accountLoadingFailed(IAccount* account, EException* exception);
36
37protected:
38    BCAccountLoadManager(){}
39    virtual ~BCAccountLoadManager();
40
41    virtual BCAccountLoadThread* getAccountLoadThread(IAccount* account);
42
43protected slots:
44    void accountLoadThreadLoadStateChanged(IAccount* account, AccountLoadState state);
45    void accountLoadThreadLoaded(IAccount* account);
46    void accountLoadThreadLoadingFinished(IAccount* account, AccountLoadState state);
47    void accountLoadThreadLoadingFailed(IAccount* account, EException* exception);
48
49
50private:
51    static BCAccountLoadManager* instance_;
52
53    QMap<IAccount*, BCAccountLoadThread*> accountLoadThreads_;
54};
55//Q_DECLARE_METATYPE(BCAccountLoadManager);
56
57#endif /* BCACCOUNTLOADMANAGER_H_ */
Note: See TracBrowser for help on using the repository browser.