source: SMSSender/gateways/SwisscomXtraZone/src/business/BCGateway.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.7 KB
Line 
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 <abstract/abstractlogingateway.h>
12#include <persistence/istorage.h>
13
14
15namespace SwisscomXtraZone {
16
17const QString LOGIN_PAGE  = "https://www.swisscom-mobile.ch/youth/sms_senden-de.aspx?login";
18const QString MAIN_PAGE   = "https://www.swisscom-mobile.ch/youth/sms_senden-de.aspx";
19const QString LOGOUT_PAGE = "https://www.swisscom-mobile.ch/youth/youth_zone_home-de.aspx?logout";
20
21class BCGateway: public AbstractLoginGateway {
22    Q_OBJECT
23
24public:
25    static AbstractLoginGateway*  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
46protected:
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
56private:
57    static AbstractLoginGateway* 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_ */
Note: See TracBrowser for help on using the repository browser.