1 // Generated by gmmproc 2.64.2 -- DO NOT MODIFY! 2 #ifndef _GIOMM_NETWORKADDRESS_H 3 #define _GIOMM_NETWORKADDRESS_H 4 5 6 #include <glibmm/ustring.h> 7 #include <sigc++/sigc++.h> 8 9 /* Copyright (C) 2007 The giomm Development Team 10 * 11 * This library is free software; you can redistribute it and/or 12 * modify it under the terms of the GNU Lesser General Public 13 * License as published by the Free Software Foundation; either 14 * version 2.1 of the License, or (at your option) any later version. 15 * 16 * This library is distributed in the hope that it will be useful, 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 * Lesser General Public License for more details. 20 * 21 * You should have received a copy of the GNU Lesser General Public 22 * License along with this library. If not, see <http://www.gnu.org/licenses/>. 23 */ 24 25 #include <glibmm/object.h> 26 #include <giomm/socketconnectable.h> 27 28 29 #ifndef DOXYGEN_SHOULD_SKIP_THIS 30 using GNetworkAddress = struct _GNetworkAddress; 31 using GNetworkAddressClass = struct _GNetworkAddressClass; 32 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 33 34 35 #ifndef DOXYGEN_SHOULD_SKIP_THIS 36 namespace Gio 37 { class GIOMM_API NetworkAddress_Class; } // namespace Gio 38 #endif //DOXYGEN_SHOULD_SKIP_THIS 39 40 namespace Gio 41 { 42 43 /** A SocketConnectable for resolving hostnames 44 * 45 * NetworkAddress provides an easy way to resolve a hostname and then attempt to 46 * connect to that host, handling the possibility of multiple IP addresses and 47 * multiple address families. 48 * 49 * @newin{2,24} 50 * @ingroup NetworkIO 51 */ 52 53 class GIOMM_API NetworkAddress : public Glib::Object, 54 public SocketConnectable 55 { 56 57 #ifndef DOXYGEN_SHOULD_SKIP_THIS 58 59 public: 60 using CppObjectType = NetworkAddress; 61 using CppClassType = NetworkAddress_Class; 62 using BaseObjectType = GNetworkAddress; 63 using BaseClassType = GNetworkAddressClass; 64 65 // noncopyable 66 NetworkAddress(const NetworkAddress&) = delete; 67 NetworkAddress& operator=(const NetworkAddress&) = delete; 68 69 private: friend class NetworkAddress_Class; 70 static CppClassType networkaddress_class_; 71 72 protected: 73 explicit NetworkAddress(const Glib::ConstructParams& construct_params); 74 explicit NetworkAddress(GNetworkAddress* castitem); 75 76 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 77 78 public: 79 80 NetworkAddress(NetworkAddress&& src) noexcept; 81 NetworkAddress& operator=(NetworkAddress&& src) noexcept; 82 83 ~NetworkAddress() noexcept override; 84 85 /** Get the GType for this class, for use with the underlying GObject type system. 86 */ 87 static GType get_type() G_GNUC_CONST; 88 89 #ifndef DOXYGEN_SHOULD_SKIP_THIS 90 91 92 static GType get_base_type() G_GNUC_CONST; 93 #endif 94 95 ///Provides access to the underlying C GObject. gobj()96 GNetworkAddress* gobj() { return reinterpret_cast<GNetworkAddress*>(gobject_); } 97 98 ///Provides access to the underlying C GObject. gobj()99 const GNetworkAddress* gobj() const { return reinterpret_cast<GNetworkAddress*>(gobject_); } 100 101 ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. 102 GNetworkAddress* gobj_copy(); 103 104 private: 105 106 107 explicit NetworkAddress(const std::string& hostname, guint16 port); 108 109 110 public: 111 112 static Glib::RefPtr<NetworkAddress> create(const std::string& hostname, guint16 port); 113 114 115 /** Gets @a addr's hostname. This might be either UTF-8 or ASCII-encoded, 116 * depending on what @a addr was created with. 117 * 118 * @newin{2,22} 119 * 120 * @return @a addr's hostname. 121 */ 122 std::string get_hostname() const; 123 124 /** Gets @a addr's port number 125 * 126 * @newin{2,22} 127 * 128 * @return @a addr's port (which may be 0). 129 */ 130 guint16 get_port() const; 131 132 /** Gets @a addr's scheme 133 * 134 * @newin{2,26} 135 * 136 * @return @a addr's scheme (<tt>nullptr</tt> if not built from URI). 137 */ 138 std::string get_scheme() const; 139 140 static Glib::RefPtr<NetworkAddress> parse(const std::string& host_and_port, guint16 default_port); 141 142 /** Hostname to resolve. 143 * 144 * Default value: "" 145 * 146 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 147 * or receive notification when the value of the property changes. 148 */ 149 Glib::PropertyProxy_ReadOnly< std::string > property_hostname() const; 150 151 152 /** Network port. 153 * 154 * Default value: 0 155 * 156 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 157 * or receive notification when the value of the property changes. 158 */ 159 Glib::PropertyProxy_ReadOnly< guint > property_port() const; 160 161 162 /** URI Scheme. 163 * 164 * Default value: "" 165 * 166 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 167 * or receive notification when the value of the property changes. 168 */ 169 Glib::PropertyProxy_ReadOnly< std::string > property_scheme() const; 170 171 172 public: 173 174 public: 175 //C++ methods used to invoke GTK+ virtual functions: 176 177 protected: 178 //GTK+ Virtual Functions (override these to change behaviour): 179 180 //Default Signal Handlers:: 181 182 183 }; 184 185 } // namespace Gio 186 187 188 namespace Glib 189 { 190 /** A Glib::wrap() method for this object. 191 * 192 * @param object The C instance. 193 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. 194 * @result A C++ instance that wraps this C instance. 195 * 196 * @relates Gio::NetworkAddress 197 */ 198 GIOMM_API 199 Glib::RefPtr<Gio::NetworkAddress> wrap(GNetworkAddress* object, bool take_copy = false); 200 } 201 202 203 #endif /* _GIOMM_NETWORKADDRESS_H */ 204 205