1/*
2 * Copyright (C) 2011 Google Inc.
3 * Licensed to The Android Open Source Project.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 *      http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18package com.android.ex.photo.provider;
19
20import android.net.Uri;
21import android.provider.OpenableColumns;
22
23public final class PhotoContract {
24    /** Columns for the view */
25    public static interface PhotoViewColumns {
26        /**
27         * This column is a {@link Uri} that can be queried
28         * for this individual image (resulting cursor has one single row for this image).
29         */
30        public static final String URI = "uri";
31        /**
32         * This column is a {@link String} that can be queried for this
33         * individual image to return a displayable name.
34         */
35        public static final String NAME = OpenableColumns.DISPLAY_NAME;
36        /**
37         * This column is a {@link Uri} that points to the downloaded local file.
38         * Can be null.
39         */
40        public static final String CONTENT_URI = "contentUri";
41        /**
42         * This column is a {@link Uri} that points to a thumbnail of the image
43         * that ideally is a local file.
44         * Can be null.
45         */
46        public static final String THUMBNAIL_URI = "thumbnailUri";
47        /**
48         * This string column is the MIME type.
49         */
50        public static final String CONTENT_TYPE = "contentType";
51
52    }
53
54    public static interface PhotoQuery {
55        /** Projection of the returned cursor */
56        public final static String[] PROJECTION = {
57            PhotoViewColumns.URI,
58            PhotoViewColumns.NAME,
59            PhotoViewColumns.CONTENT_URI,
60            PhotoViewColumns.THUMBNAIL_URI,
61            PhotoViewColumns.CONTENT_TYPE,
62        };
63    }
64
65    public static final class ContentTypeParameters {
66        /**
67         * Parameter used to specify which type of content to return.
68         * Allows multiple types to be specified.
69         */
70        public static final String CONTENT_TYPE = "contentType";
71
72        private ContentTypeParameters() {}
73    }
74}
75