diff options
Diffstat (limited to 'gio/src/networkmonitor.hg')
-rw-r--r-- | gio/src/networkmonitor.hg | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/gio/src/networkmonitor.hg b/gio/src/networkmonitor.hg new file mode 100644 index 00000000..562c3d9a --- /dev/null +++ b/gio/src/networkmonitor.hg @@ -0,0 +1,69 @@ +/* Copyright (C) 2014 The giomm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <glibmm/interface.h> +#include <giomm/asyncresult.h> +#include <giomm/cancellable.h> +#include <giomm/socketconnectable.h> +#include <gio/gio.h> + +_DEFS(giomm,gio) +_PINCLUDE(glibmm/private/interface_p.h) +_PINCLUDE(gio/gio.h) + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _GNetworkMonitorInterface GNetworkMonitorInterface; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +namespace Gio +{ + +_WRAP_ENUM(NetworkConnectivity, GNetworkConnectivity, NO_GTYPE) + + +/** TODO + * + * @newin{2,44} + */ +class NetworkMonitor : public Glib::Interface +{ + _CLASS_INTERFACE(NetworkMonitor, GNetworkMonitor, G_NETWORK_MONITOR, GNetworkMonitorInterface) + +public: + _WRAP_METHOD(static Glib::RefPtr<NetworkMonitor> get_default(), g_network_monitor_get_default, newin "2,44") + + _WRAP_METHOD(bool get_network_available() const, g_network_monitor_get_network_available, newin "2,44") + + _WRAP_METHOD(NetworkConnectivity get_connectivity() const, g_network_monitor_get_connectivity) + + _WRAP_METHOD(bool can_reach(const Glib::RefPtr<SocketConnectable>& connectable, const Glib::RefPtr<Cancellable>& cancellable{?}), g_network_monitor_can_reach, errthrow, newin "2,44") + + //TODO: + void can_reach_async(const Glib::RefPtr<SocketConnectable>& connectable, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable); + _IGNORE(g_network_monitor_can_reach_async) + + _WRAP_METHOD(bool can_reach_finish(const Glib::RefPtr<AsyncResult>& result), g_network_monitor_can_reach_finish, errthrow, newin "2,44") + + _WRAP_SIGNAL(void network_changed(bool available), "network-changed", newin "2,44") + + //TODO: Wrap vfuncs? + + _WRAP_PROPERTY("network-available", bool, newin "2,44") + _WRAP_PROPERTY("connectivity", NetworkConnectivity) +}; + +} // namespace Gio |