#ifndef MODULES_PORTAL_XDG_DESKTOP_PORTAL_UTILS_H_
#define MODULES_PORTAL_XDG_DESKTOP_PORTAL_UTILS_H_
#include <gio/gio.h>
#include <stdint.h>
#include <string>
#include <vector>
#include "absl/strings/string_view.h"
#include "modules/portal/portal_request_response.h"
#include "modules/portal/scoped_glib.h"
#include "modules/portal/xdg_session_details.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
namespace webrtc {
namespace xdg_portal {
constexpr char kDesktopBusName[] = …;
constexpr char kDesktopObjectPath[] = …;
constexpr char kDesktopRequestObjectPath[] = …;
constexpr char kSessionInterfaceName[] = …;
constexpr char kRequestInterfaceName[] = …;
constexpr char kScreenCastInterfaceName[] = …;
ProxyRequestCallback;
SessionRequestCallback;
SessionRequestResponseSignalHandler;
StartRequestResponseSignalHandler;
SessionStartRequestedHandler;
RTC_EXPORT std::string RequestResponseToString(RequestResponse request);
RequestResponse RequestResponseFromPortalResponse(uint32_t portal_response);
RTC_EXPORT std::string PrepareSignalHandle(absl::string_view token,
GDBusConnection* connection);
RTC_EXPORT uint32_t
SetupRequestResponseSignal(absl::string_view object_path,
const GDBusSignalCallback callback,
gpointer user_data,
GDBusConnection* connection);
RTC_EXPORT void RequestSessionProxy(
absl::string_view interface_name,
const ProxyRequestCallback proxy_request_callback,
GCancellable* cancellable,
gpointer user_data);
RTC_EXPORT void SetupSessionRequestHandlers(
absl::string_view portal_prefix,
const SessionRequestCallback session_request_callback,
const SessionRequestResponseSignalHandler request_response_signale_handler,
GDBusConnection* connection,
GDBusProxy* proxy,
GCancellable* cancellable,
std::string& portal_handle,
guint& session_request_signal_id,
gpointer user_data);
RTC_EXPORT void StartSessionRequest(
absl::string_view prefix,
absl::string_view session_handle,
const StartRequestResponseSignalHandler signal_handler,
const SessionStartRequestedHandler session_started_handler,
GDBusProxy* proxy,
GDBusConnection* connection,
GCancellable* cancellable,
guint& start_request_signal_id,
std::string& start_handle,
gpointer user_data);
RTC_EXPORT void TearDownSession(absl::string_view session_handle,
GDBusProxy* proxy,
GCancellable* cancellable,
GDBusConnection* connection);
}
}
#endif