source: SMSSender/lib/libdatatypes/src/abstract/abstractaccount.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: 2.0 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
14#include "eventmappers/saccounteventmapper.h"
15
16class AbstractAccount: public QObject, public IAccount {
17    Q_OBJECT
18    Q_INTERFACES(IAccount)
19
20public:
21    AbstractAccount(IStorageOfficer* storageOfficer, IValidator* validator);
22
23    /* IAccount */
24    int         id() const;
25    void        setId(int id);
26
27    QString     name() const;
28    void        setName(const QString& name);
29
30    bool        isEnabled() const;
31    void        setEnabled(bool enabled);
32
33    int         freeSMSCount() const;
34
35    void        initialize();
36    bool        isInitializing();
37    bool        isInitialized();
38    void        stopInitializing();
39    void        unInitialize();
40
41    bool        isSendingCanceled();
42    void        cancelSMSSending();
43
44    virtual SAccountEventMapper* eventMapper() const;
45
46    /* IValidatable */
47    virtual IValidator*      getValidator() const;
48
49    /* IStorable */
50    virtual IStorageOfficer* getStorageOfficer() const;
51
52protected:
53    virtual void        setStatus(const QString& status, int progress = -1, const ProgressMethod& progressMethod = SetProgress);
54    virtual void        setProgress(int progress, const ProgressMethod& progressMethod = SetProgress);
55    virtual void        setFreeSMSCount(const int freeSMSCount);
56
57    virtual void        doInitialize() =0;
58
59    /* IAccount */
60    virtual void        uncancelSendingSMS();
61
62    virtual IAccountEvents* accountEvents() const;
63
64private:
65    SAccountEventMapper* eventMapper_;
66
67    int     id_;
68    QString name_;
69
70    bool    enabled_;
71
72    QString status_;
73    int     progress_;
74    int     freeSMSCount_;
75
76    bool    initializing_;
77    bool    initialized_;
78    bool    stoppingInitialization_;
79
80    bool    cancelSMSSending_;
81
82    IStorageOfficer* storageOfficer_;
83    IValidator*      validator_;
84
85    void    setInitialized(bool initialized);
86};
87
88#endif /* ABSTRACTACCOUNT_H_ */
Note: See TracBrowser for help on using the repository browser.