Skip to content

Latest commit

 

History

History
102 lines (89 loc) · 3.44 KB

declarativeconnectionagent.h

File metadata and controls

102 lines (89 loc) · 3.44 KB
 
Mar 19, 2013
Mar 19, 2013
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@gmail.com
**
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
****************************************************************************/
Jul 7, 2015
Jul 7, 2015
17
18
#ifndef DECLARATIVECONNECTIONAGENT_H
#define DECLARATIVECONNECTIONAGENT_H
Mar 18, 2013
Mar 18, 2013
19
Jul 7, 2015
Jul 7, 2015
20
#include "declarativeconnectionagent.h"
Jul 11, 2014
Jul 11, 2014
21
#include "connectiond_interface.h"
Mar 18, 2013
Mar 18, 2013
22
Jul 7, 2015
Jul 7, 2015
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
*This class is for accessing connman's UserAgent from multiple sources.
*This is because currently, there can only be one UserAgent per system.
*
*It also makes use of a patch to connman, that allows the UserAgent
*to get signaled when a connection is needed. This is the real reason
*this daemon is needed. An InputRequest is short lived, and thus, may
*not clash with other apps that need to use UserAgent.
*
*When you are trying to intercept a connection request, you need a long
*living process to wait until such time. This will immediately clash if
*a wlan needs user Input signal from connman, and the configure will never
*get the proper signal.
*
*This qml type can be used as such:
*
*import com.jolla.connection 1.0
*
* ConnectionAgent {
* id: userAgent
* onUserInputRequested: {
* console.log(" onUserInputRequested:")
* }
*
* onConnectionRequest: {
* console.log("onConnectionRequest ")
* sendSuppress()
* }
* onErrorReported: {
* console.log("Got error from connman: " + error);
* }
* }
*
**/
class DeclarativeConnectionAgent : public QObject
Mar 18, 2013
Mar 18, 2013
59
60
{
Q_OBJECT
Apr 16, 2013
Apr 16, 2013
61
Jul 7, 2015
Jul 7, 2015
62
Q_DISABLE_COPY(DeclarativeConnectionAgent)
Apr 30, 2014
Apr 30, 2014
63
Mar 18, 2013
Mar 18, 2013
64
public:
Jul 7, 2015
Jul 7, 2015
65
66
explicit DeclarativeConnectionAgent(QObject *parent = 0);
~DeclarativeConnectionAgent();
Mar 18, 2013
Mar 18, 2013
67
68
69
70
public slots:
void sendUserReply(const QVariantMap &input);
void sendConnectReply(const QString &replyMessage, int timeout = 120);
Mar 20, 2013
Mar 20, 2013
71
void connectToType(const QString &type);
Apr 30, 2014
Apr 30, 2014
72
void startTethering(const QString &type);
Jul 11, 2014
Jul 11, 2014
73
void stopTethering(bool keepPowered = false);
Mar 18, 2013
Mar 18, 2013
74
75
76
77
signals:
void userInputRequested(const QString &servicePath, const QVariantMap &fields);
void userInputCanceled();
Jun 7, 2013
Jun 7, 2013
78
void errorReported(const QString &servicePath, const QString &error);
Mar 18, 2013
Mar 18, 2013
79
void connectionRequest();
Apr 10, 2013
Apr 10, 2013
80
void configurationNeeded(const QString &type);
Apr 4, 2013
Apr 4, 2013
81
void connectionState(const QString &state, const QString &type);
Sep 16, 2013
Sep 16, 2013
82
void browserRequested(const QString &url);
Apr 30, 2014
Apr 30, 2014
83
void tetheringFinished(bool);
Mar 18, 2013
Mar 18, 2013
84
85
86
87
88
89
private:
com::jolla::Connectiond *connManagerInterface;
QDBusServiceWatcher *connectiondWatcher;
private slots:
Jun 7, 2013
Jun 7, 2013
90
void onErrorReported(const QString &servicePath, const QString &error);
Mar 18, 2013
Mar 18, 2013
91
92
93
void onRequestBrowser(const QString &url);
void onUserInputRequested(const QString &service, const QVariantMap &fields);
void onConnectionRequested();
Apr 4, 2013
Apr 4, 2013
94
void onConnectionState(const QString &state, const QString &type);
Apr 30, 2014
Apr 30, 2014
95
void onTetheringFinished(bool);
Mar 18, 2013
Mar 18, 2013
96
97
98
99
100
void connectToConnectiond(const QString = QString());
void connectiondUnregistered(const QString = QString());
};
Jul 7, 2015
Jul 7, 2015
101
#endif