connectivity-api
sim.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2016 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License version 3,
6  * as published by the Free Software Foundation.
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 Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authors:
17  * Antti Kaijanmäki <antti.kaijanmaki@canonical.com>
18  */
19 
20 #pragma once
21 
22 #include <QDBusConnection>
23 #include <QDBusObjectPath>
24 #include <QObject>
25 
26 #include <unity/util/DefinesPtrs.h>
27 
28 namespace connectivityqt
29 {
30 
31 class Q_DECL_EXPORT Sim : public QObject, public std::enable_shared_from_this<Sim>
32 {
33  Q_OBJECT
34 
35 public:
36  UNITY_DEFINES_PTRS(Sim);
37 
38  Sim(const QDBusObjectPath& path, const QDBusConnection& connection, QObject* parent = 0);
39 
40  virtual ~Sim();
41 
42  Q_PROPERTY(QDBusObjectPath path READ path)
43  QDBusObjectPath path() const;
44 
45  Q_PROPERTY(QString Iccid READ iccid CONSTANT)
46  QString iccid() const;
47 
48  Q_PROPERTY(QString Imsi READ imsi NOTIFY imsiChanged)
49  QString imsi() const;
50 
51  Q_PROPERTY(QString PrimaryPhoneNumber READ primaryPhoneNumber NOTIFY primaryPhoneNumberChanged)
52  QString primaryPhoneNumber() const;
53 
54  Q_PROPERTY(bool Locked READ locked NOTIFY lockedChanged)
55  bool locked() const;
56 
57  Q_PROPERTY(bool Present READ present NOTIFY presentChanged)
58  bool present() const;
59 
60  Q_PROPERTY(QString Mcc READ mcc NOTIFY mccChanged)
61  QString mcc() const;
62 
63  Q_PROPERTY(QString Mnc READ mnc NOTIFY mncChanged)
64  QString mnc() const;
65 
66  Q_PROPERTY(QList<QString> PreferredLanguages READ preferredLanguages NOTIFY preferredLanguagesChanged)
67  QList<QString> preferredLanguages() const;
68 
69  Q_PROPERTY(bool DataRoamingEnabled READ dataRoamingEnabled WRITE setDataRoamingEnabled NOTIFY dataRoamingEnabledChanged)
70  bool dataRoamingEnabled() const;
71  void setDataRoamingEnabled(bool value);
72 
73 public Q_SLOTS:
74 
75  void unlock();
76 
77 Q_SIGNALS:
78  void lockedChanged(bool value);
79  void presentChanged(bool value);
80  void dataRoamingEnabledChanged(bool value);
81  void imsiChanged(const QString &value);
82  void primaryPhoneNumberChanged(const QString &value);
83  void mccChanged(const QString &value);
84  void mncChanged(const QString &value);
85  void preferredLanguagesChanged();
86 
87 protected:
88  class Priv;
89  std::shared_ptr<Priv> d;
90 };
91 
92 }
93 
94 Q_DECLARE_METATYPE(connectivityqt::Sim*)
std::shared_ptr< Priv > d
Definition: sim.h:88
Definition: connectivity.cpp:36
Definition: sim.h:31