1 | /* |
---|
2 | * BCGateway.h |
---|
3 | * |
---|
4 | * Created on: Jul 9, 2009 |
---|
5 | * Author: saemy |
---|
6 | */ |
---|
7 | |
---|
8 | #ifndef SWISSCOMXTRAZONE_BCGATEWAY_H_ |
---|
9 | #define SWISSCOMXTRAZONE_BCGATEWAY_H_ |
---|
10 | |
---|
11 | #include <AbstractLoginGateway.h> |
---|
12 | #include <persistence/istorage.h> |
---|
13 | |
---|
14 | |
---|
15 | namespace SwisscomXtraZone { |
---|
16 | |
---|
17 | const QString LOGIN_PAGE = "https://www.swisscom-mobile.ch/youth/sms_senden-de.aspx?login"; |
---|
18 | const QString MAIN_PAGE = "https://www.swisscom-mobile.ch/youth/sms_senden-de.aspx"; |
---|
19 | const QString LOGOUT_PAGE = "https://www.swisscom-mobile.ch/youth/youth_zone_home-de.aspx?logout"; |
---|
20 | |
---|
21 | class BCGateway: public AbstractLoginGateway { |
---|
22 | Q_OBJECT |
---|
23 | |
---|
24 | public: |
---|
25 | static ILoginGateway* instance(); |
---|
26 | |
---|
27 | /* IGateway */ |
---|
28 | QString name() const; |
---|
29 | QImage icon() const; |
---|
30 | QSet<int> validRecipientCountryCodes() const; |
---|
31 | |
---|
32 | IAccount* createAccountInstance(IStorage* storage) const; |
---|
33 | |
---|
34 | QList<QString> splitTextToLongSMS(const QString& text) const; |
---|
35 | QList<QString> splitTextToShortSMS(const QString& text) const; |
---|
36 | |
---|
37 | IAccountSettingsWidget* getAccountSettingsWidget(QWidget* parent = 0) const; |
---|
38 | |
---|
39 | |
---|
40 | QString addonText() const; |
---|
41 | void setAddonText(const QString& addonText); |
---|
42 | |
---|
43 | int longSMSLength() const; |
---|
44 | void setLongSMSLength(int longSMSLength); |
---|
45 | |
---|
46 | protected: |
---|
47 | BCGateway() |
---|
48 | : AbstractLoginGateway() |
---|
49 | |
---|
50 | , SHORTSMS_LENGTH(160) |
---|
51 | |
---|
52 | , addonText_("") |
---|
53 | , longSMSLength_(SHORTSMS_LENGTH*3) // Don't initialize it with 0 because splitTextToSMS would not work otherwise |
---|
54 | {}; |
---|
55 | |
---|
56 | private: |
---|
57 | static ILoginGateway* instance_; |
---|
58 | |
---|
59 | const int SHORTSMS_LENGTH; |
---|
60 | |
---|
61 | QString addonText_; |
---|
62 | int longSMSLength_; |
---|
63 | |
---|
64 | Q_DISABLE_COPY(BCGateway); |
---|
65 | |
---|
66 | }; |
---|
67 | |
---|
68 | } |
---|
69 | |
---|
70 | #endif /* SWISSCOMXTRAZONE_BCGATEWAY_H_ */ |
---|