Line |
Branch |
Exec |
Source |
1 |
|
|
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 |
|
|
/* cc-wwan-data.h |
3 |
|
|
* |
4 |
|
|
* Copyright 2019 Purism SPC |
5 |
|
|
* |
6 |
|
|
* This program is free software: you can redistribute it and/or modify |
7 |
|
|
* it under the terms of the GNU General Public License as published by |
8 |
|
|
* the Free Software Foundation, either version 3 of the License, or |
9 |
|
|
* (at your option) any later version. |
10 |
|
|
* |
11 |
|
|
* This program is distributed in the hope that it will be useful, |
12 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
|
|
* GNU General Public License for more details. |
15 |
|
|
* |
16 |
|
|
* You should have received a copy of the GNU General Public License |
17 |
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 |
|
|
* |
19 |
|
|
* Author(s): |
20 |
|
|
* Mohammed Sadiq <sadiq@sadiqpk.org> |
21 |
|
|
* |
22 |
|
|
* SPDX-License-Identifier: GPL-3.0-or-later |
23 |
|
|
*/ |
24 |
|
|
|
25 |
|
|
#pragma once |
26 |
|
|
|
27 |
|
|
#include <glib-object.h> |
28 |
|
|
#include <libmm-glib.h> |
29 |
|
|
#include <NetworkManager.h> |
30 |
|
|
|
31 |
|
|
G_BEGIN_DECLS |
32 |
|
|
|
33 |
|
|
#define CC_WWAN_APN_PRIORITY_LOW (1) |
34 |
|
|
#define CC_WWAN_APN_PRIORITY_HIGH (2) |
35 |
|
|
|
36 |
|
|
#define CC_TYPE_WWAN_DATA_APN (cc_wwan_data_apn_get_type()) |
37 |
|
✗ |
G_DECLARE_FINAL_TYPE (CcWwanDataApn, cc_wwan_data_apn, CC, WWAN_DATA_APN, GObject) |
38 |
|
|
|
39 |
|
|
#define CC_TYPE_WWAN_DATA (cc_wwan_data_get_type()) |
40 |
|
✗ |
G_DECLARE_FINAL_TYPE (CcWwanData, cc_wwan_data, CC, WWAN_DATA, GObject) |
41 |
|
|
|
42 |
|
|
CcWwanData *cc_wwan_data_new (MMObject *mm_object, |
43 |
|
|
NMClient *nm_client); |
44 |
|
|
GError *cc_wwan_data_get_error (CcWwanData *self); |
45 |
|
|
const gchar *cc_wwan_data_get_simple_html_error (CcWwanData *self); |
46 |
|
|
GListModel *cc_wwan_data_get_apn_list (CcWwanData *self); |
47 |
|
|
void cc_wwan_data_save_apn (CcWwanData *self, |
48 |
|
|
CcWwanDataApn *apn, |
49 |
|
|
GCancellable *cancellable, |
50 |
|
|
GAsyncReadyCallback callback, |
51 |
|
|
gpointer user_data); |
52 |
|
|
CcWwanDataApn *cc_wwan_data_save_apn_finish (CcWwanData *self, |
53 |
|
|
GAsyncResult *result, |
54 |
|
|
GError **error); |
55 |
|
|
void cc_wwan_data_save_settings (CcWwanData *self, |
56 |
|
|
GCancellable *cancellable, |
57 |
|
|
GAsyncReadyCallback callback, |
58 |
|
|
gpointer user_data); |
59 |
|
|
gboolean cc_wwan_data_save_settings_finish (CcWwanData *self, |
60 |
|
|
GAsyncResult *result, |
61 |
|
|
GError **error); |
62 |
|
|
gboolean cc_wwan_data_delete_apn (CcWwanData *self, |
63 |
|
|
CcWwanDataApn *apn, |
64 |
|
|
GCancellable *cancellable, |
65 |
|
|
GError **error); |
66 |
|
|
gboolean cc_wwan_data_set_default_apn (CcWwanData *self, |
67 |
|
|
CcWwanDataApn *apn); |
68 |
|
|
CcWwanDataApn *cc_wwan_data_get_default_apn (CcWwanData *self); |
69 |
|
|
gboolean cc_wwan_data_get_enabled (CcWwanData *self); |
70 |
|
|
void cc_wwan_data_set_enabled (CcWwanData *self, |
71 |
|
|
gboolean enabled); |
72 |
|
|
gboolean cc_wwan_data_get_roaming_enabled (CcWwanData *self); |
73 |
|
|
void cc_wwan_data_set_roaming_enabled (CcWwanData *self, |
74 |
|
|
gboolean enable_roaming); |
75 |
|
|
|
76 |
|
|
CcWwanDataApn *cc_wwan_data_apn_new (void); |
77 |
|
|
const gchar *cc_wwan_data_apn_get_name (CcWwanDataApn *apn); |
78 |
|
|
void cc_wwan_data_apn_set_name (CcWwanDataApn *apn, |
79 |
|
|
const gchar *name); |
80 |
|
|
const gchar *cc_wwan_data_apn_get_apn (CcWwanDataApn *apn); |
81 |
|
|
void cc_wwan_data_apn_set_apn (CcWwanDataApn *apn, |
82 |
|
|
const gchar *apn_name); |
83 |
|
|
const gchar *cc_wwan_data_apn_get_username (CcWwanDataApn *apn); |
84 |
|
|
void cc_wwan_data_apn_set_username (CcWwanDataApn *apn, |
85 |
|
|
const gchar *username); |
86 |
|
|
const gchar *cc_wwan_data_apn_get_password (CcWwanDataApn *apn); |
87 |
|
|
void cc_wwan_data_apn_set_password (CcWwanDataApn *apn, |
88 |
|
|
const gchar *password); |
89 |
|
|
gint cc_wwan_data_get_priority (CcWwanData *self); |
90 |
|
|
void cc_wwan_data_set_priority (CcWwanData *self, |
91 |
|
|
int priority); |
92 |
|
|
|
93 |
|
|
G_END_DECLS |
94 |
|
|
|