Blame bus/connection.h

Packit Service 1d8f1c
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
Packit Service 1d8f1c
/* vim:set et sts=4: */
Packit Service 1d8f1c
/* bus - The Input Bus
Packit Service 1d8f1c
 * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
Packit Service 1d8f1c
 * Copyright (C) 2008-2010 Red Hat, Inc.
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * This library is free software; you can redistribute it and/or
Packit Service 1d8f1c
 * modify it under the terms of the GNU Lesser General Public
Packit Service 1d8f1c
 * License as published by the Free Software Foundation; either
Packit Service 1d8f1c
 * version 2.1 of the License, or (at your option) any later version.
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * This library is distributed in the hope that it will be useful,
Packit Service 1d8f1c
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 1d8f1c
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 1d8f1c
 * Lesser General Public License for more details.
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * You should have received a copy of the GNU Lesser General Public
Packit Service 1d8f1c
 * License along with this library; if not, write to the Free Software
Packit Service 1d8f1c
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
Packit Service 1d8f1c
 * USA
Packit Service 1d8f1c
 */
Packit Service 1d8f1c
#ifndef __BUS_CONNECTION_H_
Packit Service 1d8f1c
#define __BUS_CONNECTION_H_
Packit Service 1d8f1c
Packit Service 1d8f1c
#include <ibus.h>
Packit Service 1d8f1c
Packit Service 1d8f1c
/*
Packit Service 1d8f1c
 * Type macros.
Packit Service 1d8f1c
 */
Packit Service 1d8f1c
Packit Service 1d8f1c
/* define GOBJECT macros */
Packit Service 1d8f1c
#define BUS_TYPE_CONNECTION             \
Packit Service 1d8f1c
    (bus_connection_get_type ())
Packit Service 1d8f1c
#define BUS_CONNECTION(obj)             \
Packit Service 1d8f1c
    (G_TYPE_CHECK_INSTANCE_CAST ((obj), BUS_TYPE_CONNECTION, BusConnection))
Packit Service 1d8f1c
#define BUS_CONNECTION_CLASS(klass)     \
Packit Service 1d8f1c
    (G_TYPE_CHECK_CLASS_CAST ((klass), BUS_TYPE_CONNECTION, BusConnectionClass))
Packit Service 1d8f1c
#define BUS_IS_CONNECTION(obj)          \
Packit Service 1d8f1c
    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUS_TYPE_CONNECTION))
Packit Service 1d8f1c
#define BUS_IS_CONNECTION_CLASS(klass)  \
Packit Service 1d8f1c
    (G_TYPE_CHECK_CLASS_TYPE ((klass), BUS_TYPE_CONNECTION))
Packit Service 1d8f1c
#define BUS_CONNECTION_GET_CLASS(obj)   \
Packit Service 1d8f1c
    (G_TYPE_INSTANCE_GET_CLASS ((obj), BUS_TYPE_CONNECTION, BusConnectionClass))
Packit Service 1d8f1c
Packit Service 1d8f1c
G_BEGIN_DECLS
Packit Service 1d8f1c
Packit Service 1d8f1c
typedef struct _BusConnection BusConnection;
Packit Service 1d8f1c
typedef struct _BusConnectionClass BusConnectionClass;
Packit Service 1d8f1c
Packit Service 1d8f1c
GType            bus_connection_get_type            (void);
Packit Service 1d8f1c
Packit Service 1d8f1c
/**
Packit Service 1d8f1c
 * bus_connection_new:
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * Create a BusConnection object from a low-level GDBus connection.
Packit Service 1d8f1c
 */
Packit Service 1d8f1c
BusConnection   *bus_connection_new                 (GDBusConnection    *connection);
Packit Service 1d8f1c
Packit Service 1d8f1c
/**
Packit Service 1d8f1c
 * bus_connection_lookup:
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * Lookup the BusConnection object which corresponds to the low-level connection.
Packit Service 1d8f1c
 */
Packit Service 1d8f1c
BusConnection   *bus_connection_lookup              (GDBusConnection    *connection);
Packit Service 1d8f1c
Packit Service 1d8f1c
const gchar     *bus_connection_get_unique_name     (BusConnection      *connection);
Packit Service 1d8f1c
void             bus_connection_set_unique_name     (BusConnection      *connection,
Packit Service 1d8f1c
                                                     const gchar        *name);
Packit Service 1d8f1c
Packit Service 1d8f1c
/**
Packit Service 1d8f1c
 * bus_connection_get_names:
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * Get the list of well-known names of the connection.
Packit Service 1d8f1c
 */
Packit Service 1d8f1c
const GList     *bus_connection_get_names           (BusConnection      *connection);
Packit Service 1d8f1c
Packit Service 1d8f1c
/**
Packit Service 1d8f1c
 * bus_connection_add_name:
Packit Service 1d8f1c
 * @name: a well-known name for the connection.
Packit Service 1d8f1c
 * @returns: g_strdup (name)
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * Add the well-known name to the connection.
Packit Service 1d8f1c
 */
Packit Service 1d8f1c
const gchar     *bus_connection_add_name            (BusConnection      *connection,
Packit Service 1d8f1c
                                                     const gchar        *name);
Packit Service 1d8f1c
Packit Service 1d8f1c
/**
Packit Service 1d8f1c
 * bus_connection_remove_name:
Packit Service 1d8f1c
 * @name: a well-known name for the connection.
Packit Service 1d8f1c
 * @returns: TRUE on success.
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * Remove the well-known name from the connection.
Packit Service 1d8f1c
 */
Packit Service 1d8f1c
gboolean         bus_connection_remove_name         (BusConnection      *connection,
Packit Service 1d8f1c
                                                     const gchar        *name);
Packit Service 1d8f1c
Packit Service 1d8f1c
/**
Packit Service 1d8f1c
 * bus_connection_has_name:
Packit Service 1d8f1c
 * @name: a well-known name for the connection.
Packit Service 1d8f1c
 * @returns: TRUE if found the name.
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * Lookup the well-known name from the connection.
Packit Service 1d8f1c
 */
Packit Service 1d8f1c
gboolean         bus_connection_has_name            (BusConnection      *connection,
Packit Service 1d8f1c
                                                     const gchar        *name);
Packit Service 1d8f1c
Packit Service 1d8f1c
/**
Packit Service 1d8f1c
 * bus_connection_get_dbus_connection:
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * Get the underlying GDBus connection.
Packit Service 1d8f1c
 */
Packit Service 1d8f1c
GDBusConnection *bus_connection_get_dbus_connection (BusConnection      *connection);
Packit Service 1d8f1c
Packit Service 1d8f1c
/**
Packit Service 1d8f1c
 * bus_connection_set_filter:
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * Set a filter function which will be called on all incoming and outgoing messages on the connection.
Packit Service 1d8f1c
 * WARNING - this filter function could be called by the GDBus's worker thread. So the function should not call thread unsafe IBus functions.
Packit Service 1d8f1c
 */
Packit Service 1d8f1c
void             bus_connection_set_filter          (BusConnection      *connection,
Packit Service 1d8f1c
                                                     GDBusMessageFilterFunction
Packit Service 1d8f1c
                                                                         filter_func,
Packit Service 1d8f1c
                                                     gpointer            user_data,
Packit Service 1d8f1c
                                                     GDestroyNotify      user_data_free_func);
Packit Service 1d8f1c
Packit Service 1d8f1c
G_END_DECLS
Packit Service 1d8f1c
#endif
Packit Service 1d8f1c