connectivity-api: ubuntu::connectivity::NetworkingStatus Class Reference

connectivity-api

Public Types | Public Slots | Signals | Public Member Functions | Public Attributes | Properties | List of all members
ubuntu::connectivity::NetworkingStatus Class Reference

Overall system networking status. More...

`#include <ubuntu/connectivity/networking-status.h>`

Inheritance diagram for ubuntu::connectivity::NetworkingStatus:
[legend]
Collaboration diagram for ubuntu::connectivity::NetworkingStatus:
[legend]

## Public Types
enum | Limitations { Bandwith }
| enum for networking limitations More...
enum | Status { Offline, Connecting, Online }
| enum for networking status More...

## Public Slots
void | limitationsUpdated (const QVector< connectivityqt::Connectivity::Limitations > &)
void | statusUpdated (connectivityqt::Connectivity::Status value)

## Signals
Q_DECL_DEPRECATED void | limitationsChanged ()
Q_DECL_DEPRECATED void | statusChanged (Status value)

## Public Member Functions
| Private (NetworkingStatus &parent)
| NetworkingStatus (QObject *parent=0)
virtual | ~NetworkingStatus ()
Q_DECL_DEPRECATED QVector< Limitations > | limitations () const
Q_DECL_DEPRECATED Status | status () const

## Public Attributes
NetworkingStatus & | p
connectivityqt::Connectivity::SPtr | m_connectivity

## Properties
QVector< Limitations > | limitations
ubuntu::connectivity::NetworkingStatus::Status | status

## Detailed Description

Overall system networking status.

NOTE: This class is deprecated, please move to using connectivityqt::Connectivity

This is the top-level class for accessing networking information.

- For system networking status, see NetworkingStatus::status.
- For connection limitations, see NetworkingStatus::limitations.

Examples:

- Getting the networking status.

## Member Enumeration Documentation

## ◆ Limitations

enum ubuntu::connectivity::NetworkingStatus::Limitations

enum for networking limitations

Networking limitations may be accessed through the NetworkingStatus::limitations property.

Enumerator
Bandwith | indicates that the bandwith of the Internet connection has limitations. Applications should minimize their bandwith usage if possible.

## ◆ Status

enum ubuntu::connectivity::NetworkingStatus::Status

enum for networking status

Networking status may be accessed through the NetworkingStatus::status property.

Enumerator
Offline | No Internet connection available.
Connecting | System is actively establising a connection.
Online | System is connected to the Internet.

## Constructor & Destructor Documentation

## ◆ NetworkingStatus()

ubuntu::connectivity::NetworkingStatus::NetworkingStatus | ( | QObject * | parent = `0` | ) |
| explicit

## ◆ ~NetworkingStatus()

ubuntu::connectivity::NetworkingStatus::~NetworkingStatus | ( |  | ) |
| virtual

## Member Function Documentation

## ◆ limitations()

QVector< NetworkingStatus::Limitations > ubuntu::connectivity::NetworkingStatus::limitations | ( |  | ) | const

See also
  NetworkingStatus::limitations

## ◆ limitationsChanged

Q_DECL_DEPRECATED void ubuntu::connectivity::NetworkingStatus::limitationsChanged | ( |  | ) |
| signal

See also
  NetworkingStatus::limitations

## ◆ limitationsUpdated

void ubuntu::connectivity::NetworkingStatus::limitationsUpdated | ( | const QVector< connectivityqt::Connectivity::Limitations > & |  | ) |
| inlineslot

## ◆ Private()

ubuntu::connectivity::NetworkingStatus::Private | ( | NetworkingStatus & | parent | ) |
| inline

## ◆ status()

NetworkingStatus::Status ubuntu::connectivity::NetworkingStatus::status | ( |  | ) | const

See also
  NetworkingStatus::status

## ◆ statusChanged

Q_DECL_DEPRECATED void ubuntu::connectivity::NetworkingStatus::statusChanged | ( | Status | value | ) |
| signal

See also
  NetworkingStatus::status

## ◆ statusUpdated

void ubuntu::connectivity::NetworkingStatus::statusUpdated | ( | connectivityqt::Connectivity::Status | value | ) |
| inlineslot

## Member Data Documentation

## ◆ m_connectivity

connectivityqt::Connectivity::SPtr ubuntu::connectivity::NetworkingStatus::m_connectivity

## ◆ p

NetworkingStatus& ubuntu::connectivity::NetworkingStatus::p

## Property Documentation

## ◆ limitations

QVector<Limitations> ubuntu::connectivity::NetworkingStatus::limitations
| read

limitations of the overall system networking

@initvalue {} @accessors limitations() @notify limitationsChanged()

// normal getter
if (ns->limitations().isEmpty())
qDebug() << "No limitations";
// Subscribe to limitation changes
QObject::connect(ns.data(),
&Connectivity::limitationsUpdated,
[&ns](){
if (ns->limitations().isEmpty())
{
qDebug() << "No limitations.";
return;
}
qDebug() << "Limitations:";
if (ns->limitations().contains(Connectivity::Limitations::Bandwith))
{
qDebug() << " - Bandwith";
}
});

## ◆ status

ubuntu::connectivity::NetworkingStatus::Status ubuntu::connectivity::NetworkingStatus::status
| read

status of the overall system networking

@initvalue NetworkingStatus::Online @accessors status() @notify statusChanged()

// normal getter
if (ns->status() == Connectivity::Status::Online)
{
qDebug() << "We are online.";
}
// Subscribe to system networking changes
QObject::connect(ns.data(),
&Connectivity::statusUpdated,
[](Connectivity::Status value)
{
qDebug() << "System networking status changed to: " + STATUS_MAP[value];
});

The documentation for this class was generated from the following files:

- ubuntu/connectivity/networking-status.cpp
- ubuntu/connectivity/networking-status.h