chromium/chrome/common/extensions/api/file_manager_private_internal.idl

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Internal, used by fileManagerPrivate's custom bindings.
[platforms=("chromeos"),
 implemented_in="chrome/browser/ash/extensions/file_manager/file_manager_private_api_functions.h"]
namespace fileManagerPrivateInternal {
  // Entry information that renderers need to create an Entry instance.
  dictionary EntryDescription {
    DOMString fileSystemName;
    DOMString fileSystemRoot;
    DOMString fileFullPath;
    boolean fileIsDirectory;
  };
  dictionary IOTaskParams {
    DOMString? destinationFolderUrl;
    DOMString? password;
    boolean? showNotification;
  };
  dictionary ParsedTrashInfoFile {
    EntryDescription restoreEntry;
    DOMString trashInfoFileName;
    double deletionDate;
  };
  dictionary SearchFilesParams {
    DOMString? rootUrl;
    DOMString query;
    fileManagerPrivate.SearchType types;
    long maxResults;
    double modifiedTimestamp;
    fileManagerPrivate.FileCategory category;
  };
  dictionary CrostiniSharedPathResponse {
    EntryDescription[] entries;
    boolean firstForSession;
  };

  callback SimpleCallback = void();
  callback ResolveIsolatedEntriesCallback = void(EntryDescription[] entries);
  callback GetEntryPropertiesCallback = void(
      fileManagerPrivate.EntryProperties[] entryProperties);
  callback AddFileWatchCallback = void(optional boolean success);
  callback RemoveFileWatchCallback = void(optional boolean success);
  callback GetCustomActionsCallback = void(fileSystemProvider.Action[] actions);
  callback GetMimeTypeCallback = void(DOMString result);
  callback GetContentMimeTypeCallback = void(DOMString result);
  callback GetContentMetadataCallback = void(
      fileManagerPrivate.MediaMetadata result);
  callback ExecuteTaskCallback = void(fileManagerPrivate.TaskResult result);
  callback GetFileTasksCallback = void(fileManagerPrivate.ResultingTasks resultingTasks);
  callback GetDisallowedTransfersCallback =
      void(EntryDescription[] entries);
  callback GetDlpMetadataCallback =
      void(fileManagerPrivate.DlpMetadata[] entries);
  callback GetDriveQuotaMetadataCallback =
      void(optional fileManagerPrivate.DriveQuotaMetadata driveQuotaMetadata);
  callback IOTaskIdCallback = void(long taskId);
  callback ValidatePathNameLengthCallback = void(boolean result);
  callback GetDirectorySizeCallback = void(double size);
  callback GetRecentFilesCallback = void(EntryDescription[] entries);
  callback GetCrostiniSharedPathsCallback =
      void(CrostiniSharedPathResponse response);
  callback GetLinuxPackageInfoCallback =
      void(fileManagerPrivate.LinuxPackageInfo linux_package_info);
  callback InstallLinuxPackageCallback =
      void(fileManagerPrivate.InstallLinuxPackageStatus status);
  callback GetThumbnailCallback = void(DOMString ThumbnailDataUrl);
  callback BooleanCallback = void(boolean result);
  callback GetVolumeRootCallback = void(EntryDescription rootDir);
  callback ParseTrashInfoFilesCallback = void(ParsedTrashInfoFile[] files);
  callback SearchFilesCallback = void(EntryDescription[] entries);

  interface Functions {
    static void resolveIsolatedEntries(
        DOMString[] urls,
        ResolveIsolatedEntriesCallback callback);
    static void getEntryProperties(
        DOMString[] urls,
        fileManagerPrivate.EntryPropertyName[] names,
        GetEntryPropertiesCallback callback);
    static void addFileWatch(
        DOMString url,
        AddFileWatchCallback callback);
    static void removeFileWatch(
        DOMString url,
        RemoveFileWatchCallback callback);
    static void getCustomActions(
        DOMString[] urls,
        GetCustomActionsCallback callback);
    static void executeCustomAction(
        DOMString[] urls,
        DOMString actionId,
        SimpleCallback callback);
    static void getContentMimeType(
        DOMString blobUUID,
        GetContentMimeTypeCallback callback);
    static void getContentMetadata(
        DOMString blobUUID,
        DOMString mimeType,
        boolean includeImages,
        GetContentMetadataCallback callback);
    static void pinDriveFile(
        DOMString url,
        boolean pin,
        SimpleCallback callback);
    static void executeTask(
        fileManagerPrivate.FileTaskDescriptor descriptor,
        DOMString[] urls,
        ExecuteTaskCallback callback);
    static void searchFiles(
        SearchFilesParams searchParams, SearchFilesCallback callback);
    static void setDefaultTask(
        fileManagerPrivate.FileTaskDescriptor descriptor,
        DOMString[] urls,
        DOMString[] mimeTypes,
        SimpleCallback callback);
    static void getFileTasks(
        DOMString[] urls,
        DOMString[] dlpSourceUrls,
        GetFileTasksCallback callback);
    static void getDisallowedTransfers(
        DOMString[] entries,
        DOMString destinationEntry,
        boolean isMove,
        GetDisallowedTransfersCallback callback);
    static void getDlpMetadata(
        DOMString[] entries,
        GetDlpMetadataCallback callback);
    static void getDriveQuotaMetadata(
        DOMString url,
        GetDriveQuotaMetadataCallback callback);
    static void validatePathNameLength(
        DOMString parentUrl,
        DOMString name,
        ValidatePathNameLengthCallback callback);
    static void getDirectorySize(
        DOMString url,
        GetDirectorySizeCallback callback);
    static void getVolumeRoot(
        fileManagerPrivate.GetVolumeRootOptions options,
        GetVolumeRootCallback callback);
    static void getRecentFiles(
        fileManagerPrivate.SourceRestriction restriction,
        DOMString query,
        long cutoff_days,
        fileManagerPrivate.FileCategory file_category,
        boolean invalidate_cache,
        GetRecentFilesCallback callback);
    static void sharePathsWithCrostini(
        DOMString vmName, DOMString[] urls,
        boolean persist,
        SimpleCallback callback);
    static void unsharePathWithCrostini(
        DOMString vmName, DOMString url,
        SimpleCallback callback);
    static void getCrostiniSharedPaths(
        boolean observeFirstForSession,
        DOMString vmName,
        GetCrostiniSharedPathsCallback callback);
    static void getLinuxPackageInfo(
        DOMString url,
        GetLinuxPackageInfoCallback callback);
    static void installLinuxPackage(
        DOMString url,
        InstallLinuxPackageCallback callback);
    static void importCrostiniImage(DOMString url);
    static void toggleAddedToHoldingSpace(
        DOMString[] urls, boolean add,
                                          optional SimpleCallback callback);
    static void startIOTask(
        fileManagerPrivate.IoTaskType type,
        DOMString[] urls,
        IOTaskParams params,
        optional IOTaskIdCallback callback);
    static void parseTrashInfoFiles(
        DOMString[] urls,
        ParseTrashInfoFilesCallback callback);
  };
};