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