com.trolltech.qt.network
Class QNetworkRequest.Attribute

java.lang.Object
  extended by java.lang.Enum
      extended by com.trolltech.qt.network.QNetworkRequest.Attribute
All Implemented Interfaces:
QtEnumerator, java.io.Serializable, java.lang.Comparable
Enclosing class:
QNetworkRequest

public static final class QNetworkRequest.Attribute
extends java.lang.Enum
implements QtEnumerator

Attribute codes for the QNetworkRequest and QNetworkReply.

Attributes are extra meta-data that are used to control the behavior of the request and to pass further information from the reply back to the application. Attributes are also extensible, allowing custom implementations to pass custom values.

The following table explains what the default attribute codes are, the QVariant types associated, the default value if said attribute is missing and whether it's used in requests or replies.

See Also:
Serialized Form

Field Summary
static QNetworkRequest.Attribute CacheLoadControlAttribute
          Requests only, type.
static QNetworkRequest.Attribute CacheSaveControlAttribute
          Requests only, type.
static QNetworkRequest.Attribute ConnectionEncryptedAttribute
          Replies only, type.
static QNetworkRequest.Attribute CustomEnum
           
static QNetworkRequest.Attribute HttpReasonPhraseAttribute
          Replies only, type.
static QNetworkRequest.Attribute HttpStatusCodeAttribute
          Replies only, type.
static QNetworkRequest.Attribute RedirectionTargetAttribute
          Replies only, type.
static QNetworkRequest.Attribute SourceIsFromCacheAttribute
          Replies only, type.
static QNetworkRequest.Attribute User
          Special type.
static QNetworkRequest.Attribute UserMax
          Special type.
 
Method Summary
static QNetworkRequest.Attribute resolve(int value)
          Returns the QNetworkRequest$Attribute constant with the specified int.
 int value()
          This function should return an integer value for the enum values of the enumeration that implements this interface.
static QNetworkRequest.Attribute valueOf(java.lang.String name)
           
static QNetworkRequest.Attribute[] values()
           
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

HttpStatusCodeAttribute

public static final QNetworkRequest.Attribute HttpStatusCodeAttribute
Replies only, type. QVariant::Int (no default) Indicates the HTTP status code received from the HTTP server (like 200, 304, 404, 401, etc.). If the connection was not HTTP-based, this attribute will not be present.


HttpReasonPhraseAttribute

public static final QNetworkRequest.Attribute HttpReasonPhraseAttribute
Replies only, type. QVariant::ByteArray (no default) Indicates the HTTP reason phrase as received from the HTTP server (like "Ok", "Found", "Not Found", "Access Denied", etc.) This is the human-readable representation of the status code (see above). If the connection was not HTTP-based, this attribute will not be present.


RedirectionTargetAttribute

public static final QNetworkRequest.Attribute RedirectionTargetAttribute
Replies only, type. QVariant::Url (no default) If present, it indicates that the server is redirecting the request to a different URL. The Network Access API does not by default follow redirections: it's up to the application to determine if the requested redirection should be allowed, according to its security policies.


ConnectionEncryptedAttribute

public static final QNetworkRequest.Attribute ConnectionEncryptedAttribute
Replies only, type. QVariant::Bool (default: false) Indicates whether the data was obtained through an encrypted (secure) connection.


CacheLoadControlAttribute

public static final QNetworkRequest.Attribute CacheLoadControlAttribute
Requests only, type. QVariant::Int (default: QNetworkRequest::PreferNetwork ) Controls how the cache should be accessed. The possible values are those of QNetworkRequest::CacheLoadControl . Note that the default QNetworkAccessManager implementation does not support caching. However, this attribute may be used by certain backends to modify their requests (for example, for caching proxies).


CacheSaveControlAttribute

public static final QNetworkRequest.Attribute CacheSaveControlAttribute
Requests only, type. QVariant::Bool (default: true) Controls if the data obtained should be saved to cache for future uses. If the value is false, the data obtained will not be automatically cached. If true, data may be cached, provided it is cacheable (what is cacheable depends on the protocol being used). Note that the default QNetworkAccessManager implementation does not support caching, so it will ignore this attribute.


SourceIsFromCacheAttribute

public static final QNetworkRequest.Attribute SourceIsFromCacheAttribute
Replies only, type. QVariant::Bool (default: false) Indicates whether the data was obtained from cache or not.


User

public static final QNetworkRequest.Attribute User
Special type. Additional information can be passed in QVariants with types ranging from User to UserMax . The default implementation of Network Access will ignore any request attributes in this range and it will not produce any attributes in this range in replies. The range is reserved for extensions of QNetworkAccessManager.


UserMax

public static final QNetworkRequest.Attribute UserMax
Special type. See User.


CustomEnum

public static final QNetworkRequest.Attribute CustomEnum
Method Detail

values

public static QNetworkRequest.Attribute[] values()

valueOf

public static QNetworkRequest.Attribute valueOf(java.lang.String name)

value

public int value()
This function should return an integer value for the enum values of the enumeration that implements this interface.

Specified by:
value in interface QtEnumerator

resolve

public static QNetworkRequest.Attribute resolve(int value)
Returns the QNetworkRequest$Attribute constant with the specified int.