Debian Codegraph @

Dekko/backend/autoconfig/srvlookup.h

raw symbols SCIP
1 /* Copyright (C) 2015 Dan Chapman <[email protected]>
2
3 This program is free software; you can redistribute it and/or
4 modify it under the terms of the GNU General Public License as
5 published by the Free Software Foundation; either version 2 of
6 the License or (at your option) version 3
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16 #ifndef SRVLOOKUP_H
17 #define SRVLOOKUP_H
18
19 #include <QObject>
20 #include <QDnsLookup>
21 #include <QDnsServiceRecord>
22 #include <QPointer>
23 #include "serverconfiguration.h"
24
25 class SrvLookup : public QObject
26 {
27 Q_OBJECT
28 public:
29 SrvLookup(QObject *parent, ServerConfiguration *config);
30
31 enum LookupType {
32 INVALID,
33 IMAPS,
34 IMAP,
35 SUBMISSION
36 };
37
38 signals:
39 void success(ServerConfiguration *serverConfig);
40 void failed();
41
42 public slots:
43 void lookUp(const QString &domain);
44
45 private slots:
46 void buildNextRequest();
47 void handleLookUpResult();
48 void handleReceivedRecords();
49 void addRecordToConfig(const QDnsServiceRecord &record);
50
51 private:
52 QPointer<QDnsLookup> m_dns;
53 QPointer<ServerConfiguration> m_serverConfig;
54 LookupType m_lookupType;
55 QString m_domain;
56 };
57
58 #endif // SRVLOOKUP_H