<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.20" xml:lang="en-US">
  <compounddef id="using-cpp" kind="page">
    <compoundname>using-cpp</compoundname>
    <title>Using the C++ API</title>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
<para>Install the development headers:</para>
<para><programlisting filename=".txt"><codeline><highlight class="normal">sudo<sp/>apt-get<sp/>install<sp/>libconnectivity-qt1-dev</highlight></codeline>
</programlisting></para>
<para>Enable c++11 and use pkg-config to get the necessary compilation flags:</para>
<para><programlisting filename=".txt"><codeline><highlight class="normal">$<sp/>g++<sp/>myapp.cpp<sp/>-std=c++11<sp/>`pkg-config<sp/>--cflags<sp/>--libs<sp/>connectivity-qt1`<sp/>-o<sp/>myapp</highlight></codeline>
</programlisting></para>
<para>The headers can then be included as:</para>
<para><programlisting filename=".cpp"><codeline><highlight class="comment">//<sp/>includes<sp/>the<sp/>ubuntu::connectivity::NetworkingStatus<sp/>class</highlight><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="networking-status_8h" kindref="compound">ubuntu/connectivity/networking-status.h</ref>&gt;</highlight></codeline>
</programlisting></para>
<para><bold>note:</bold><linebreak/>
 Accessing the networking status from confined applications requires the <emphasis>connectivity</emphasis> policy group. </para>
    </detaileddescription>
  </compounddef>
</doxygen>
