Home | History | Annotate | Download | only in cros-disks
      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 kExperimentalFeaturesEnabled[] = "ExperimentalFeaturesEnabled";
     50 const char kIdLabel[] = "IdLabel";
     51 const char kIdUuid[] = "IdUuid";
     52 const char kVendorId[] = "VendorId";
     53 const char kVendorName[] = "VendorName";
     54 const char kProductId[] = "ProductId";
     55 const char kProductName[] = "ProductName";
     56 const char kNativePath[] = "NativePath";
     57 
     58 // Enum values.
     59 // DeviceMediaType enum values are reported through UMA.
     60 // All values but DEVICE_MEDIA_NUM_VALUES should not be changed or removed.
     61 // Additional values can be added but DEVICE_MEDIA_NUM_VALUES should always
     62 // be the last value in the enum.
     63 enum DeviceMediaType {
     64   DEVICE_MEDIA_UNKNOWN = 0,
     65   DEVICE_MEDIA_USB = 1,
     66   DEVICE_MEDIA_SD = 2,
     67   DEVICE_MEDIA_OPTICAL_DISC = 3,
     68   DEVICE_MEDIA_MOBILE = 4,
     69   DEVICE_MEDIA_DVD = 5,
     70   DEVICE_MEDIA_NUM_VALUES,
     71 };
     72 
     73 enum FormatErrorType {
     74   FORMAT_ERROR_NONE = 0,
     75   FORMAT_ERROR_UNKNOWN = 1,
     76   FORMAT_ERROR_INTERNAL = 2,
     77   FORMAT_ERROR_INVALID_DEVICE_PATH = 3,
     78   FORMAT_ERROR_DEVICE_BEING_FORMATTED = 4,
     79   FORMAT_ERROR_UNSUPPORTED_FILESYSTEM = 5,
     80   FORMAT_ERROR_FORMAT_PROGRAM_NOT_FOUND = 6,
     81   FORMAT_ERROR_FORMAT_PROGRAM_FAILED = 7,
     82   FORMAT_ERROR_DEVICE_NOT_ALLOWED = 8,
     83 };
     84 
     85 // TODO(benchan): After both Chrome and cros-disks use these enum values,
     86 // make these error values contiguous so that they can be directly reported
     87 // via UMA.
     88 enum MountErrorType {
     89   MOUNT_ERROR_NONE = 0,
     90   MOUNT_ERROR_UNKNOWN = 1,
     91   MOUNT_ERROR_INTERNAL = 2,
     92   MOUNT_ERROR_INVALID_ARGUMENT = 3,
     93   MOUNT_ERROR_INVALID_PATH = 4,
     94   MOUNT_ERROR_PATH_ALREADY_MOUNTED = 5,
     95   MOUNT_ERROR_PATH_NOT_MOUNTED = 6,
     96   MOUNT_ERROR_DIRECTORY_CREATION_FAILED = 7,
     97   MOUNT_ERROR_INVALID_MOUNT_OPTIONS = 8,
     98   MOUNT_ERROR_INVALID_UNMOUNT_OPTIONS = 9,
     99   MOUNT_ERROR_INSUFFICIENT_PERMISSIONS = 10,
    100   MOUNT_ERROR_MOUNT_PROGRAM_NOT_FOUND = 11,
    101   MOUNT_ERROR_MOUNT_PROGRAM_FAILED = 12,
    102   MOUNT_ERROR_INVALID_DEVICE_PATH = 100,
    103   MOUNT_ERROR_UNKNOWN_FILESYSTEM = 101,
    104   MOUNT_ERROR_UNSUPPORTED_FILESYSTEM = 102,
    105   MOUNT_ERROR_INVALID_ARCHIVE = 201,
    106   MOUNT_ERROR_UNSUPPORTED_ARCHIVE = 202,
    107 };
    108 
    109 // MountSourceType enum values are solely used by Chrome/CrosDisks in
    110 // the MountCompleted signal, and currently not reported through UMA.
    111 enum MountSourceType {
    112   MOUNT_SOURCE_INVALID = 0,
    113   MOUNT_SOURCE_REMOVABLE_DEVICE = 1,
    114   MOUNT_SOURCE_ARCHIVE = 2,
    115   MOUNT_SOURCE_NETWORK_STORAGE = 3,
    116 };
    117 }  // namespace cros_disks
    118 
    119 #endif  // SYSTEM_API_DBUS_CROS_DISKS_DBUS_CONSTANTS_H_
    120