Debian Codegraph @

src/cd-device-array.h

raw
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
2 *
3 * Copyright (C) 2010-2011 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_ARRAY_H
23 #define __CD_DEVICE_ARRAY_H
24
25 #include <glib-object.h>
26
27 #include "cd-device.h"
28
29 G_BEGIN_DECLS
30
31 #define CD_TYPE_DEVICE_ARRAY (cd_device_array_get_type ())
32 G_DECLARE_DERIVABLE_TYPE (CdDeviceArray, cd_device_array, CD, DEVICE_ARRAY, GObject)
33
34 struct _CdDeviceArrayClass
35 {
36 GObjectClass parent_class;
37 };
38
39 typedef enum {
40 CD_DEVICE_ARRAY_FLAG_NONE = 0,
41 CD_DEVICE_ARRAY_FLAG_OWNER_OPTIONAL = 1,
42 CD_DEVICE_ARRAY_FLAG_LAST,
43 } CdDeviceArrayFlags;
44
45 CdDeviceArray *cd_device_array_new (void);
46
47 void cd_device_array_add (CdDeviceArray *device_array,
48 CdDevice *device);
49 void cd_device_array_remove (CdDeviceArray *device_array,
50 CdDevice *device);
51 CdDevice *cd_device_array_get_by_id_owner (CdDeviceArray *device_array,
52 const gchar *id,
53 guint owner,
54 CdDeviceArrayFlags flags);
55 CdDevice *cd_device_array_get_by_object_path (CdDeviceArray *device_array,
56 const gchar *object_path);
57 CdDevice *cd_device_array_get_by_property (CdDeviceArray *device_array,
58 const gchar *key,
59 const gchar *value);
60 GPtrArray *cd_device_array_get_array (CdDeviceArray *device_array);
61 GPtrArray *cd_device_array_get_by_kind (CdDeviceArray *device_array,
62 CdDeviceKind kind);
63
64 G_END_DECLS
65
66 #endif /* __CD_DEVICE_ARRAY_H */
67