unity.scopes.QueryMetadata

Base class for extra metadata passed to scopes as a part of a request. More...

#include <unity/scopes/QueryMetadata.h>

Inheritance diagram for unity::scopes::QueryMetadata: src="https://assets.ubuntu.com/v1/f7f711a1-classunity_1_1scopes_1_1_query_metadata__inherit__graph.png" border="0" alt="Inheritance graph"/>

Public Types

enum  ConnectivityStatus { Unknown, Connected, Disconnected }
 Indicates the internet connectivity status. More...
 

Public Member Functions

std::string locale () const
 Get the locale string. More...
 
std::string form_factor () const
 Get the form factor string. More...
 
void set_internet_connectivity (ConnectivityStatus connectivity_status)
 Set internet connectivity status. More...
 
ConnectivityStatus internet_connectivity () const
 Get internet connectivity status. More...
 

Detailed Description

Base class for extra metadata passed to scopes as a part of a request.

Member Enumeration Documentation

enum unity::scopes::QueryMetadata::ConnectivityStatus

Indicates the internet connectivity status.

The Unknown enumerator indicates that set_internet_connectivity() has not yet been called, hence the connectivity status is currently unknown.

The Connected enumerator simply indicates that we are currently connected to the internet. This does not necessarily mean that a particular host on the internet will be reachable.

The Disconnected enumerator indicates that we are currently not connected to the internet. In this state, a scope need not waste any time attempting remote calls, as they will almost certainly fail.

Member Function Documentation

std::string unity::scopes::QueryMetadata::form_factor ( ) const

Get the form factor string.

Returns
The form factor string
QueryMetadata::ConnectivityStatus unity::scopes::QueryMetadata::internet_connectivity ( ) const

Get internet connectivity status.

Returns
Enum indicating the internet connectivity status.
std::string unity::scopes::QueryMetadata::locale ( ) const

Get the locale string.

Returns
The locale string
void unity::scopes::QueryMetadata::set_internet_connectivity ( ConnectivityStatus  connectivity_status)

Set internet connectivity status.

Parameters
connectivity_statusEnum indicating the internet connectivity status.