source: SMSSender/gateways/CoopMobile/business/contactimporter/contactimporter.h @ 461:6282b93fcfca

new-gtwy-coopmobile
Last change on this file since 461:6282b93fcfca was 461:6282b93fcfca, checked in by Sämy Zehnder <saemy.zehnder@…>, 4 years ago

Implements the contact importer for the CoopMobile? gateway.

File size: 2.0 KB
Line 
1/*
2  Coop Mobile gateway plugin - The smssender plugin for the Coop Mobile platform.
3  Copyright (C) 2014-2015, gorrión. See http://smssender.gorrion.ch
4
5  This program is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  GNU General Public License for more details.
14
15  You should have received a copy of the GNU General Public License
16  along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 */
18#ifndef COOPMOBILE_CONTACTIMPORTER_CONTACTIMPORTER_H
19#define COOPMOBILE_CONTACTIMPORTER_CONTACTIMPORTER_H
20
21#include <QScopedPointer>
22#include <QString>
23
24#include "common/business/icontactimporter.h"
25#include "common/business/iintegration.h"
26#include "common/domain/scontact.h"
27#include "gateways/CoopMobile/business/account.h"
28
29class IGateway;
30
31namespace CoopMobile {
32
33class ContactImporterDataManager;
34
35class ContactImporter : public IContactImporter {
36public:
37    explicit ContactImporter(Account *account);
38
39public: /* IContactImporter */
40    util::Status importContacts(QSet<SContact *> *contacts) MUST_USE_RESULT;
41
42    class Builder : public IContactImporter::Builder {
43    public:
44        explicit Builder(IAccountIntegrationHelper *accountHelper);
45
46    public: /* IContactImporter::Builder */
47        QString description() const;
48        bool isApplicable() const;
49
50        void createImporters(QSet<IContactImporter *> *importers);
51
52    private:
53        IAccountIntegrationHelper *m_accountHelper;
54
55        Q_DISABLE_COPY(Builder)
56    };
57
58private:
59    util::Status parseContacts(const QString &html, QSet<SContact *> *contacts);
60
61private:
62    Account * const m_account;
63
64    Q_DISABLE_COPY(ContactImporter)
65};
66
67} // namespace CoopMobile
68
69#endif /* COOPMOBILE_CONTACTIMPORTER_CONTACTIMPORTER_H */
Note: See TracBrowser for help on using the repository browser.