glibmm 2.82.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Symbols | List of all members
Gio::ProxyResolver Class Reference

ProxyResolver - Asynchronous and cancellable network proxy resolver. More...

#include <giomm/proxyresolver.h>

Inheritance diagram for Gio::ProxyResolver:
Inheritance graph
[legend]

Public Member Functions

 ProxyResolver (ProxyResolver &&src) noexcept
 
ProxyResolveroperator= (ProxyResolver &&src) noexcept
 
 ~ProxyResolver () noexcept override
 
GProxyResolvergobj ()
 Provides access to the underlying C GObject.
 
const GProxyResolvergobj () const
 Provides access to the underlying C GObject.
 
bool is_supported () const
 Checks if resolver can be used on this system.
 
std::vector< Glib::ustringlookup (const Glib::ustring &uri, const Glib::RefPtr< Cancellable > &cancellable)
 Looks into the system proxy configuration to determine what proxy, if any, to use to connect to uri.
 
std::vector< Glib::ustringlookup (const Glib::ustring &uri)
 Looks into the system proxy configuration to determine what proxy, if any, to use to connect to uri.
 
void lookup_async (const Glib::ustring &uri, const SlotAsyncReady &slot, const Glib::RefPtr< Cancellable > &cancellable)
 Asynchronous lookup of proxy.
 
void lookup_async (const Glib::ustring &uri, const SlotAsyncReady &slot)
 Asynchronous lookup of proxy.
 
std::vector< Glib::ustringlookup_finish (const Glib::RefPtr< AsyncResult > &result)
 Call this function to obtain the array of proxy URIs when g_proxy_resolver_lookup_async() is complete.
 
- Public Member Functions inherited from Glib::Interface
 Interface ()
 A Default constructor.
 
 Interface (Interface &&src) noexcept
 
Interfaceoperator= (Interface &&src) noexcept
 
 Interface (const Glib::Interface_Class &interface_class)
 Called by constructors of derived classes.
 
 Interface (GObject *castitem)
 Called by constructors of derived classes.
 
 ~Interface () noexcept override
 
 Interface (const Interface &)=delete
 
Interfaceoperator= (const Interface &)=delete
 
GObject * gobj ()
 
const GObject * gobj () const
 
- Public Member Functions inherited from Glib::ObjectBase
 ObjectBase (const ObjectBase &)=delete
 
ObjectBaseoperator= (const ObjectBase &)=delete
 
void set_property_value (const Glib::ustring & property_name, const Glib::ValueBase & value)
 You probably want to use a specific property_*() accessor method instead.
 
void get_property_value (const Glib::ustring & property_name, Glib::ValueBase & value) const
 You probably want to use a specific property_*() accessor method instead.
 
template<class PropertyType >
void set_property (const Glib::ustring & property_name, const PropertyType & value)
 You probably want to use a specific property_*() accessor method instead.
 
template<class PropertyType >
void get_property (const Glib::ustring & property_name, PropertyType & value) const
 You probably want to use a specific property_*() accessor method instead.
 
template<class PropertyType >
PropertyType get_property (const Glib::ustring & property_name) const
 You probably want to use a specific property_*() accessor method instead.
 
sigc::connection connect_property_changed (const Glib::ustring & property_name, const sigc::slot< void()> &slot)
 You can use the signal_changed() signal of the property proxy instead.
 
sigc::connection connect_property_changed (const Glib::ustring & property_name, sigc::slot< void()> &&slot)
 You can use the signal_changed() signal of the property proxy instead.
 
void freeze_notify ()
 Increases the freeze count on object.
 
void thaw_notify ()
 Reverts the effect of a previous call to freeze_notify().
 
virtual void reference () const
 Increment the reference count for this object.
 
virtual void unreference () const
 Decrement the reference count for this object.
 
GObject * gobj ()
 Provides access to the underlying C GObject.
 
const GObject * gobj () const
 Provides access to the underlying C GObject.
 
GObject * gobj_copy () const
 Give a ref-ed copy to someone. Use for direct struct access.
 

Static Public Member Functions

static void add_interface (GType gtype_implementer)
 
static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system.
 
static Glib::RefPtr< ProxyResolverget_default ()
 Gets the default ProxyResolver for the system.
 

Protected Member Functions

 ProxyResolver ()
 You should derive from this class to use it.
 
- Protected Member Functions inherited from Glib::ObjectBase
 ObjectBase ()
 This default constructor is called implicitly from the constructor of user-derived classes, even if, for instance, Gtk::Button calls a different ObjectBase constructor.
 
 ObjectBase (const char *custom_type_name)
 A derived constructor always overrides this choice.
 
 ObjectBase (const std::type_info &custom_type_info)
 This constructor is a special feature to allow creation of derived types on the fly, without having to use g_object_new() manually.
 
 ObjectBase (ObjectBase &&src) noexcept
 
ObjectBaseoperator= (ObjectBase &&src) noexcept
 
virtual ~ObjectBase () noexcept=0
 
void initialize (GObject *castitem)
 
void initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper)
 

Related Symbols

(Note that these are not member symbols.)

Glib::RefPtr< Gio::ProxyResolverwrap (GProxyResolver *object, bool take_copy=false)
 A Glib::wrap() method for this object.
 

