1/* 2 * Copyright (C) 2009 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.gallery; 18 19import android.net.Uri; 20 21import java.util.HashMap; 22 23// 24// ImageList and Image classes have one-to-one correspondence. 25// The class hierarchy (* = abstract class): 26// 27// IImageList 28// - BaseImageList (*) 29// - VideoList 30// - ImageList 31// - DrmImageList 32// - SingleImageList (contains UriImage) 33// - ImageListUber 34// 35// IImage 36// - BaseImage (*) 37// - VideoObject 38// - Image 39// - DrmImage 40// - UriImage 41// 42 43/** 44 * The interface of all image collections used in gallery. 45 */ 46public interface IImageList { 47 public HashMap<String, String> getBucketIds(); 48 49 /** 50 * Returns the count of image objects. 51 * 52 * @return the number of images 53 */ 54 public int getCount(); 55 56 /** 57 * @return true if the count of image objects is zero. 58 */ 59 public boolean isEmpty(); 60 61 /** 62 * Returns the image at the ith position. 63 * 64 * @param i the position 65 * @return the image at the ith position 66 */ 67 public IImage getImageAt(int i); 68 69 /** 70 * Returns the image with a particular Uri. 71 * 72 * @param uri 73 * @return the image with a particular Uri. null if not found. 74 */ 75 public IImage getImageForUri(Uri uri); 76 77 /** 78 * 79 * @param image 80 * @return true if the image was removed. 81 */ 82 public boolean removeImage(IImage image); 83 84 /** 85 * Removes the image at the ith position. 86 * @param i the position 87 */ 88 public boolean removeImageAt(int i); 89 90 public int getImageIndex(IImage image); 91 92 /** 93 * Closes this list to release resources, no further operation is allowed. 94 */ 95 public void close(); 96} 97