1 // Generated by gmmproc 2.64.2 -- DO NOT MODIFY! 2 #ifndef _GIOMM_NETWORKSERVICE_H 3 #define _GIOMM_NETWORKSERVICE_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 GNetworkService = struct _GNetworkService; 31 using GNetworkServiceClass = struct _GNetworkServiceClass; 32 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 33 34 35 #ifndef DOXYGEN_SHOULD_SKIP_THIS 36 namespace Gio 37 { class GIOMM_API NetworkService_Class; } // namespace Gio 38 #endif //DOXYGEN_SHOULD_SKIP_THIS 39 40 namespace Gio 41 { 42 43 /** A GSocketConnectable for resolving SRV records 44 * 45 * Like NetworkAddress does with hostnames, NetworkService provides an easy 46 * way to resolve a SRV record, and then attempt to connect to one of the hosts 47 * that implements that service, handling service priority/weighting, multiple 48 * IP addresses, and multiple address families. 49 * 50 * See SrvTarget for more information about SRV records, and see 51 * SocketConnectable for and example of using the connectable interface. 52 * 53 * @newin{2,24} 54 * @ingroup NetworkIO 55 */ 56 57 class GIOMM_API NetworkService : public Glib::Object, 58 public SocketConnectable 59 { 60 61 #ifndef DOXYGEN_SHOULD_SKIP_THIS 62 63 public: 64 using CppObjectType = NetworkService; 65 using CppClassType = NetworkService_Class; 66 using BaseObjectType = GNetworkService; 67 using BaseClassType = GNetworkServiceClass; 68 69 // noncopyable 70 NetworkService(const NetworkService&) = delete; 71 NetworkService& operator=(const NetworkService&) = delete; 72 73 private: friend class NetworkService_Class; 74 static CppClassType networkservice_class_; 75 76 protected: 77 explicit NetworkService(const Glib::ConstructParams& construct_params); 78 explicit NetworkService(GNetworkService* castitem); 79 80 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 81 82 public: 83 84 NetworkService(NetworkService&& src) noexcept; 85 NetworkService& operator=(NetworkService&& src) noexcept; 86 87 ~NetworkService() noexcept override; 88 89 /** Get the GType for this class, for use with the underlying GObject type system. 90 */ 91 static GType get_type() G_GNUC_CONST; 92 93 #ifndef DOXYGEN_SHOULD_SKIP_THIS 94 95 96 static GType get_base_type() G_GNUC_CONST; 97 #endif 98 99 ///Provides access to the underlying C GObject. gobj()100 GNetworkService* gobj() { return reinterpret_cast<GNetworkService*>(gobject_); } 101 102 ///Provides access to the underlying C GObject. gobj()103 const GNetworkService* gobj() const { return reinterpret_cast<GNetworkService*>(gobject_); } 104 105 ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. 106 GNetworkService* gobj_copy(); 107 108 private: 109 110 111 explicit NetworkService(const Glib::ustring& service, const Glib::ustring& protocol, const Glib::ustring& domain); 112 113 114 public: 115 116 static Glib::RefPtr<NetworkService> create(const Glib::ustring& service, const Glib::ustring& protocol, const Glib::ustring& domain); 117 118 119 /** Gets @a srv's service name (eg, "ldap"). 120 * 121 * @newin{2,22} 122 * 123 * @return @a srv's service name. 124 */ 125 Glib::ustring get_service() const; 126 127 /** Gets @a srv's protocol name (eg, "tcp"). 128 * 129 * @newin{2,22} 130 * 131 * @return @a srv's protocol name. 132 */ 133 Glib::ustring get_protocol() const; 134 135 /** Gets the domain that @a srv serves. This might be either UTF-8 or 136 * ASCII-encoded, depending on what @a srv was created with. 137 * 138 * @newin{2,22} 139 * 140 * @return @a srv's domain name. 141 */ 142 Glib::ustring get_domain() const; 143 144 145 /** Get's the URI scheme used to resolve proxies. By default, the service name 146 * is used as scheme. 147 * 148 * @newin{2,26} 149 * 150 * @return @a srv's scheme name. 151 */ 152 Glib::ustring get_scheme() const; 153 154 /** Set's the URI scheme used to resolve proxies. By default, the service name 155 * is used as scheme. 156 * 157 * @newin{2,26} 158 * 159 * @param scheme A URI scheme. 160 */ 161 void set_scheme(const Glib::ustring& scheme); 162 163 /** Network domain, eg, 'example.com'. 164 * 165 * Default value: "" 166 * 167 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 168 * or receive notification when the value of the property changes. 169 */ 170 Glib::PropertyProxy_ReadOnly< Glib::ustring > property_domain() const; 171 172 173 /** Network protocol, eg 'tcp'. 174 * 175 * Default value: "" 176 * 177 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 178 * or receive notification when the value of the property changes. 179 */ 180 Glib::PropertyProxy_ReadOnly< Glib::ustring > property_protocol() const; 181 182 183 /** Network scheme (default is to use service). 184 * 185 * Default value: "" 186 * 187 * @return A PropertyProxy that allows you to get or set the value of the property, 188 * or receive notification when the value of the property changes. 189 */ 190 Glib::PropertyProxy< Glib::ustring > property_scheme() ; 191 192 /** Network scheme (default is to use service). 193 * 194 * Default value: "" 195 * 196 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 197 * or receive notification when the value of the property changes. 198 */ 199 Glib::PropertyProxy_ReadOnly< Glib::ustring > property_scheme() const; 200 201 /** Service name, eg 'ldap'. 202 * 203 * Default value: "" 204 * 205 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 206 * or receive notification when the value of the property changes. 207 */ 208 Glib::PropertyProxy_ReadOnly< Glib::ustring > property_service() const; 209 210 211 public: 212 213 public: 214 //C++ methods used to invoke GTK+ virtual functions: 215 216 protected: 217 //GTK+ Virtual Functions (override these to change behaviour): 218 219 //Default Signal Handlers:: 220 221 222 }; 223 224 } // namespace Gio 225 226 227 namespace Glib 228 { 229 /** A Glib::wrap() method for this object. 230 * 231 * @param object The C instance. 232 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. 233 * @result A C++ instance that wraps this C instance. 234 * 235 * @relates Gio::NetworkService 236 */ 237 GIOMM_API 238 Glib::RefPtr<Gio::NetworkService> wrap(GNetworkService* object, bool take_copy = false); 239 } 240 241 242 #endif /* _GIOMM_NETWORKSERVICE_H */ 243 244