bolt-device.h 2.85 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
/*
 * Copyright © 2017 Red Hat, Inc
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
 *
 * Authors:
 *       Christian J. Kellner <christian@kellner.me>
 */

#pragma once

23
#include "bolt-auth.h"
24
#include "bolt-enums.h"
25
26
27
28
29
30
31
32
33
34
#include "bolt-gdbus.h"

/* forward declaration */
struct udev_device;

G_BEGIN_DECLS

#define BOLT_TYPE_DEVICE bolt_device_get_type ()
G_DECLARE_FINAL_TYPE (BoltDevice, bolt_device, BOLT, DEVICE, BoltDBusDeviceSkeleton);

35
BoltDevice *      bolt_device_new_for_udev (struct udev_device *udev,
36
37
                                            GError            **error);

38
const char *      bolt_device_export (BoltDevice      *device,
39
40
41
42
43
                                      GDBusConnection *connection,
                                      GError         **error);

void              bolt_device_unexport (BoltDevice *device);

44
45
46
47
48
BoltStatus        bolt_device_connected (BoltDevice         *dev,
                                         struct udev_device *udev);

BoltStatus        bolt_device_disconnected (BoltDevice *dev);

49
gboolean          bolt_device_is_connected (const BoltDevice *device);
50

51
52
53
BoltStatus        bolt_device_update_from_udev (BoltDevice         *dev,
                                                struct udev_device *udev);

54
55
56
57
void              bolt_device_authorize (BoltDevice         *dev,
                                         BoltAuth           *auth,
                                         GAsyncReadyCallback callback,
                                         gpointer            user_data);
58

59
BoltKeyState      bolt_device_get_keystate (const BoltDevice *dev);
60

61
const char *      bolt_device_get_name (const BoltDevice *dev);
62

63
64
const char *      bolt_device_get_object_path (BoltDevice *device);

65
BoltPolicy        bolt_device_get_policy (const BoltDevice *dev);
66

67
const char *      bolt_device_get_uid (const BoltDevice *dev);
68

69
BoltSecurity      bolt_device_get_security (const BoltDevice *dev);
70

71
gboolean          bolt_device_get_stored (const BoltDevice *dev);
72

73
BoltStatus        bolt_device_get_status (const BoltDevice *dev);
Christian Kellner's avatar
Christian Kellner committed
74

75
const char *      bolt_device_get_syspath (const BoltDevice *dev);
76

77
const char *      bolt_device_get_vendor (const BoltDevice *dev);
78

79
80
BoltDeviceType    bolt_device_get_device_type (const BoltDevice *dev);

81
G_END_DECLS