Home | History | Annotate | Download | only in provider
      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 
     18 package com.android.ex.photo.provider;
     19 
     20 import android.net.Uri;
     21 import android.provider.OpenableColumns;
     22 
     23 public 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          * This boolean column indicates that a loading indicator should display permenantly
     53          * if no image urls are provided.
     54          */
     55         public static final String LOADING_INDICATOR = "loadingIndicator";
     56 
     57     }
     58 
     59     public static interface PhotoQuery {
     60         /** Projection of the returned cursor */
     61         public final static String[] PROJECTION = {
     62             PhotoViewColumns.URI,
     63             PhotoViewColumns.NAME,
     64             PhotoViewColumns.CONTENT_URI,
     65             PhotoViewColumns.THUMBNAIL_URI,
     66             PhotoViewColumns.CONTENT_TYPE,
     67         };
     68     }
     69 
     70     public static final class ContentTypeParameters {
     71         /**
     72          * Parameter used to specify which type of content to return.
     73          * Allows multiple types to be specified.
     74          */
     75         public static final String CONTENT_TYPE = "contentType";
     76 
     77         private ContentTypeParameters() {}
     78     }
     79 }
     80