source: SMSSender/src/business/BCAccountLoadThread.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: 984 bytes
Line 
1#ifndef BCACCOUNTLOADTHREAD_H_
2#define BCACCOUNTLOADTHREAD_H_
3
4#include <QThread>
5#include <QMetaType>
6
7#include <iaccount.h>
8
9#include <stdexceptions.h>
10
11enum AccountLoadState {
12    Unloaded,
13    Loading,
14    Loaded,
15    Cancelling,
16    Cancelled,
17    Failed
18};
19Q_DECLARE_METATYPE(AccountLoadState);
20
21class BCAccountLoadThread : public QThread {
22     Q_OBJECT
23
24public:
25        BCAccountLoadThread(IAccount* account, QObject* parent = 0);
26
27        virtual AccountLoadState loadState();
28        virtual IAccount*        account();
29
30        virtual void cancelLoading();
31
32signals:
33    void loadStateChanged(IAccount* account, AccountLoadState state);
34    void loaded(IAccount* account);
35    void loadingFinished(IAccount* account, AccountLoadState state);
36    void loadingFailed(IAccount* account, EException* exception);
37
38
39 protected:
40     void run();
41     void setLoadState(AccountLoadState loadState);
42
43 private:
44        IAccount*        account_;
45        AccountLoadState loadState_;
46};
47
48#endif /*BCACCOUNTLOADTHREAD_H_*/
Note: See TracBrowser for help on using the repository browser.