1/*
2 * Copyright (C) 2013 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.camera.data;
18
19import android.net.Uri;
20import android.provider.MediaStore;
21
22public class PhotoDataQuery {
23    // Sort all data by ID. This must be aligned with
24    // {@link CameraDataAdapter.QueryTask} which relies on the highest ID
25    // being first in any data returned.
26    public static final String QUERY_ORDER = MediaStore.Images.ImageColumns._ID + " DESC";
27    public static final Uri CONTENT_URI = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
28
29    public static final int COL_ID = 0;
30    public static final int COL_TITLE = 1;
31    public static final int COL_MIME_TYPE = 2;
32    public static final int COL_DATE_TAKEN = 3;
33    public static final int COL_DATE_MODIFIED = 4;
34    public static final int COL_DATA = 5;
35    public static final int COL_ORIENTATION = 6;
36    public static final int COL_WIDTH = 7;
37    public static final int COL_HEIGHT = 8;
38    public static final int COL_SIZE = 9;
39    public static final int COL_LATITUDE = 10;
40    public static final int COL_LONGITUDE = 11;
41
42    /**
43     * These values should be kept in sync with column IDs (COL_*) above.
44     */
45    public static final String[] QUERY_PROJECTION = {
46          MediaStore.Images.ImageColumns._ID,           // 0, int
47          MediaStore.Images.ImageColumns.TITLE,         // 1, string
48          MediaStore.Images.ImageColumns.MIME_TYPE,     // 2, string
49          MediaStore.Images.ImageColumns.DATE_TAKEN,    // 3, int
50          MediaStore.Images.ImageColumns.DATE_MODIFIED, // 4, int
51          MediaStore.Images.ImageColumns.DATA,          // 5, string
52          MediaStore.Images.ImageColumns.ORIENTATION,   // 6, int, 0, 90, 180, 270
53          MediaStore.Images.ImageColumns.WIDTH,         // 7, int
54          MediaStore.Images.ImageColumns.HEIGHT,        // 8, int
55          MediaStore.Images.ImageColumns.SIZE,          // 9, long
56          MediaStore.Images.ImageColumns.LATITUDE,      // 10, double
57          MediaStore.Images.ImageColumns.LONGITUDE      // 11, double
58    };
59}