| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2012 The Chromium 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 // Protocol buffer definitions for serializing Drive files and directories. | |
| 6 | |
| 7 syntax = "proto2"; | |
| 8 | |
| 9 option optimize_for = LITE_RUNTIME; | |
| 10 | |
| 11 package gdata; | |
| 12 | |
| 13 // DriveEntryKind is used in DriveEntryProto for specifying the kind of a | |
| 14 // Drive entry. | |
| 15 // | |
| 16 // kEntryKindMap in gdata_wapi_parser.cc should also be updated if you modify | |
| 17 // DriveEntryKind. The compiler will catch if they are not in sync. | |
| 18 enum DriveEntryKind { | |
| 19 ENTRY_KIND_UNKNOWN = 0; | |
| 20 // Special entries. | |
| 21 ENTRY_KIND_ITEM = 1; | |
| 22 ENTRY_KIND_SITE = 2; | |
| 23 // Hosted Google document. | |
| 24 ENTRY_KIND_DOCUMENT = 3; | |
| 25 ENTRY_KIND_SPREADSHEET = 4; | |
| 26 ENTRY_KIND_PRESENTATION = 5; | |
| 27 ENTRY_KIND_DRAWING = 6; | |
| 28 ENTRY_KIND_TABLE = 7; | |
| 29 // Hosted external application document. | |
| 30 ENTRY_KIND_EXTERNAL_APP = 8; | |
| 31 // Folders; collections. | |
| 32 ENTRY_KIND_FOLDER = 9; | |
| 33 // Regular files. | |
| 34 ENTRY_KIND_FILE = 10; | |
| 35 ENTRY_KIND_PDF = 11; | |
| 36 | |
| 37 // This should be the last item. | |
| 38 ENTRY_KIND_MAX_VALUE = 12; | |
| 39 }; | |
| 40 | |
| 41 // Represents base::PlatformFileInfo. | |
| 42 message PlatformFileInfoProto { | |
| 43 optional int64 size = 1; | |
| 44 optional bool is_directory = 2; | |
| 45 optional bool is_symbolic_link = 3; | |
| 46 optional int64 last_modified = 4; | |
| 47 optional int64 last_accessed = 5; | |
| 48 optional int64 creation_time = 6; | |
| 49 } | |
| 50 | |
| 51 // File specific info, which is a part of DriveEntryProto. | |
| 52 message DriveFileSpecificInfo { | |
| 53 // This URL points to a thumbnail image. The thumbnail URL is not permanent | |
| 54 // as it's not protected by authentication. See crbug.com/127697 for how | |
| 55 // stale thumbnail URLs are handled. | |
| 56 optional string thumbnail_url = 1; | |
| 57 | |
| 58 // This URL is used for opening hosted documents with Google Docs's web | |
| 59 // interface. | |
| 60 optional string alternate_url = 2; | |
| 61 | |
| 62 // Content mime type like "text/plain". | |
| 63 optional string content_mime_type = 3; | |
| 64 | |
| 65 // The MD5 of contents of a regular file. | |
| 66 optional string file_md5 = 4; | |
| 67 | |
| 68 // File extension, including the dot, used for hosted documents | |
| 69 // (ex. ".gsheet" for hosted spreadsheet documents). | |
| 70 optional string document_extension = 5; | |
| 71 | |
| 72 // True if the file is a hosted document. | |
| 73 optional bool is_hosted_document = 6; | |
| 74 } | |
| 75 | |
| 76 // Represents DriveEntry, DriveFile, and DriveDirectory without children. | |
| 77 message DriveEntryProto { | |
| 78 optional PlatformFileInfoProto file_info = 1; | |
| 79 optional string base_name = 2; | |
| 80 optional string title = 3; | |
| 81 optional string resource_id = 4; | |
| 82 optional string edit_url = 5; | |
| 83 optional string content_url = 6; | |
| 84 optional string parent_resource_id = 7; | |
| 85 // For a file, this is "resumable-edit-media" URL, used to update an | |
| 86 // existing file. For a directory, this is "resumable-create-media" URL, | |
| 87 // used to upload a new file to that directory. See | |
| 88 // https://developers.google.com/google-apps/documents-list/ | |
| 89 optional string upload_url = 8; | |
| 90 optional DriveEntryKind kind = 10; | |
| 91 // This field is used for processing the feeds from the server. Deleted | |
| 92 // entries won't be stored in the metadata storage. | |
| 93 optional bool deleted = 11; | |
| 94 | |
| 95 // File specific information, such as MD5. | |
| 96 optional DriveFileSpecificInfo file_specific_info = 9; | |
| 97 } | |
| 98 | |
| 99 // Represents DriveDirectory. This message type is defined to keep children | |
| 100 // separate from DriveEntryProto. This design allows us to get the metadata | |
| 101 // of a directory efficiently as DriveEntryProto, without carrying the | |
| 102 // metadata of children. | |
| 103 // | |
| 104 // TODO(satorux): With the new metadata storage system, we plan to store | |
| 105 // children as pairs of base name and resource ID. We should remove this | |
| 106 // message type once we get there. | |
| 107 message DriveDirectoryProto { | |
| 108 optional DriveEntryProto drive_entry = 1; | |
| 109 repeated DriveDirectoryProto child_directories = 7; | |
| 110 repeated DriveEntryProto child_files = 9; | |
| 111 } | |
| 112 | |
| 113 // Container for the root directory and the largest changestamp. | |
| 114 // TODO(satorux): Remove this: crbug.com/137862 | |
| 115 message DriveRootDirectoryProto { | |
| 116 optional DriveDirectoryProto drive_directory = 1; | |
| 117 optional int64 largest_changestamp = 4; | |
| 118 // Monotonically increasing version number, which is changed when | |
| 119 // incompatible change is made in the proto file. | |
| 120 // kProtoVersion in drive_files.h defines the current version. | |
| 121 optional int32 version = 3; | |
| 122 } | |
| 123 | |
| 124 // Message to store information of an existing cache file. | |
| 125 // Cache files are stored in 'tmp' or 'persistent' directory under the | |
| 126 // root cache directory. See DriveCache::GetCacheRootPath(). | |
| 127 message DriveCacheEntry { | |
| 128 // MD5 of the cache file. "local" if the file is locally modified. | |
| 129 optional string md5 = 1; | |
| 130 | |
| 131 // True if the file is present locally. | |
| 132 optional bool is_present = 2; | |
| 133 | |
| 134 // True if the file is pinned (i.e. available offline). | |
| 135 optional bool is_pinned = 3; | |
| 136 | |
| 137 // True if the file is dirty (i.e. modified locally). | |
| 138 optional bool is_dirty = 4; | |
| 139 | |
| 140 // True if the file is a mounted archive file. | |
| 141 optional bool is_mounted = 5; | |
| 142 | |
| 143 // True if the file is in the persistent directory. | |
| 144 optional bool is_persistent = 6; | |
| 145 | |
| 146 // When adding a new state, be sure to update TestDriveCacheState and test | |
| 147 // functions defined in drive_test_util.cc. | |
| 148 } | |
| OLD | NEW |