Detailed Description

ProxyResolver - Asynchronous and cancellable network proxy resolver.

ProxyResolver provides synchronous and asynchronous network proxy resolution. ProxyResolver is used within ClientSocket through the method Gio::SocketConnectable::proxy_enumerate().

Since glibmm 2.28:

Constructor & Destructor Documentation

◆ ProxyResolver() [1/2]

Gio::ProxyResolver::ProxyResolver ( )
protected

You should derive from this class to use it.

◆ ProxyResolver() [2/2]

Gio::ProxyResolver::ProxyResolver ( ProxyResolver &&  src)
noexcept

◆ ~ProxyResolver()

Gio::ProxyResolver::~ProxyResolver ( )
overridenoexcept

Member Function Documentation

◆ add_interface()

static void Gio::ProxyResolver::add_interface ( GType  gtype_implementer)
static

◆ get_default()

static Glib::RefPtr< ProxyResolver > Gio::ProxyResolver::get_default ( )
static

Gets the default ProxyResolver for the system.

Since glibmm 2.26:
Returns
The default ProxyResolver, which will be a dummy object if no proxy resolver is available.

◆ get_type()

static GType Gio::ProxyResolver::get_type ( )
static

Get the GType for this class, for use with the underlying GObject type system.

◆ gobj() [1/2]

GProxyResolver * Gio::ProxyResolver::gobj ( )
inline

Provides access to the underlying C GObject.

◆ gobj() [2/2]

const GProxyResolver * Gio::ProxyResolver::gobj ( ) const
inline

Provides access to the underlying C GObject.

◆ is_supported()

bool Gio::ProxyResolver::is_supported ( ) const

Checks if resolver can be used on this system.

(This is used internally; g_proxy_resolver_get_default() will only return a proxy resolver that returns true for this method.)

Since glibmm 2.26:
Returns
true if resolver is supported.

◆ lookup() [1/2]

std::vector< Glib::ustring > Gio::ProxyResolver::lookup ( const Glib::ustring uri)

Looks into the system proxy configuration to determine what proxy, if any, to use to connect to uri.

The returned proxy URIs are of the form <protocol>://[user[:password]@]host:port or direct://, where <protocol> could be http, rtsp, socks or other proxying protocol.

If you don't know what network protocol is being used on the socket, you should use none as the URI protocol. In this case, the resolver might still return a generic proxy type (such as SOCKS), but would not return protocol-specific proxy types (such as http).

direct:// is used when no proxy is needed. Direct connection should not be attempted unless it is part of the returned array of proxies.

Parameters
uria URI representing the destination to connect to.

◆ lookup() [2/2]

std::vector< Glib::ustring > Gio::ProxyResolver::lookup ( const Glib::ustring uri,
const Glib::RefPtr< Cancellable > &  cancellable 
)

Looks into the system proxy configuration to determine what proxy, if any, to use to connect to uri.

The returned proxy URIs are of the form <protocol>://[user[:password]@]host[:port] or direct://, where <protocol> could be http, rtsp, socks or other proxying protocol.

If you don't know what network protocol is being used on the socket, you should use none as the URI protocol. In this case, the resolver might still return a generic proxy type (such as SOCKS), but would not return protocol-specific proxy types (such as http).

direct:// is used when no proxy is needed. Direct connection should not be attempted unless it is part of the returned array of proxies.

Since glibmm 2.26:
Parameters
uriA URI representing the destination to connect to.
cancellableA Cancellable, or nullptr.
Returns
A nullptr-terminated array of proxy URIs.
Exceptions
Glib::Error

◆ lookup_async() [1/2]

void Gio::ProxyResolver::lookup_async ( const Glib::ustring uri,
const SlotAsyncReady &  slot 
)

Asynchronous lookup of proxy.

See lookup() for more details.

Parameters
uria URI representing the destination to connect to.
slotA callback slot to call after the resolution completes.

◆ lookup_async() [2/2]

void Gio::ProxyResolver::lookup_async ( const Glib::ustring uri,
const SlotAsyncReady &  slot,
const Glib::RefPtr< Cancellable > &  cancellable 
)

Asynchronous lookup of proxy.

See lookup() for more details.

Parameters
uria URI representing the destination to connect to.
slotA callback slot to call after the resolution completes.
cancellableA Cancellable object which can be used to cancel the operation.

◆ lookup_finish()

std::vector< Glib::ustring > Gio::ProxyResolver::lookup_finish ( const Glib::RefPtr< AsyncResult > &  result)

Call this function to obtain the array of proxy URIs when g_proxy_resolver_lookup_async() is complete.

See g_proxy_resolver_lookup() for more details.

Since glibmm 2.26:
Parameters
resultThe result passed to your SlotAsyncReady.
Returns
A nullptr-terminated array of proxy URIs.
Exceptions
Glib::Error

◆ operator=()

ProxyResolver & Gio::ProxyResolver::operator= ( ProxyResolver &&  src)
noexcept

Friends And Related Symbol Documentation

◆ wrap()

Glib::RefPtr< Gio::ProxyResolver > wrap ( GProxyResolver object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.