1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 /*
3  * Copyright (C) 2011 David Zeuthen <zeuthen@gmail.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General
16  * Public License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20 
21 #if !defined (__UDISKS_INSIDE_UDISKS_H__) && !defined (UDISKS_COMPILATION)
22 #error "Only <udisks/udisks.h> can be included directly."
23 #endif
24 
25 #ifndef __UDISKS_ENUMS_H__
26 #define __UDISKS_ENUMS_H__
27 
28 #include <gio/gio.h>
29 
30 G_BEGIN_DECLS
31 
32 /**
33  * UDisksError:
34  * @UDISKS_ERROR_FAILED: The operation failed.
35  * @UDISKS_ERROR_CANCELLED: The operation was cancelled.
36  * @UDISKS_ERROR_ALREADY_CANCELLED: The operation has already been cancelled.
37  * @UDISKS_ERROR_NOT_AUTHORIZED: Not authorized to perform the requested operation.
38  * @UDISKS_ERROR_NOT_AUTHORIZED_CAN_OBTAIN: Like %UDISKS_ERROR_NOT_AUTHORIZED but authorization can be obtained through e.g. authentication.
39  * @UDISKS_ERROR_NOT_AUTHORIZED_DISMISSED: Like %UDISKS_ERROR_NOT_AUTHORIZED but an authentication was shown and the user dismissed it.
40  * @UDISKS_ERROR_ALREADY_MOUNTED: The device is already mounted.
41  * @UDISKS_ERROR_NOT_MOUNTED: The device is not mounted.
42  * @UDISKS_ERROR_OPTION_NOT_PERMITTED: Not permitted to use the requested option.
43  * @UDISKS_ERROR_MOUNTED_BY_OTHER_USER: The device is mounted by another user.
44  * @UDISKS_ERROR_ALREADY_UNMOUNTING: The device is already unmounting.
45  * @UDISKS_ERROR_NOT_SUPPORTED: The operation is not supported due to missing driver/tool support.
46  * @UDISKS_ERROR_TIMED_OUT: The operation timed out.
47  * @UDISKS_ERROR_WOULD_WAKEUP: The operation would wake up a disk that is in a deep-sleep state.
48  * @UDISKS_ERROR_DEVICE_BUSY: Attempting to unmount a device that is busy.
49  *
50  * Error codes for the #UDISKS_ERROR error domain and the
51  * corresponding D-Bus error names.
52  */
53 typedef enum
54 {
55   UDISKS_ERROR_FAILED,                        /* org.freedesktop.UDisks2.Error.Failed */
56   UDISKS_ERROR_CANCELLED,                     /* org.freedesktop.UDisks2.Error.Cancelled */
57   UDISKS_ERROR_ALREADY_CANCELLED,             /* org.freedesktop.UDisks2.Error.AlreadyCancelled */
58   UDISKS_ERROR_NOT_AUTHORIZED,                /* org.freedesktop.UDisks2.Error.NotAuthorized */
59   UDISKS_ERROR_NOT_AUTHORIZED_CAN_OBTAIN,     /* org.freedesktop.UDisks2.Error.NotAuthorizedCanObtain */
60   UDISKS_ERROR_NOT_AUTHORIZED_DISMISSED,      /* org.freedesktop.UDisks2.Error.NotAuthorizedDismissed */
61   UDISKS_ERROR_ALREADY_MOUNTED,               /* org.freedesktop.UDisks2.Error.AlreadyMounted */
62   UDISKS_ERROR_NOT_MOUNTED,                   /* org.freedesktop.UDisks2.Error.NotMounted */
63   UDISKS_ERROR_OPTION_NOT_PERMITTED,          /* org.freedesktop.UDisks2.Error.OptionNotPermitted */
64   UDISKS_ERROR_MOUNTED_BY_OTHER_USER,         /* org.freedesktop.UDisks2.Error.MountedByOtherUser */
65   UDISKS_ERROR_ALREADY_UNMOUNTING,            /* org.freedesktop.UDisks2.Error.AlreadyUnmounting */
66   UDISKS_ERROR_NOT_SUPPORTED,                 /* org.freedesktop.UDisks2.Error.NotSupported */
67   UDISKS_ERROR_TIMED_OUT,                     /* org.freedesktop.UDisks2.Error.Timedout */
68   UDISKS_ERROR_WOULD_WAKEUP,                  /* org.freedesktop.UDisks2.Error.WouldWakeup */
69   UDISKS_ERROR_DEVICE_BUSY,                   /* org.freedesktop.UDisks2.Error.DeviceBusy */
70   UDISKS_ERROR_ISCSI_DAEMON_TRANSPORT_FAILED, /* org.freedesktop.UDisks2.Error.ISCSI.CommunicationFailed */
71   UDISKS_ERROR_ISCSI_HOST_NOT_FOUND,          /* org.freedesktop.UDisks2.Error.ISCSI.HostNotFound */
72   UDISKS_ERROR_ISCSI_IDMB,                    /* org.freedesktop.UDisks2.Error.ISCSI.IDMB */
73   UDISKS_ERROR_ISCSI_LOGIN_FAILED,            /* org.freedesktop.UDisks2.Error.ISCSI.LoginFailed */
74   UDISKS_ERROR_ISCSI_LOGIN_AUTH_FAILED,       /* org.freedesktop.UDisks2.Error.ISCSI.LoginAuthFailed */
75   UDISKS_ERROR_ISCSI_LOGIN_FATAL,             /* org.freedesktop.UDisks2.Error.ISCSI.LoginFatal */
76   UDISKS_ERROR_ISCSI_LOGOUT_FAILED,           /* org.freedesktop.UDisks2.Error.ISCSI.LogoutFailed */
77   UDISKS_ERROR_ISCSI_NO_FIRMWARE,             /* org.freedesktop.UDisks2.Error.ISCSI.NoFirmware */
78   UDISKS_ERROR_ISCSI_NO_OBJECTS_FOUND,        /* org.freedesktop.UDisks2.Error.ISCSI.NoObjectsFound */
79   UDISKS_ERROR_ISCSI_NOT_CONNECTED,           /* org.freedesktop.UDisks2.Error.ISCSI.NotConnected */
80   UDISKS_ERROR_ISCSI_TRANSPORT_FAILED,        /* org.freedesktop.UDisks2.Error.ISCSI.TransportFailed */
81   UDISKS_ERROR_ISCSI_UNKNOWN_DISCOVERY_TYPE   /* org.freedesktop.UDisks2.Error.ISCSI.UnknownDiscoveryType */
82 } UDisksError;
83 
84 #define UDISKS_ERROR_NUM_ENTRIES  (UDISKS_ERROR_ISCSI_UNKNOWN_DISCOVERY_TYPE + 1)
85 
86 /**
87  * UDisksPartitionTypeInfoFlags:
88  * @UDISKS_PARTITION_TYPE_INFO_FLAGS_NONE: No flags set.
89  * @UDISKS_PARTITION_TYPE_INFO_FLAGS_SWAP: Partition type is used for swap.
90  * @UDISKS_PARTITION_TYPE_INFO_FLAGS_RAID: Partition type is used for RAID/LVM or similar.
91  * @UDISKS_PARTITION_TYPE_INFO_FLAGS_HIDDEN: Partition type indicates the partition is hidden (e.g. 'dos' type 0x1b "Hidden W95 FAT32"). Note that this is not the same as user-toggleable attributes/flags for a partition.
92  * @UDISKS_PARTITION_TYPE_INFO_FLAGS_CREATE_ONLY: Partition type can only be used when creating a partition and e.g. should not be selectable in a "change partition type" user interface (e.g. 'dos' type 0x05, 0x0f and 0x85 for extended partitions).
93  * @UDISKS_PARTITION_TYPE_INFO_FLAGS_SYSTEM: Partition type indicates the partition is part of the system / bootloader (e.g. 'dos' types 0xee, 0xff, 'gpt' types for 'EFI System partition' and 'BIOS Boot partition').
94  *
95  * Flags describing a partition type.
96  */
97 typedef enum
98 {
99   UDISKS_PARTITION_TYPE_INFO_FLAGS_NONE        = 0,
100   UDISKS_PARTITION_TYPE_INFO_FLAGS_SWAP        = (1<<0),
101   UDISKS_PARTITION_TYPE_INFO_FLAGS_RAID        = (1<<1),
102   UDISKS_PARTITION_TYPE_INFO_FLAGS_HIDDEN      = (1<<2),
103   UDISKS_PARTITION_TYPE_INFO_FLAGS_CREATE_ONLY = (1<<3),
104   UDISKS_PARTITION_TYPE_INFO_FLAGS_SYSTEM      = (1<<4)
105 } UDisksPartitionTypeInfoFlags;
106 
107 G_END_DECLS
108 
109 #endif /* __UDISKS_ENUMS_H__ */
110