1 // Copyright 2015 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef SYSTEM_API_DBUS_CROS_DISKS_DBUS_CONSTANTS_H_
6 #define SYSTEM_API_DBUS_CROS_DISKS_DBUS_CONSTANTS_H_
7 
8 namespace cros_disks {
9 const char kCrosDisksInterface[] = "org.chromium.CrosDisks";
10 const char kCrosDisksServicePath[] = "/org/chromium/CrosDisks";
11 const char kCrosDisksServiceName[] = "org.chromium.CrosDisks";
12 const char kCrosDisksServiceError[] = "org.chromium.CrosDisks.Error";
13 
14 // Methods.
15 const char kEnumerateAutoMountableDevices[] = "EnumerateAutoMountableDevices";
16 const char kEnumerateDevices[] = "EnumerateDevices";
17 const char kEnumerateMountEntries[] = "EnumerateMountEntries";
18 const char kFormat[] = "Format";
19 const char kGetDeviceProperties[] = "GetDeviceProperties";
20 const char kMount[] = "Mount";
21 const char kRename[] = "Rename";
22 const char kUnmount[] = "Unmount";
23 
24 // Signals.
25 const char kDeviceAdded[] = "DeviceAdded";
26 const char kDeviceScanned[] = "DeviceScanned";
27 const char kDeviceRemoved[] = "DeviceRemoved";
28 const char kDiskAdded[] = "DiskAdded";
29 const char kDiskChanged[] = "DiskChanged";
30 const char kDiskRemoved[] = "DiskRemoved";
31 const char kFormatCompleted[] = "FormatCompleted";
32 const char kMountCompleted[] = "MountCompleted";
33 const char kRenameCompleted[] = "RenameCompleted";
34 
35 // Properties.
36 // TODO(benchan): Drop unnecessary 'Device' / 'Drive' prefix as they were
37 // carried through old code base.
38 const char kDeviceFile[] = "DeviceFile";
39 const char kDeviceIsDrive[] = "DeviceIsDrive";
40 const char kDeviceIsMediaAvailable[] = "DeviceIsMediaAvailable";
41 const char kDeviceIsMounted[] = "DeviceIsMounted";
42 const char kDeviceIsOnBootDevice[] = "DeviceIsOnBootDevice";
43 const char kDeviceIsOnRemovableDevice[] = "DeviceIsOnRemovableDevice";
44 const char kDeviceIsReadOnly[] = "DeviceIsReadOnly";
45 const char kDeviceIsVirtual[] = "DeviceIsVirtual";
46 const char kDeviceMediaType[] = "DeviceMediaType";
47 const char kDeviceMountPaths[] = "DeviceMountPaths";
48 const char kDevicePresentationHide[] = "DevicePresentationHide";
49 const char kDeviceSize[] = "DeviceSize";
50 const char kDriveModel[] = "DriveModel";
51 const char kIsAutoMountable[] = "IsAutoMountable";
52 const char kIdLabel[] = "IdLabel";
53 const char kIdUuid[] = "IdUuid";
54 const char kVendorId[] = "VendorId";
55 const char kVendorName[] = "VendorName";
56 const char kProductId[] = "ProductId";
57 const char kProductName[] = "ProductName";
58 const char kNativePath[] = "NativePath";
59 const char kFileSystemType[] = "FileSystemType";
60 
61 // Enum values.
62 // DeviceMediaType enum values are reported through UMA.
63 // All values but DEVICE_MEDIA_NUM_VALUES should not be changed or removed.
64 // Additional values can be added but DEVICE_MEDIA_NUM_VALUES should always
65 // be the last value in the enum.
66 enum DeviceMediaType {
67   DEVICE_MEDIA_UNKNOWN = 0,
68   DEVICE_MEDIA_USB = 1,
69   DEVICE_MEDIA_SD = 2,
70   DEVICE_MEDIA_OPTICAL_DISC = 3,
71   DEVICE_MEDIA_MOBILE = 4,
72   DEVICE_MEDIA_DVD = 5,
73   DEVICE_MEDIA_NUM_VALUES,
74 };
75 
76 enum FormatErrorType {
77   FORMAT_ERROR_NONE = 0,
78   FORMAT_ERROR_UNKNOWN = 1,
79   FORMAT_ERROR_INTERNAL = 2,
80   FORMAT_ERROR_INVALID_DEVICE_PATH = 3,
81   FORMAT_ERROR_DEVICE_BEING_FORMATTED = 4,
82   FORMAT_ERROR_UNSUPPORTED_FILESYSTEM = 5,
83   FORMAT_ERROR_FORMAT_PROGRAM_NOT_FOUND = 6,
84   FORMAT_ERROR_FORMAT_PROGRAM_FAILED = 7,
85   FORMAT_ERROR_DEVICE_NOT_ALLOWED = 8,
86 };
87 
88 // TODO(benchan): After both Chrome and cros-disks use these enum values,
89 // make these error values contiguous so that they can be directly reported
90 // via UMA.
91 enum MountErrorType {
92   MOUNT_ERROR_NONE = 0,
93   MOUNT_ERROR_UNKNOWN = 1,
94   MOUNT_ERROR_INTERNAL = 2,
95   MOUNT_ERROR_INVALID_ARGUMENT = 3,
96   MOUNT_ERROR_INVALID_PATH = 4,
97   MOUNT_ERROR_PATH_ALREADY_MOUNTED = 5,
98   MOUNT_ERROR_PATH_NOT_MOUNTED = 6,
99   MOUNT_ERROR_DIRECTORY_CREATION_FAILED = 7,
100   MOUNT_ERROR_INVALID_MOUNT_OPTIONS = 8,
101   MOUNT_ERROR_INVALID_UNMOUNT_OPTIONS = 9,
102   MOUNT_ERROR_INSUFFICIENT_PERMISSIONS = 10,
103   MOUNT_ERROR_MOUNT_PROGRAM_NOT_FOUND = 11,
104   MOUNT_ERROR_MOUNT_PROGRAM_FAILED = 12,
105   MOUNT_ERROR_INVALID_DEVICE_PATH = 100,
106   MOUNT_ERROR_UNKNOWN_FILESYSTEM = 101,
107   MOUNT_ERROR_UNSUPPORTED_FILESYSTEM = 102,
108   MOUNT_ERROR_INVALID_ARCHIVE = 201,
109   MOUNT_ERROR_UNSUPPORTED_ARCHIVE = 202,
110 };
111 
112 // MountSourceType enum values are solely used by Chrome/CrosDisks in
113 // the MountCompleted signal, and currently not reported through UMA.
114 enum MountSourceType {
115   MOUNT_SOURCE_INVALID = 0,
116   MOUNT_SOURCE_REMOVABLE_DEVICE = 1,
117   MOUNT_SOURCE_ARCHIVE = 2,
118   MOUNT_SOURCE_NETWORK_STORAGE = 3,
119 };
120 
121 enum RenameErrorType {
122   RENAME_ERROR_NONE = 0,
123   RENAME_ERROR_UNKNOWN = 1,
124   RENAME_ERROR_INTERNAL = 2,
125   RENAME_ERROR_INVALID_DEVICE_PATH = 3,
126   RENAME_ERROR_DEVICE_BEING_RENAMED = 4,
127   RENAME_ERROR_UNSUPPORTED_FILESYSTEM = 5,
128   RENAME_ERROR_RENAME_PROGRAM_NOT_FOUND = 6,
129   RENAME_ERROR_RENAME_PROGRAM_FAILED = 7,
130   RENAME_ERROR_DEVICE_NOT_ALLOWED = 8,
131   RENAME_ERROR_LONG_NAME = 9,
132   RENAME_ERROR_INVALID_CHARACTER = 10,
133 };
134 }  // namespace cros_disks
135 
136 #endif  // SYSTEM_API_DBUS_CROS_DISKS_DBUS_CONSTANTS_H_
137