1// Copyright (c) 2012 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
5syntax = "proto2";
6
7option optimize_for = LITE_RUNTIME;
8
9// This protobuf is for sending file entries from a mtp/ptp device to the
10// browser.
11message MtpFileEntry {
12  // The id for the file on the mtp/ptp device.
13  optional uint32 item_id = 1;
14
15  // The id of this file's parent on the mtp/ptp device.
16  optional uint32 parent_id = 2;
17
18  // The file's name.
19  optional string file_name = 3;
20
21  // The file's size.
22  optional uint64 file_size = 4;
23
24  // The file's modification time. This is approximately the number of seconds
25  // since Unix epoch. However, it does not account for timezone offsets or
26  // daylight savings time.
27  optional int64 modification_time = 5;
28
29  // Values match libmtp values unless noted below.
30  enum FileType {
31    FILE_TYPE_FOLDER = 0;
32    FILE_TYPE_JPEG = 14;
33    FILE_TYPE_JFIF = 15;
34    FILE_TYPE_TIFF = 16;
35    FILE_TYPE_BMP = 17;
36    FILE_TYPE_GIF = 18;
37    FILE_TYPE_PICT = 19;
38    FILE_TYPE_PNG = 20;
39    FILE_TYPE_WINDOWSIMAGEFORMAT = 25;
40    FILE_TYPE_JP2 = 40;
41    FILE_TYPE_JPX = 41;
42    // Truly unknown file type.
43    FILE_TYPE_UNKNOWN = 44;
44    // There's more file types to map to, but right now they are not
45    // interesting. Just assign a dummy value for now.
46    FILE_TYPE_OTHER = 9999;
47  }
48
49  // The file's type.
50  optional FileType file_type = 6;
51}
52
53message MtpFileEntries {
54  repeated MtpFileEntry file_entries = 1;
55}
56