Qyoto  4.0.5
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Properties
QtNetwork.QNetworkConfigurationManager Class Reference

The QNetworkConfigurationManager class manages the network configurations provided by the system. More...

Inheritance diagram for QtNetwork.QNetworkConfigurationManager:
Collaboration diagram for QtNetwork.QNetworkConfigurationManager:

Public Types

enum  Capability {
  ApplicationLevelRoaming = 8, CanStartAndStopInterfaces = 1, DataStatistics = 32, DirectConnectionRouting = 2,
  ForcedRoaming = 16, NetworkSessionRequired = 64, SystemSessionSupport = 4
}
  More...
 

Public Member Functions

 QNetworkConfigurationManager (QObject parent=null)
 
 
override void CreateProxy ()
 
new
System.Collections.Generic.List
< QNetworkConfiguration
AllConfigurations (QNetworkConfiguration.StateFlag flags=0)
 
 
new
QNetworkConfigurationManager.Capability 
Capabilities ()
 
 
new QNetworkConfiguration ConfigurationFromIdentifier (string identifier)
 
 
new QNetworkConfiguration DefaultConfiguration ()
 
 
new bool IsOnline ()
 
 
new void UpdateConfigurations ()
 
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.QObject
 QObject (QObject parent=null)
 
 
new bool BlockSignals (bool b)
 
 
new
System.Collections.Generic.List
< QObject
Children ()
 
 
new bool Connect (QObject sender, string signal, string member, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
 
 
new void DeleteLater ()
 
 
new bool Disconnect (QObject receiver, string member=null)
 
 
new bool Disconnect (string signal=null, QObject receiver=null, string member=null)
 
 
new void DumpObjectInfo ()
 
 
new void DumpObjectTree ()
 
 
new
System.Collections.Generic.List
< QByteArray
DynamicPropertyNames ()
 
 
virtual bool OnEvent (QEvent arg1)
 
 
virtual bool EventFilter (QObject arg1, QEvent arg2)
 
 
new bool Inherits (string classname)
 
 
new void InstallEventFilter (QObject arg1)
 
 
new bool IsWidgetType ()
 
 
new void KillTimer (int id)
 
 
new object Property (string name)
 
 
new void RemoveEventFilter (QObject arg1)
 
 
new bool SetProperty (string name, object value)
 
 
new void SetUserData (uint id, QObjectUserData data)
 
new bool SignalsBlocked ()
 
 
new int StartTimer (int interval)
 
 
new QObjectUserData UserData (uint id)
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.Qt
delegate QTextStream FuncQTextStreamQTextStream (QTextStream qTextStream)
 
delegate string FuncStringQByteArray (QByteArray qByteArray)
 
delegate QByteArray FuncQByteArrayString (string @string)
 
delegate void ActionQtMsgTypeString (QtMsgType qtMsgType, string @string)
 
delegate QObject FuncQObject ()
 

Static Public Member Functions

static string Tr (string s, string c=null)
 
static string Tr (string s, string c, int n)
 
static string TrUtf8 (string s, string c=null)
 
static string TrUtf8 (string s, string c, int n)
 
- Static Public Member Functions inherited from QtCore.QObject
static bool Connect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod method, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
 
 
static bool Connect (QObject sender, string signal, QObject receiver, string member, Qt.ConnectionType arg5=Qt.ConnectionType.AutoConnection)
 
 
static bool Disconnect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod member)
 
 
static bool Disconnect (QObject sender, string signal, QObject receiver, string member)
 
 
static uint RegisterUserData ()
 
static string Tr (string s, string c=null)
 
 
static string Tr (string s, string c, int n)
 
 
static string TrUtf8 (string s, string c=null)
 
 
static string TrUtf8 (string s, string c, int n)
 
 
- Static Public Member Functions inherited from QtCore.Qt
static QDataStream Write (QDataStream s, object p)
 
static QDataStream Write (QDataStream arg1, QSizeF arg2)
 
