usb_moded-dbus-private.h 3.02 KB
Newer Older
1
/*
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
 * Copyright (C) 2010 Nokia Corporation. All rights reserved.
 * Copyright (C) 2013-2018 Jolla Ltd.
 *
 * Author: Philippe De Swert <philippe.de-swert@nokia.com>
 * Author: Philippe De Swert <philippe.deswert@jollamobile.com>
 * Author: Vesa Halttunen <vesa.halttunen@jollamobile.com>
 * Author: Martin Jones <martin.jones@jollamobile.com>
 * Author: Simo Piiroinen <simo.piiroinen@jollamobile.com>
 * Author: Andrew den Exter <andrew.den.exter@jolla.com>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the Lesser GNU General Public License
 * version 2 as published by the Free Software Foundation.
 *
 * This program 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
 * General Public License for more details.
 *
 * You should have received a copy of the Lesser GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA
 */

#ifndef  USB_MODED_DBUS_PRIVATE_H_
# define USB_MODED_DBUS_PRIVATE_H_

30
# include "usb_moded-dbus.h" // NOTRIM
31 32 33 34 35 36 37

# include <dbus/dbus.h>
# include <glib.h>

/* ========================================================================= *
 * Constants
 * ========================================================================= */
38

39
/** Logical name for org.freedesktop.DBus.GetNameOwner method */
40
# define DBUS_GET_NAME_OWNER_REQ         "GetNameOwner"
41 42

/** Logical name for org.freedesktop.DBus.NameOwnerChanged signal */
43
# define DBUS_NAME_OWNER_CHANGED_SIG     "NameOwnerChanged"
44

45 46 47
/* ========================================================================= *
 * Types
 * ========================================================================= */
48

49
/* Callback function type used with umdbus_get_name_owner_async() */
50 51
typedef void (*usb_moded_get_name_owner_fn)(const char *owner);

52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
/* ========================================================================= *
 * Prototypes
 * ========================================================================= */

/* -- umdbus -- */

DBusConnection *umdbus_get_connection               (void);
gboolean        umdbus_init_connection              (void);
gboolean        umdbus_init_service                 (void);
void            umdbus_cleanup                      (void);
int             umdbus_send_state_signal            (const char *state_ind);
int             umdbus_send_error_signal            (const char *error);
int             umdbus_send_supported_modes_signal  (const char *supported_modes);
int             umdbus_send_available_modes_signal  (const char *available_modes);
int             umdbus_send_hidden_modes_signal     (const char *hidden_modes);
int             umdbus_send_whitelisted_modes_signal(const char *whitelist);
gboolean        umdbus_get_name_owner_async         (const char *name, usb_moded_get_name_owner_fn cb, DBusPendingCall **ppc);

#endif /* USB_MODED_DBUS_PRIVATE_H_ */