vpn-connections-list-model.h
connectivityqt/vpn-connection.h
QAbstractItemModel
unity/util/DefinesPtrs.h
connectivityqt/connectivity.cpp
connectivityqt/connectivity.h
connectivityqt/vpn-connections-list-model.cpp
QObject
QDBusObjectPath
connectivityqt/vpn-connection.h
unity/util/DefinesPtrs.h
QDBusConnection
QAbstractItemModel
connectivityqt/vpn-connections-list-model.h
ubuntu/connectivity/networking-status.cpp
connectivityqt/connectivity.h
connectivityqt/connectivity.cpp
connectivityqt/vpn-connections-list-model.cpp
connectivityqt/vpn-connections-list-model.h
connectivityqt::VpnConnectionsListModel
connectivityqt

    /*
    *Copyright©2014CanonicalLtd.
    *
    *Thisprogramisfreesoftware:youcanredistributeitand/ormodifyit
    *underthetermsoftheGNULesserGeneralPublicLicenseversion3,
    *aspublishedbytheFreeSoftwareFoundation.
    *
    *Thisprogramisdistributedinthehopethatitwillbeuseful,
    *butWITHOUTANYWARRANTY;withouteventheimpliedwarrantyof
    *MERCHANTABILITYorFITNESSFORAPARTICULARPURPOSE.Seethe
    *GNULesserGeneralPublicLicenseformoredetails.
    *
    *YoushouldhavereceivedacopyoftheGNULesserGeneralPublicLicense
    *alongwiththisprogram.Ifnot,see<http://www.gnu.org/licenses/>.
    *
    *Authors:
    *PeteWoods<pete.woods@canonical.com>
    */

    #pragmaonce

    #include<connectivityqt/vpn-connection.h>

    #include<QAbstractItemModel>
    #include<unity/util/DefinesPtrs.h>

    namespaceconnectivityqt
    {
    namespaceinternal
    {
    structVpnConnectionsListModelParameters;
    }

    classQ_DECL_EXPORTVpnConnectionsListModel:publicQAbstractListModel
    {
    Q_OBJECT

    Q_ENUMS(Roles)

    public:
    UNITY_DEFINES_PTRS(VpnConnectionsListModel);

    enumRoles
    {
    RoleId,
    RoleActive,
    RoleActivatable,
    RoleType,
    RoleConnection
    };

    VpnConnectionsListModel(constinternal::VpnConnectionsListModelParameters&parameters);

    ~VpnConnectionsListModel();

    intcolumnCount(constQModelIndex&parent)constoverride;

    introwCount(constQModelIndex&parent)constoverride;

    QVariantdata(constQModelIndex&index,introle)constoverride;

    boolsetData(constQModelIndex&index,constQVariant&value,introle)override;

    Qt::ItemFlagsflags(constQModelIndex&index)constoverride;

    QHash<int,QByteArray>roleNames()constoverride
    {
    QHash<int,QByteArray>roles;
    roles[RoleId]="id";
    roles[RoleActive]="active";
    roles[RoleActivatable]="activatable";
    roles[RoleType]="type";
    roles[RoleConnection]="connection";
    returnroles;
    }

    publicQ_SLOTS:
    voidadd(VpnConnection::Typetype);

    voidremove(VpnConnection*connection);

    Q_SIGNALS:
    voidaddFinished(VpnConnection*connection);

    protected:
    classPriv;
    std::shared_ptr<Priv>d;
    };

    }

    Q_DECLARE_METATYPE(connectivityqt::VpnConnection*)