source: SMSSender/lib/libgateway/src/business/AbstractAccount.h @ 67:578192d6fe64

3.0
Last change on this file since 67:578192d6fe64 was 67:578192d6fe64, checked in by Sämy Zehnder <saemy.zehnder@…>, 12 years ago
  • added synchttp
  • backup before removing these diamond interfaces...
File size: 2.1 KB
Line 
1/*
2 * AbstractAccount.h
3 *
4 *  Created on: Jul 9, 2009
5 *      Author: saemy
6 */
7
8#ifndef ABSTRACTACCOUNT_H_
9#define ABSTRACTACCOUNT_H_
10
11#include <iaccount.h>
12#include <persistence/istorageofficer.h>
13
14class AbstractAccount: public QObject, virtual public IAccount {
15    Q_OBJECT
16    Q_INTERFACES(IAccount)
17
18public:
19    AbstractAccount(IStorageOfficer* storageOfficer, IValidator* validator);
20
21    /* IAccount */
22    virtual int         id() const;
23    virtual void        setId(int id);
24
25    virtual QString     name() const;
26    virtual void        setName(const QString& name);
27
28    virtual bool        isEnabled() const;
29    virtual void        setEnabled(bool enabled);
30
31    virtual int         freeSMSCount() const;
32
33    virtual void        initialize();
34    virtual bool        isInitializing();
35    virtual bool        isInitialized();
36    virtual void        stopInitializing();
37    virtual void        unInitialize();
38
39    virtual bool        isSendingCanceled();
40    virtual void        cancelSMSSending();
41
42    AccountEventMapper* eventMapper() const;
43
44    /* IValidatable */
45    virtual IValidator*      getValidator() const;
46
47    /* IStorable */
48    virtual IStorageOfficer* getStorageOfficer() const;
49
50protected:
51    virtual void        setStatus(const QString& status, int progress = -1, const ProgressMethod& progressMethod = SetProgress);
52    virtual void        setProgress(int progress, const ProgressMethod& progressMethod = SetProgress);
53    virtual void        setFreeSMSCount(const int freeSMSCount);
54
55    virtual void        doInitialize() =0;
56
57    /* IAccount */
58    virtual void        uncancelSendingSMS();
59
60    virtual IAccountEvents* accountEvents() const;
61
62private:
63    AccountEventMapper* eventMapper_;
64
65    int     id_;
66    QString name_;
67
68    bool    enabled_;
69
70    QString status_;
71    int     progress_;
72    int     freeSMSCount_;
73
74    bool    initializing_;
75    bool    initialized_;
76    bool    stoppingInitialization_;
77
78    bool    cancelSMSSending_;
79
80    IStorageOfficer* storageOfficer_;
81    IValidator*      validator_;
82
83    void    setInitialized(bool initialized);
84};
85
86#endif /* ABSTRACTACCOUNT_H_ */
Note: See TracBrowser for help on using the repository browser.