| 1 |
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- |
| 2 |
* |
| 3 |
* Copyright (C) 2010-2012 Richard Hughes <[email protected]> |
| 4 |
* |
| 5 |
* Licensed under the GNU General Public License Version 2 |
| 6 |
* |
| 7 |
* This program is free software; you can redistribute it and/or modify |
| 8 |
* it under the terms of the GNU General Public License as published by |
| 9 |
* the Free Software Foundation; either version 2 of the License, or |
| 10 |
* (at your option) any later version. |
| 11 |
* |
| 12 |
* This program is distributed in the hope that it will be useful, |
| 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
* GNU General Public License for more details. |
| 16 |
* |
| 17 |
* You should have received a copy of the GNU General Public License |
| 18 |
* along with this program; if not, write to the Free Software |
| 19 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 20 |
*/ |
| 21 |
|
| 22 |
#ifndef __CD_DEVICE_H |
| 23 |
#define __CD_DEVICE_H |
| 24 |
|
| 25 |
#include <glib-object.h> |
| 26 |
|
| 27 |
#include "cd-common.h" |
| 28 |
#include "cd-profile.h" |
| 29 |
|
| 30 |
G_BEGIN_DECLS |
| 31 |
|
| 32 |
#define CD_DEVICE_ERROR cd_device_error_quark() |
| 33 |
|
| 34 |
#define CD_TYPE_DEVICE (cd_device_get_type ()) |
| 35 |
G_DECLARE_DERIVABLE_TYPE (CdDevice, cd_device, CD, DEVICE, GObject) |
| 36 |
|
| 37 |
struct _CdDeviceClass |
| 38 |
{ |
| 39 |
GObjectClass parent_class; |
| 40 |
void (* invalidate) (CdDevice *device); |
| 41 |
}; |
| 42 |
|
| 43 |
CdDevice *cd_device_new (void); |
| 44 |
GQuark cd_device_error_quark (void); |
| 45 |
|
| 46 |
/* accessors */ |
| 47 |
CdObjectScope cd_device_get_scope (CdDevice *device); |
| 48 |
void cd_device_set_scope (CdDevice *device, |
| 49 |
CdObjectScope object_scope); |
| 50 |
void cd_device_set_owner (CdDevice *device, |
| 51 |
guint owner); |
| 52 |
guint cd_device_get_owner (CdDevice *device); |
| 53 |
void cd_device_set_seat (CdDevice *device, |
| 54 |
const gchar *seat); |
| 55 |
const gchar *cd_device_get_seat (CdDevice *device); |
| 56 |
CdDeviceMode cd_device_get_mode (CdDevice *device); |
| 57 |
void cd_device_set_mode (CdDevice *device, |
| 58 |
CdDeviceMode mode); |
| 59 |
const gchar *cd_device_get_model (CdDevice *device); |
| 60 |
CdDeviceKind cd_device_get_kind (CdDevice *device); |
| 61 |
void cd_device_set_kind (CdDevice *device, |
| 62 |
CdDeviceKind kind); |
| 63 |
const gchar *cd_device_get_id (CdDevice *device); |
| 64 |
void cd_device_set_id (CdDevice *device, |
| 65 |
const gchar *id); |
| 66 |
gboolean cd_device_add_profile (CdDevice *device, |
| 67 |
CdDeviceRelation relation, |
| 68 |
const gchar *profile_object_path, |
| 69 |
guint64 timestamp, |
| 70 |
GError **error) |
| 71 |
G_GNUC_WARN_UNUSED_RESULT; |
| 72 |
gboolean cd_device_remove_profile (CdDevice *device, |
| 73 |
const gchar *profile_object_path, |
| 74 |
GError **error) |
| 75 |
G_GNUC_WARN_UNUSED_RESULT; |
| 76 |
gboolean cd_device_make_default (CdDevice *device, |
| 77 |
const gchar *profile_object_path, |
| 78 |
GError **error) |
| 79 |
G_GNUC_WARN_UNUSED_RESULT; |
| 80 |
const gchar *cd_device_get_object_path (CdDevice *device); |
| 81 |
gboolean cd_device_register_object (CdDevice *device, |
| 82 |
GDBusConnection *connection, |
| 83 |
GDBusInterfaceInfo *info, |
| 84 |
GError **error) |
| 85 |
G_GNUC_WARN_UNUSED_RESULT; |
| 86 |
void cd_device_watch_sender (CdDevice *device, |
| 87 |
const gchar *sender); |
| 88 |
gboolean cd_device_set_property_internal (CdDevice *device, |
| 89 |
const gchar *property, |
| 90 |
const gchar *value, |
| 91 |
gboolean save_in_db, |
| 92 |
GError **error); |
| 93 |
const gchar *cd_device_get_metadata (CdDevice *device, |
| 94 |
const gchar *key); |
| 95 |
|
| 96 |
G_END_DECLS |
| 97 |
|
| 98 |
#endif /* __CD_DEVICE_H */ |
| 99 |
|