summaryrefslogtreecommitdiffstats
path: root/photoviewer/src/com/android/ex/photo/provider/PhotoContract.java
blob: 8483620fe83524768bec0439a8b26004da0e82f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
 * Copyright (C) 2011 Google Inc.
 * Licensed to The Android Open Source Project.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.ex.photo.provider;

import android.net.Uri;
import android.provider.OpenableColumns;

public final class PhotoContract {
    /** Columns for the view */
    public static interface PhotoViewColumns {
        /**
         * This column is a {@link Uri} that can be queried
         * for this individual image (resulting cursor has one single row for this image).
         */
        public static final String URI = "uri";
        /**
         * This column is a {@link String} that can be queried for this
         * individual image to return a displayable name.
         */
        public static final String NAME = OpenableColumns.DISPLAY_NAME;
        /**
         * This column is a {@link Uri} that points to the downloaded local file.
         * Can be null.
         */
        public static final String CONTENT_URI = "contentUri";
        /**
         * This column is a {@link Uri} that points to a thumbnail of the image
         * that ideally is a local file.
         * Can be null.
         */
        public static final String THUMBNAIL_URI = "thumbnailUri";
        /**
         * This string column is the MIME type.
         */
        public static final String CONTENT_TYPE = "contentType";
        /**
         * This boolean column indicates that a loading indicator should display permenantly
         * if no image urls are provided.
         */
        public static final String LOADING_INDICATOR = "loadingIndicator";

    }

    public static interface PhotoQuery {
        /** Projection of the returned cursor */
        public final static String[] PROJECTION = {
            PhotoViewColumns.URI,
            PhotoViewColumns.NAME,
            PhotoViewColumns.CONTENT_URI,
            PhotoViewColumns.THUMBNAIL_URI,
            PhotoViewColumns.CONTENT_TYPE,
        };
    }

    public static final class ContentTypeParameters {
        /**
         * Parameter used to specify which type of content to return.
         * Allows multiple types to be specified.
         */
        public static final String CONTENT_TYPE = "contentType";

        private ContentTypeParameters() {}
    }
}