source: SMSSender/lib/libdatatypes/src/abstract/abstractloginaccount.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.3 KB
Line 
1/*
2 * AbstractAccount.h
3 *
4 *  Created on: Jul 9, 2009
5 *      Author: saemy
6 */
7
8#ifndef ABSTRACTLOGINACCOUNT_H_
9#define ABSTRACTLOGINACCOUNT_H_
10
11#include "abstractaccount.h"
12
13#include "abstractlogingateway.h"
14
15#include "eventmappers/sloginaccounteventmapper.h"
16
17namespace LoginAccount {
18    class Status: public Account::Status {
19    public:
20        static const QString Login;
21        static const QString Logout;
22    };
23}
24
25class AbstractLoginAccount: public AbstractAccount {
26    Q_OBJECT
27
28public:
29    AbstractLoginAccount(IStorageOfficer* storageOfficer, IValidator* validator);
30
31    virtual AbstractLoginGateway* gateway() const =0;
32
33    QString   username() const;
34    void      setUsername(const QString& username);
35
36    QString   password() const;
37    void      setPassword(const QString& password);
38
39    bool      isLoggedIn();
40    void      login();
41    void      logout(bool FORCE = false);
42
43    virtual SLoginAccountEventMapper* eventMapper() const;
44
45protected:
46    virtual void      setLoggedIn(bool newLoggedIn);
47
48    virtual void      doLogin() =0;
49    virtual void      doLogout() =0;
50    virtual bool      stillLoggedIn() =0;
51
52    virtual ILoginAccountEvents* accountEvents() const;
53
54private:
55    SLoginAccountEventMapper* eventMapper_;
56
57    QString username_;
58    QString password_;
59
60    bool    loggedIn_;
61};
62
63#endif /* ABSTRACTLOGINACCOUNT_H_ */
Note: See TracBrowser for help on using the repository browser.