• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 kEnumerateMountEntries[] = "EnumerateMountEntries";
17 const char kFormat[] = "Format";
18 const char kGetDeviceProperties[] = "GetDeviceProperties";
19 const char kMount[] = "Mount";
20 const char kUnmount[] = "Unmount";
21 
22 // Signals.
23 const char kDeviceAdded[] = "DeviceAdded";
24 const char kDeviceScanned[] = "DeviceScanned";
25 const char kDeviceRemoved[] = "DeviceRemoved";
26 const char kDiskAdded[] = "DiskAdded";
27 const char kDiskChanged[] = "DiskChanged";
28 const char kDiskRemoved[] = "DiskRemoved";
29 const char kFormatCompleted[] = "FormatCompleted";
30 const char kMountCompleted[] = "MountCompleted";
31 
32 // Properties.
33 // TODO(benchan): Rename 'DeviceIs*' property to 'DiskIs*' as the latter is more
34 // accurate.
35 const char kDeviceFile[] = "DeviceFile";
36 const char kDeviceIsDrive[] = "DeviceIsDrive";
37 const char kDeviceIsMediaAvailable[] = "DeviceIsMediaAvailable";
38 const char kDeviceIsMounted[] = "DeviceIsMounted";
39 const char kDeviceIsOnBootDevice[] = "DeviceIsOnBootDevice";
40 const char kDeviceIsOnRemovableDevice[] = "DeviceIsOnRemovableDevice";
41 const char kDeviceIsReadOnly[] = "DeviceIsReadOnly";
42 const char kDeviceIsVirtual[] = "DeviceIsVirtual";
43 const char kDeviceMediaType[] = "DeviceMediaType";
44 const char kDeviceMountPaths[] = "DeviceMountPaths";
45 const char kDevicePresentationHide[] = "DevicePresentationHide";
46 const char kDeviceSize[] = "DeviceSize";
47 const char kDriveIsRotational[] = "DriveIsRotational";
48 const char kDriveModel[] = "DriveModel";
49 const char kIdLabel[] = "IdLabel";
50 const char kIdUuid[] = "IdUuid";
51 const char kVendorId[] = "VendorId";
52 const char kVendorName[] = "VendorName";
53 const char kProductId[] = "ProductId";
54 const char kProductName[] = "ProductName";
55 const char kNativePath[] = "NativePath";
56 
57 // Enum values.
58 // DeviceMediaType enum values are reported through UMA.
59 // All values but DEVICE_MEDIA_NUM_VALUES should not be changed or removed.
60 // Additional values can be added but DEVICE_MEDIA_NUM_VALUES should always
61 // be the last value in the enum.
62 enum DeviceMediaType {
63   DEVICE_MEDIA_UNKNOWN = 0,
64   DEVICE_MEDIA_USB = 1,
65   DEVICE_MEDIA_SD = 2,
66   DEVICE_MEDIA_OPTICAL_DISC = 3,
67   DEVICE_MEDIA_MOBILE = 4,
68   DEVICE_MEDIA_DVD = 5,
69   DEVICE_MEDIA_NUM_VALUES,
70 };
71 
72 enum FormatErrorType {
73   FORMAT_ERROR_NONE = 0,
74   FORMAT_ERROR_UNKNOWN = 1,
75   FORMAT_ERROR_INTERNAL = 2,
76   FORMAT_ERROR_INVALID_DEVICE_PATH = 3,
77   FORMAT_ERROR_DEVICE_BEING_FORMATTED = 4,
78   FORMAT_ERROR_UNSUPPORTED_FILESYSTEM = 5,
79   FORMAT_ERROR_FORMAT_PROGRAM_NOT_FOUND = 6,
80   FORMAT_ERROR_FORMAT_PROGRAM_FAILED = 7,
81   FORMAT_ERROR_DEVICE_NOT_ALLOWED = 8,
82 };
83 
84 // TODO(benchan): After both Chrome and cros-disks use these enum values,
85 // make these error values contiguous so that they can be directly reported
86 // via UMA.
87 enum MountErrorType {
88   MOUNT_ERROR_NONE = 0,
89   MOUNT_ERROR_UNKNOWN = 1,
90   MOUNT_ERROR_INTERNAL = 2,
91   MOUNT_ERROR_INVALID_ARGUMENT = 3,
92   MOUNT_ERROR_INVALID_PATH = 4,
93   MOUNT_ERROR_PATH_ALREADY_MOUNTED = 5,
94   MOUNT_ERROR_PATH_NOT_MOUNTED = 6,
95   MOUNT_ERROR_DIRECTORY_CREATION_FAILED = 7,
96   MOUNT_ERROR_INVALID_MOUNT_OPTIONS = 8,
97   MOUNT_ERROR_INVALID_UNMOUNT_OPTIONS = 9,
98   MOUNT_ERROR_INSUFFICIENT_PERMISSIONS = 10,
99   MOUNT_ERROR_MOUNT_PROGRAM_NOT_FOUND = 11,
100   MOUNT_ERROR_MOUNT_PROGRAM_FAILED = 12,
101   MOUNT_ERROR_INVALID_DEVICE_PATH = 100,
102   MOUNT_ERROR_UNKNOWN_FILESYSTEM = 101,
103   MOUNT_ERROR_UNSUPPORTED_FILESYSTEM = 102,
104   MOUNT_ERROR_INVALID_ARCHIVE = 201,
105   MOUNT_ERROR_UNSUPPORTED_ARCHIVE = 202,
106 };
107 
108 // MountSourceType enum values are solely used by Chrome/CrosDisks in
109 // the MountCompleted signal, and currently not reported through UMA.
110 enum MountSourceType {
111   MOUNT_SOURCE_INVALID = 0,
112   MOUNT_SOURCE_REMOVABLE_DEVICE = 1,
113   MOUNT_SOURCE_ARCHIVE = 2,
114   MOUNT_SOURCE_NETWORK_STORAGE = 3,
115 };
116 }  // namespace cros_disks
117 
118 #endif  // SYSTEM_API_DBUS_CROS_DISKS_DBUS_CONSTANTS_H_
119