static QTextStream Write (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Write (QDataStream arg1, QPoint arg2)
 
static QDataStream Write (QDataStream arg1, QLineF arg2)
 
static QDataStream Write (QDataStream arg1, QPointF arg2)
 
static QDataStream Write (QDataStream arg1, QChar arg2)
 
static QDataStream Write (QDataStream arg1, QByteArray arg2)
 
static QDataStream Write (QDataStream arg1, QEasingCurve arg2)
 
static QDataStream Write (QDataStream arg1, QRectF arg2)
 
static QDataStream Write (QDataStream arg1, QDateTime arg2)
 
static QDataStream Write (QDataStream arg1, QUrl arg2)
 
static QDataStream Write (QDataStream arg1, QTime arg2)
 
static QDataStream Write (QDataStream arg1, QLocale arg2)
 
static QDataStream Write (QDataStream arg1, QBitArray arg2)
 
static QDataStream Write (QDataStream arg1, QUuid arg2)
 
static QDataStream Write (QDataStream arg1, QLine arg2)
 
static QDataStream Write (QDataStream arg1, QDate arg2)
 
static QDataStream Write (QDataStream @out, QRegExp regExp)
 
static QDataStream Write (QDataStream arg1, QRect arg2)
 
static QDataStream Write (QDataStream arg1, QSize arg2)
 
static QDataStream Write (QDataStream s, QVariant.Type p)
 
static QDataStream Write (QDataStream arg1, string arg2)
 
static QDataStream Write (QDataStream @out, System.Collections.Generic.List< string > list)
 
static QDataStream Read (QDataStream arg1, QChar arg2)
 
static QDataStream Read (QDataStream arg1, QLocale arg2)
 
static QDataStream Read (QDataStream arg1, QRect arg2)
 
static QDataStream Read (QDataStream arg1, QEasingCurve arg2)
 
static QDataStream Read (QDataStream arg1, QDate arg2)
 
static QDataStream Read (QDataStream arg1, QUrl arg2)
 
static QDataStream Read (QDataStream arg1, QUuid arg2)
 
static QTextStream Read (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Read (QDataStream arg1, QLineF arg2)
 
static QDataStream Read (QDataStream arg1, QRectF arg2)
 
static QDataStream Read (QDataStream arg1, QPointF arg2)
 
static QDataStream Read (QDataStream arg1, QLine arg2)
 
static QDataStream Read (QDataStream arg1, QBitArray arg2)
 
static QDataStream Read (QDataStream arg1, QSize arg2)
 
static QDataStream Read (QDataStream arg1, QDateTime arg2)
 
static QDataStream Read (QDataStream arg1, QTime arg2)
 
static QDataStream Read (QDataStream arg1, QPoint arg2)
 
static QDataStream Read (QDataStream @in, QRegExp regExp)
 
static QDataStream Read (QDataStream s, object p)
 
static QDataStream Read (QDataStream arg1, QByteArray arg2)
 
static QDataStream Read (QDataStream arg1, QSizeF arg2)
 
static QDataStream Read (QDataStream arg1, string arg2)
 
static QDataStream Read (QDataStream s, QVariant.Type p)
 
static QDataStream Read (QDataStream @in, System.Collections.Generic.List< string > list)
 
static double qAcos (double v)
 
static void qAddPostRoutine (System.Action arg1)
 
static string qAppName ()
 
static double qAsin (double v)
 
static double qAtan (double v)
 
static double qAtan2 (double x, double y)
 
static void qBadAlloc ()
 
static int qCeil (double v)
 
static ushort qChecksum (string s, uint len)
 
static QByteArray qCompress (QByteArray data)
 
static QByteArray qCompress (QByteArray data, int compressionLevel=-1)
 
static QByteArray qCompress (Pointer< byte > data, int nbytes)
 
static QByteArray qCompress (Pointer< byte > data, int nbytes, int compressionLevel=-1)
 
static double qCos (double v)
 
static double qExp (double v)
 
static double qFabs (double v)
 
static double qFastCos (double x)
 
static double qFastSin (double x)
 
static string qFlagLocation (string method)
 
static int qFloor (double v)
 
static bool qFuzzyCompare (double p1, double p2)
 
static bool qFuzzyCompare (float p1, float p2)
 
static bool qFuzzyIsNull (double d)
 
static bool qFuzzyIsNull (float f)
 
static uint qHash (QBitArray key)
 
static uint qHash (QChar key)
 
static uint qHash (QStringRef key)
 
static uint qHash (QUrl url)
 
static uint qHash (QPersistentModelIndex index)
 
static uint qHash (QByteArray key)
 
static uint qHash (QModelIndex index)
 
static uint qHash (uint key)
 
static uint qHash (sbyte key)
 
static uint qHash (byte key)
 
static uint qHash (short key)
 
static uint qHash (NativeLong key)
 
static uint qHash (ushort key)
 
static uint qHash (long key)
 
static uint qHash (ulong key)
 
static uint qHash (int key)
 
static uint qHash (string key)
 
static uint qHash (NativeULong key)
 
static double qInf ()
 
static Qt.ActionQtMsgTypeString qInstallMsgHandler (Qt.ActionQtMsgTypeString arg1)
 
static int qIntCast (float f)
 
static int qIntCast (double f)
 
static bool qIsFinite (double d)
 
static bool qIsFinite (float f)
 
static bool qIsInf (float f)
 
static bool qIsInf (double d)
 
static bool qIsNaN (float f)
 
static bool qIsNaN (double d)
 
static bool qIsNull (float f)
 
static bool qIsNull (double d)
 
static double qLn (double v)
 
static double qPow (double x, double y)
 
static double qQNaN ()
 
static void qRegisterStaticPluginInstanceFunction (Qt.FuncQObject function)
 
static void qRemovePostRoutine (System.Action arg1)
 
static int qRound (double d)
 
static long qRound64 (double d)
 
static double qSNaN ()
 
static bool qSharedBuild ()
 
static double qSin (double v)
 
static double qSqrt (double v)
 
static bool qStringComparisonHelper (QStringRef s1, string s2)
 
static double qTan (double v)
 
static QByteArray qUncompress (QByteArray data)
 
static QByteArray qUncompress (Pointer< byte > data, int nbytes)
 
static string qVersion ()
 
static void Qbswap_helper (Pointer< byte > src, Pointer< byte > dest, int size)
 
static QByteArray Qgetenv (string varName)
 
static bool Qputenv (string varName, QByteArray value)
 
static int Qrand ()
 
static void Qsrand (uint seed)
 
static int Qstrcmp (QByteArray str1, QByteArray str2)
 
static int Qstrcmp (QByteArray str1, string str2)
 
static int Qstrcmp (string str1, QByteArray str2)
 
static int Qstrcmp (string str1, string str2)
 
static Pointer< sbyte > Qstrcpy (Pointer< sbyte > dst, string src)
 
static Pointer< sbyte > Qstrdup (string arg1)
 
static int Qstricmp (string arg1, string arg2)
 
static uint Qstrlen (string str)
 
static int Qstrncmp (string str1, string str2, uint len)
 
static Pointer< sbyte > Qstrncpy (Pointer< sbyte > dst, string src, uint len)
 
static int Qstrnicmp (string arg1, string arg2, uint len)
 
static uint Qstrnlen (string str, uint maxlen)
 
static string QtTrId (string id, int n=-1)
 

Protected Member Functions

 QNetworkConfigurationManager (System.Type dummy)
 
new void OnConfigurationAdded (QNetworkConfiguration config)
 
 
new void OnConfigurationChanged (QNetworkConfiguration config)
 
 
new void OnConfigurationRemoved (QNetworkConfiguration config)
 
 
new void OnOnlineStateChanged (bool isOnline)
 
 
new void OnUpdateCompleted ()
 
 
- Protected Member Functions inherited from QtCore.QObject
 QObject (System.Type dummy)
 
virtual void OnChildEvent (QChildEvent arg1)
 
 
virtual void ConnectNotify (string signal)
 
 
virtual void OnCustomEvent (QEvent arg1)
 
 
new void OnDestroyed (QObject arg1=null)
 
 
virtual void DisconnectNotify (string signal)
 
 
new int Receivers (string signal)
 
 
new QObject Sender ()
 
 
new int SenderSignalIndex ()
 
 
virtual void OnTimerEvent (QTimerEvent arg1)
 
 

Properties

Slot< QNetworkConfigurationConfigurationAdded
 
 
Slot< QNetworkConfigurationConfigurationRemoved
 
 
Slot< QNetworkConfigurationConfigurationChanged
 
 
Slot< System.Boolean > OnlineStateChanged
 
 
Slot UpdateCompleted
 
 
static new QMetaObject StaticMetaObject [get]
 
new
IQNetworkConfigurationManagerSignals 
Emit [get]
 
- Properties inherited from QtCore.QObject
virtual EventHandler
< QEventArgs< QChildEvent > > 
ChildEvent
 
 
virtual EventHandler
< QEventArgs< QEvent > > 
CustomEvent
 
 
virtual EventHandler
< QEventArgs< QEvent > > 
Event
 
 
virtual EventHandler
< QEventArgs< QTimerEvent > > 
TimerEvent
 
 
Slot< QObjectDestroyedQObject
 
Slot Destroyed
 
 
new QObject Parent [get, set]
 
 
virtual System.IntPtr SmokeObject [get, set]
 
new string ObjectName [get, set]
 
 
static new QMetaObject StaticMetaObject [get]
 
 
static new QMetaObject StaticQtMetaObject [get]
 
new IQObjectSignals Emit [get]
 

Additional Inherited Members

- Protected Attributes inherited from QtCore.QObject
object Q_EMIT = null
 
SmokeInvocation interceptor
 
readonly List< QEventHandler > eventFilters = new List<QEventHandler>()
 

Detailed Description

The QNetworkConfigurationManager class manages the network configurations provided by the system.

QNetworkConfigurationManager provides access to the network configurations known to the system and enables applications to detect the system capabilities (with regards to network sessions) at runtime.

A QNetworkConfiguration abstracts a set of configuration options describing how a network interface has to be configured to connect to a particular target network. QNetworkConfigurationManager maintains and updates the global list of QNetworkConfigurations. Applications can access and filter this list via allConfigurations(). If a new configuration is added or an existing one is removed or changed the configurationAdded(), configurationRemoved() and configurationChanged() signals are emitted respectively.

The defaultConfiguration() can be used when intending to immediately create a new network session without caring about the particular configuration. It returns a QNetworkConfiguration::Discovered configuration. If there are not any discovered ones an invalid configuration is returned.

Some configuration updates may require some time to perform updates. A WLAN scan is such an example. Unless the platform performs internal updates it may be required to manually trigger configuration updates via QNetworkConfigurationManager::updateConfigurations(). The completion of the update process is indicted by emitting the updateCompleted() signal. The update process ensures that every existing QNetworkConfiguration instance is updated. There is no need to ask for a renewed configuration list via allConfigurations().

See also QNetworkConfiguration.

Member Enumeration Documentation

Specifies the system capabilities of the bearer API. The possible values are:

Enumerator:
ApplicationLevelRoaming 

The system gives applications control over the systems roaming behavior. Applications can initiate roaming (in case the current link is not suitable) and are consulted if the system has identified a more suitable access point.

CanStartAndStopInterfaces 

Network sessions and their underlying access points can be started and stopped. If this flag is not set QNetworkSession can only monitor but not influence the state of access points. On some platforms this feature may require elevated user permissions. This option is platform specific and may not always be available.

DataStatistics 

If this flag is set QNetworkSession can provide statistics about transmitted and received data.

DirectConnectionRouting 

Network sessions and their sockets can be bound to a particular network interface. Any packet that passes through the socket goes to the specified network interface and thus disregards standard routing table entries. This may be useful when two interfaces can reach overlapping IP ranges or an application has specific needs in regards to target networks. This option is platform specific and may not always be available.

ForcedRoaming 

The system disconnects an existing access point and reconnects via a more suitable one. The application does not have any control over this process and has to reconnect its active sockets.

NetworkSessionRequired 

If this flag is set the platform requires that a network session is created before network operations can be performed.

SystemSessionSupport 

If this flag is set the underlying platform ensures that a network interface is not shut down until the last network session has been closed(). This works across multiple processes. If the platform session support is missing this API can only ensure the above behavior for network sessions within the same process. In general mobile platforms (such as Symbian/S60) have such support whereas most desktop platform lack this capability.

Constructor & Destructor Documentation

QtNetwork.QNetworkConfigurationManager.QNetworkConfigurationManager ( System.Type  dummy)
protected
QtNetwork.QNetworkConfigurationManager.QNetworkConfigurationManager ( QObject  parent = null)

Constructs a QNetworkConfigurationManager with the given parent.

Note that to ensure a valid list of current configurations immediately available, updating is done during construction which causes some delay.

Member Function Documentation

new System.Collections.Generic.List<QNetworkConfiguration> QtNetwork.QNetworkConfigurationManager.AllConfigurations ( QNetworkConfiguration.StateFlag  flags = 0)

Returns the list of configurations which comply with the given filter.

By default this function returns all (defined and undefined) configurations.

A wireless network with a particular SSID may only be accessible in a certain area despite the fact that the system has a valid configuration for it. Therefore the filter flag may be used to limit the list to discovered and possibly connected configurations only.

If filter is set to zero this function returns all possible configurations.

Note that this function returns the states for all configurations as they are known at the time of this function call. If for instance a configuration of type WLAN is defined the system may have to perform a WLAN scan in order to determine whether it is actually available. To obtain the most accurate state updateConfigurations() should be used to update each configuration's state. Note that such an update may require some time. It's completion is signalled by updateCompleted(). In the absence of a configuration update this function returns the best estimate at the time of the call. Therefore, if WLAN configurations are of interest, it is recommended that updateConfigurations() is called once after QNetworkConfigurationManager instantiation (WLAN scans are too time consuming to perform in constructor). After this the data is kept automatically up-to-date as the system reports any changes.

new QNetworkConfigurationManager.Capability QtNetwork.QNetworkConfigurationManager.Capabilities ( )

Returns the capabilities supported by the current platform.

new QNetworkConfiguration QtNetwork.QNetworkConfigurationManager.ConfigurationFromIdentifier ( string  identifier)

Returns the QNetworkConfiguration for identifier; otherwise returns an invalid QNetworkConfiguration.

See also QNetworkConfiguration::identifier().

override void QtNetwork.QNetworkConfigurationManager.CreateProxy ( )
virtual

Reimplemented from QtCore.QObject.

new QNetworkConfiguration QtNetwork.QNetworkConfigurationManager.DefaultConfiguration ( )

Returns the default configuration to be used. This function always returns a discovered configuration; otherwise an invalid configuration.

In some cases it may be required to call updateConfigurations() and wait for the updateCompleted() signal before calling this function.

See also allConfigurations().

new void QtNetwork.QNetworkConfigurationManager.Dispose ( )
new bool QtNetwork.QNetworkConfigurationManager.IsOnline ( )

Returns true if the system is considered to be connected to another device via an active network interface; otherwise returns false.

This is equivalent to the following code snippet:

QNetworkConfigurationManager mgr;

QList<QNetworkConfiguration> activeConfigs = mgr.allConfigurations(QNetworkConfiguration::Active)

if (activeConfigs.count() > 0)

Q_ASSERT(mgr.isOnline())

else

Q_ASSERT(!mgr.isOnline())

See also onlineStateChanged().

new void QtNetwork.QNetworkConfigurationManager.OnConfigurationAdded ( QNetworkConfiguration  config)
protected

This signal is emitted whenever a new network configuration is added to the system. The new configuration is specified by config.

new void QtNetwork.QNetworkConfigurationManager.OnConfigurationChanged ( QNetworkConfiguration  config)
protected

This signal is emitted when the state of config changes.

new void QtNetwork.QNetworkConfigurationManager.OnConfigurationRemoved ( QNetworkConfiguration  config)
protected

This signal is emitted when a configuration is about to be removed from the system. The removed configuration, specified by config, is invalid but retains name and identifier.

This function was introduced in Qt 4.8.

new void QtNetwork.QNetworkConfigurationManager.OnOnlineStateChanged ( bool  isOnline)
protected

This signal is emitted when the device changes from online to offline mode or vice versa. isOnline represents the new state of the device.

The state is considered to be online for as long as allConfigurations(QNetworkConfiguration::Active) returns a list with at least one entry.

new void QtNetwork.QNetworkConfigurationManager.OnUpdateCompleted ( )
protected

This signal is emitted when the configuration update has been completed. Such an update can be initiated via updateConfigurations().

static string QtNetwork.QNetworkConfigurationManager.Tr ( string  s,
string  c = null 
)
static
static string QtNetwork.QNetworkConfigurationManager.Tr ( string  s,
string  c,
int  n 
)
static
static string QtNetwork.QNetworkConfigurationManager.TrUtf8 ( string  s,
string  c = null 
)
static
static string QtNetwork.QNetworkConfigurationManager.TrUtf8 ( string  s,
string  c,
int  n 
)
static
new void QtNetwork.QNetworkConfigurationManager.UpdateConfigurations ( )

Initiates an update of all configurations. This may be used to initiate WLAN scans or other time consuming updates which may be required to obtain the correct state for configurations.

This call is asynchronous. On completion of this update the updateCompleted() signal is emitted. If new configurations are discovered or old ones were removed or changed the update process may trigger the emission of one or multiple configurationAdded(), configurationRemoved() and configurationChanged() signals.

If a configuration state changes as a result of this update all existing QNetworkConfiguration instances are updated automatically.

See also allConfigurations().

Property Documentation

Slot<QNetworkConfiguration> QtNetwork.QNetworkConfigurationManager.ConfigurationAdded
addremove

This signal is emitted whenever a new network configuration is added to the system. The new configuration is specified by config.

Slot<QNetworkConfiguration> QtNetwork.QNetworkConfigurationManager.ConfigurationChanged
addremove

This signal is emitted when the state of config changes.

Slot<QNetworkConfiguration> QtNetwork.QNetworkConfigurationManager.ConfigurationRemoved
addremove

This signal is emitted when a configuration is about to be removed from the system. The removed configuration, specified by config, is invalid but retains name and identifier.

This function was introduced in Qt 4.8.

new IQNetworkConfigurationManagerSignals QtNetwork.QNetworkConfigurationManager.Emit
getprotected
Slot<System.Boolean> QtNetwork.QNetworkConfigurationManager.OnlineStateChanged
addremove

This signal is emitted when the device changes from online to offline mode or vice versa. isOnline represents the new state of the device.

The state is considered to be online for as long as allConfigurations(QNetworkConfiguration::Active) returns a list with at least one entry.

new QMetaObject QtNetwork.QNetworkConfigurationManager.StaticMetaObject
staticget
Slot QtNetwork.QNetworkConfigurationManager.UpdateCompleted
addremove

This signal is emitted when the configuration update has been completed. Such an update can be initiated via updateConfigurations().