sim.h
Go to the documentation of this file.
/*
* Copyright © 2016 Canonical Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Authors:
* Antti Kaijanmäki <antti.kaijanmaki@canonical.com>
*/
#pragma once
#include <QDBusConnection>
#include <QDBusObjectPath>
#include <QObject>
#include <lomiri/util/DefinesPtrs.h>
namespace connectivityqt
{
class Q_DECL_EXPORT Sim : public QObject, public std::enable_shared_from_this<Sim>
{
Q_OBJECT
public:
LOMIRI_DEFINES_PTRS(Sim);
Sim(const QDBusObjectPath& path, const QDBusConnection& connection, QObject* parent = 0);
virtual ~Sim();
Q_PROPERTY(QDBusObjectPath path READ path)
QDBusObjectPath path() const;
Q_PROPERTY(QString Iccid READ iccid CONSTANT)
QString iccid() const;
Q_PROPERTY(QString Imsi READ imsi NOTIFY imsiChanged)
QString imsi() const;
Q_PROPERTY(QString PrimaryPhoneNumber READ primaryPhoneNumber NOTIFY primaryPhoneNumberChanged)
QString primaryPhoneNumber() const;
Q_PROPERTY(bool Locked READ locked NOTIFY lockedChanged)
bool locked() const;
Q_PROPERTY(bool Present READ present NOTIFY presentChanged)
bool present() const;
Q_PROPERTY(QString Mcc READ mcc NOTIFY mccChanged)
QString mcc() const;
Q_PROPERTY(QString Mnc READ mnc NOTIFY mncChanged)
QString mnc() const;
Q_PROPERTY(QList<QString> PreferredLanguages READ preferredLanguages NOTIFY preferredLanguagesChanged)
QList<QString> preferredLanguages() const;
Q_PROPERTY(bool DataRoamingEnabled READ dataRoamingEnabled WRITE setDataRoamingEnabled NOTIFY dataRoamingEnabledChanged)
bool dataRoamingEnabled() const;
void setDataRoamingEnabled(bool value);
public Q_SLOTS:
void unlock();
Q_SIGNALS:
void lockedChanged(bool value);
void presentChanged(bool value);
void dataRoamingEnabledChanged(bool value);
void imsiChanged(const QString &value);
void primaryPhoneNumberChanged(const QString &value);
void mccChanged(const QString &value);
void mncChanged(const QString &value);
void preferredLanguagesChanged();
protected:
class Priv;
std::shared_ptr<Priv> d;
};
}
Q_DECLARE_METATYPE(connectivityqt::Sim*)
connectivityqt::Sim
Definition sim.h:32
connectivityqt::Sim::presentChanged
void presentChanged(bool value)
connectivityqt::Sim::imsiChanged
void imsiChanged(const QString &value)
connectivityqt::Sim::dataRoamingEnabled
bool dataRoamingEnabled() const
Definition sim.cpp:143
connectivityqt::Sim::present
bool present() const
Definition sim.cpp:123
connectivityqt::Sim::primaryPhoneNumber
QString primaryPhoneNumber() const
Definition sim.cpp:113
connectivityqt::Sim::iccid
QString iccid() const
Definition sim.cpp:103
connectivityqt::Sim::mcc
QString mcc() const
Definition sim.cpp:128
connectivityqt::Sim::imsi
QString imsi() const
Definition sim.cpp:108
connectivityqt::Sim::Sim
Sim(const QDBusObjectPath &path, const QDBusConnection &connection, QObject *parent=0)
Definition sim.cpp:76
connectivityqt::Sim::LOMIRI_DEFINES_PTRS
LOMIRI_DEFINES_PTRS(Sim)
connectivityqt::Sim::DataRoamingEnabled
bool DataRoamingEnabled
Definition sim.h:69
connectivityqt::Sim::Mcc
QString Mcc
Definition sim.h:60
connectivityqt::Sim::primaryPhoneNumberChanged
void primaryPhoneNumberChanged(const QString &value)
connectivityqt::Sim::locked
bool locked() const
Definition sim.cpp:118
connectivityqt::Sim::mccChanged
void mccChanged(const QString &value)
connectivityqt::Sim::dataRoamingEnabledChanged
void dataRoamingEnabledChanged(bool value)
connectivityqt::Sim::setDataRoamingEnabled
void setDataRoamingEnabled(bool value)
Definition sim.cpp:148
connectivityqt::Sim::lockedChanged
void lockedChanged(bool value)
connectivityqt::Sim::Imsi
QString Imsi
Definition sim.h:48
connectivityqt::Sim::unlock
void unlock()
Definition sim.cpp:153
connectivityqt::Sim::Mnc
QString Mnc
Definition sim.h:63
connectivityqt::Sim::Present
bool Present
Definition sim.h:57
connectivityqt::Sim::Iccid
QString Iccid
Definition sim.h:45
connectivityqt::Sim::preferredLanguagesChanged
void preferredLanguagesChanged()
connectivityqt::Sim::PrimaryPhoneNumber
QString PrimaryPhoneNumber
Definition sim.h:51
connectivityqt::Sim::path
QDBusObjectPath path
Definition sim.h:42
connectivityqt::Sim::preferredLanguages
QList< QString > preferredLanguages() const
Definition sim.cpp:138
connectivityqt::Sim::PreferredLanguages
QList< QString > PreferredLanguages
Definition sim.h:66
connectivityqt::Sim::mncChanged
void mncChanged(const QString &value)
connectivityqt::Sim::d
std::shared_ptr< Priv > d
Definition sim.h:89
connectivityqt::Sim::Locked
bool Locked
Definition sim.h:54
connectivityqt::Sim::mnc
QString mnc() const
Definition sim.cpp:133
connectivityqt
Definition connectivity.cpp:37