NetworkManagerQt

fakenetwork/settings.h
1/*
2 SPDX-FileCopyrightText: 2014 Jan Grulich <jgrulich@redhat.com>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#ifndef NETWORKMANAGERQT_FAKE_NETWORK_SETTINGS_H
8#define NETWORKMANAGERQT_FAKE_NETWORK_SETTINGS_H
9
10#include <QObject>
11
12#include <QDBusObjectPath>
13
14#include "../generictypes.h"
15
16#include "connection.h"
17
18class Settings : public QObject
19{
21 Q_CLASSINFO("D-Bus Interface", "org.kde.fakenetwork.Settings")
22public:
23 explicit Settings(QObject *parent = nullptr);
24 ~Settings() override;
25
26 Q_PROPERTY(bool CanModify READ canModify)
27 Q_PROPERTY(QList<QDBusObjectPath> Connections READ connections)
28 Q_PROPERTY(QString Hostname READ hostname)
29
30 bool canModify() const;
31 QList<QDBusObjectPath> connections() const;
32 QString hostname() const;
33
34private Q_SLOTS:
35 void onConnectionRemoved(const QDBusObjectPath &connectionPath);
36
37public Q_SLOTS: // METHODS
38 Q_SCRIPTABLE QDBusObjectPath AddConnection(const NMVariantMapMap &connection);
39 Q_SCRIPTABLE QDBusObjectPath AddConnectionUnsaved(const NMVariantMapMap &connection);
40 Q_SCRIPTABLE QDBusObjectPath GetConnectionByUuid(const QString &uuid);
41 Q_SCRIPTABLE QList<QDBusObjectPath> ListConnections();
42 Q_SCRIPTABLE void SaveHostname(const QString &hostname);
43
45 void connectionAdded(const QDBusObjectPath &connection);
46 void connectionRemoved(const QDBusObjectPath &connection);
47 Q_SCRIPTABLE void ConnectionRemoved(const QDBusObjectPath &connection);
48 Q_SCRIPTABLE void NewConnection(const QDBusObjectPath &connection);
49 Q_SCRIPTABLE void PropertiesChanged(const QVariantMap &properties);
50
51private:
52 bool m_canModify;
53 QMap<QDBusObjectPath, Connection *> m_connections;
54 QString m_hostname;
55
56 /* Not part of DBus interface */
57 int m_connectionCounter;
58};
59
60#endif
Q_CLASSINFO(Name, Value)
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:01:06 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.